fix <py27 tests with nose
This commit is contained in:
parent
86f70f5201
commit
41df742faf
|
@ -41,8 +41,9 @@ def teardown_nose(item):
|
||||||
|
|
||||||
def pytest_make_collect_report(collector):
|
def pytest_make_collect_report(collector):
|
||||||
if sys.modules.get("unittest"):
|
if sys.modules.get("unittest"):
|
||||||
SkipTest = py.std.unittest.SkipTest
|
SkipTest = getattr(py.std.unittest, "SkipTest", None)
|
||||||
collector.skip_exceptions += (SkipTest,)
|
if SkipTest is not None:
|
||||||
|
collector.skip_exceptions += (SkipTest,)
|
||||||
if isinstance(collector, pytest.Generator):
|
if isinstance(collector, pytest.Generator):
|
||||||
call_optional(collector.obj, 'setup')
|
call_optional(collector.obj, 'setup')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue