test call_optional not calling non-callable functions

This commit is contained in:
Ronny Pfannschmidt 2012-11-05 21:17:58 +01:00
parent 40a55a640c
commit 04754f6748
1 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,12 @@ def test_setup_func_with_setup_decorator():
assert not l 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): def test_nose_setup_func(testdir):
p = testdir.makepyfile(""" p = testdir.makepyfile("""
from nose.tools import with_setup from nose.tools import with_setup