From 5f3bdf2d0b5b1b5a1473b62ad14fb831ed03a245 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Fri, 23 Oct 2009 16:16:28 +0200 Subject: [PATCH] nose plugin wont call setup functions that arent made for it --HG-- branch : trunk --- _py/test/plugin/pytest_nose.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/_py/test/plugin/pytest_nose.py b/_py/test/plugin/pytest_nose.py index f7bfbfda0..61c7ef1fd 100644 --- a/_py/test/plugin/pytest_nose.py +++ b/_py/test/plugin/pytest_nose.py @@ -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