fix <py27 tests with nose

This commit is contained in:
holger krekel 2013-09-06 12:32:55 +02:00
parent 86f70f5201
commit 41df742faf
1 changed files with 3 additions and 2 deletions

View File

@ -41,8 +41,9 @@ def teardown_nose(item):
def pytest_make_collect_report(collector):
if sys.modules.get("unittest"):
SkipTest = py.std.unittest.SkipTest
collector.skip_exceptions += (SkipTest,)
SkipTest = getattr(py.std.unittest, "SkipTest", None)
if SkipTest is not None:
collector.skip_exceptions += (SkipTest,)
if isinstance(collector, pytest.Generator):
call_optional(collector.obj, 'setup')