diff --git a/_py/test/plugin/pytest_nose.py b/_py/test/plugin/pytest_nose.py index 0b930c3a5..244f5b61d 100644 --- a/_py/test/plugin/pytest_nose.py +++ b/_py/test/plugin/pytest_nose.py @@ -91,9 +91,8 @@ def pytest_make_collect_report(collector): def call_optional(obj, name): method = getattr(obj, name, None) if method: - argspec = inspect.getargspec(method) - if argspec[0] == ['self']: - argspec = argspec[1:] - if not any(argspec): + ismethod = inspect.ismethod(method) + rawcode = py.code.getrawcode(method) + if not rawcode.co_varnames[ismethod:]: method() return True