summaryrefslogtreecommitdiff
path: root/_pytest/nose.py
diff options
context:
space:
mode:
authorholger krekel <holger@merlinux.eu>2013-09-06 12:48:54 +0200
committerholger krekel <holger@merlinux.eu>2013-09-06 12:48:54 +0200
commit109e2f215f67ec139bd053962a65ed11427314fd (patch)
tree7e7ea715d448075534f7f8632fc7e74786143071 /_pytest/nose.py
parent41df742faf7a080828e3f9e399f01fedab04c701 (diff)
downloadpytest-109e2f215f67ec139bd053962a65ed11427314fd.tar.gz
add nose.SkipTest for python2.6 -- which apparently is a subclass from python2.7 on.
addresses issue236
Diffstat (limited to '_pytest/nose.py')
-rw-r--r--_pytest/nose.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/_pytest/nose.py b/_pytest/nose.py
index aa48d9f4e..8702355e6 100644
--- a/_pytest/nose.py
+++ b/_pytest/nose.py
@@ -5,13 +5,13 @@ import inspect
import sys
from _pytest import unittest
-
def pytest_runtest_makereport(__multicall__, item, call):
SkipTest = getattr(sys.modules.get('nose', None), 'SkipTest', None)
if SkipTest:
if call.excinfo and call.excinfo.errisinstance(SkipTest):
# let's substitute the excinfo with a py.test.skip one
- call2 = call.__class__(lambda: py.test.skip(str(call.excinfo.value)), call.when)
+ call2 = call.__class__(lambda:
+ pytest.skip(str(call.excinfo.value)), call.when)
call.excinfo = call2.excinfo
@@ -40,10 +40,12 @@ def teardown_nose(item):
# del item.parent._nosegensetup
def pytest_make_collect_report(collector):
- if sys.modules.get("unittest"):
- SkipTest = getattr(py.std.unittest, "SkipTest", None)
- if SkipTest is not None:
- collector.skip_exceptions += (SkipTest,)
+ SkipTest = getattr(sys.modules.get('unittest', None), 'SkipTest', None)
+ if SkipTest is not None:
+ collector.skip_exceptions += (SkipTest,)
+ SkipTest = getattr(sys.modules.get('nose', None), 'SkipTest', None)
+ if SkipTest is not None:
+ collector.skip_exceptions += (SkipTest,)
if isinstance(collector, pytest.Generator):
call_optional(collector.obj, 'setup')