From c02719f44cc7bdb1183a3ffbda9171cac9fb222e Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 29 Oct 2009 18:08:05 +0100 Subject: [PATCH] rewrite nose-optional-call check, fixes python2.4 compat --HG-- branch : trunk --- _py/test/plugin/pytest_nose.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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