diff options
author | jpellerin <devnull@localhost> | 2009-12-02 17:51:50 -0500 |
---|---|---|
committer | jpellerin <devnull@localhost> | 2009-12-02 17:51:50 -0500 |
commit | e2df9e6b038d8e45dd7f9623618d6dfcb38313a5 (patch) | |
tree | e690d700b4eea086c8b5a281d7dcc64e0477a863 /nose/plugins/skip.py | |
parent | 7c8482f9a40face2a343c5840ef0e21ea718c0bd (diff) | |
download | nose-e2df9e6b038d8e45dd7f9623618d6dfcb38313a5.tar.gz |
Improved compatibility with 2.7 builtin skip
Diffstat (limited to 'nose/plugins/skip.py')
-rw-r--r-- | nose/plugins/skip.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/nose/plugins/skip.py b/nose/plugins/skip.py index 3b2ff1c..27e5162 100644 --- a/nose/plugins/skip.py +++ b/nose/plugins/skip.py @@ -9,9 +9,14 @@ is enabled by default but may be disabled with the ``--no-skip`` option. from nose.plugins.errorclass import ErrorClass, ErrorClassPlugin -class SkipTest(Exception): - """Raise this exception to mark a test as skipped. - """ +try: + # 2.7 + from unittest.case import SkipTest +except ImportError: + # 2.6 and below + class SkipTest(Exception): + """Raise this exception to mark a test as skipped. + """ pass |