Added a test and fix for nose compatible setup/teardown functions that are partials, and so errors are not ignored
--HG-- branch : trunk
This commit is contained in:
@@ -90,9 +90,8 @@ def pytest_make_collect_report(collector):
|
||||
|
||||
def call_optional(obj, name):
|
||||
method = getattr(obj, name, None)
|
||||
if method:
|
||||
ismethod = inspect.ismethod(method)
|
||||
rawcode = py.code.getrawcode(method)
|
||||
if not rawcode.co_varnames[ismethod:rawcode.co_argcount]:
|
||||
method()
|
||||
return True
|
||||
if method and callable(method):
|
||||
# If there's any problems allow the exception to raise rather than
|
||||
# silently ignoring them
|
||||
method()
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user