rewrite nose-optional-call check, fixes python2.4 compat
--HG-- branch : trunk
This commit is contained in:
parent
7aee121bd7
commit
c02719f44c
|
@ -91,9 +91,8 @@ def pytest_make_collect_report(collector):
|
||||||
def call_optional(obj, name):
|
def call_optional(obj, name):
|
||||||
method = getattr(obj, name, None)
|
method = getattr(obj, name, None)
|
||||||
if method:
|
if method:
|
||||||
argspec = inspect.getargspec(method)
|
ismethod = inspect.ismethod(method)
|
||||||
if argspec[0] == ['self']:
|
rawcode = py.code.getrawcode(method)
|
||||||
argspec = argspec[1:]
|
if not rawcode.co_varnames[ismethod:]:
|
||||||
if not any(argspec):
|
|
||||||
method()
|
method()
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Reference in New Issue