Commits

Ronny Pfannschmidt  committed 2bde735 Merge

merge pull request

  • Participants
  • Parent commits 08e713c, efc2693

Comments (0)

Files changed (2)

File _pytest/nose.py

 
 def call_optional(obj, name):
     method = getattr(obj, name, None)
-    if method is not None and not hasattr(method, "_pytestfixturefunction"):
+    if method is not None and not hasattr(method, "_pytestfixturefunction") and callable(method):
         # If there's any problems allow the exception to raise rather than
         # silently ignoring them
         method()

File testing/test_nose.py

     assert not l
 
 
+def test_setup_func_not_callable():
+    from _pytest.nose import call_optional
+    class A:
+        f = 1
+    call_optional(A(), "f")
+
 def test_nose_setup_func(testdir):
     p = testdir.makepyfile("""
         from nose.tools import with_setup