nose plugin wont call setup functions that arent made for it

--HG--
branch : trunk
This commit is contained in:
Ronny Pfannschmidt 2009-10-23 16:16:28 +02:00
parent 8e5efa7d6d
commit 5f3bdf2d0b
1 changed files with 6 additions and 4 deletions

View File

@ -85,7 +85,9 @@ def pytest_make_collect_report(collector):
def call_optional(obj, name):
method = getattr(obj, name, None)
if method:
method()
return True
else:
return False
argspec = inspect.getargspec(method)
if argspec[0] == ['self']:
argspec = argspec[1:]
if not any(argspec):
method()
return True