summaryrefslogtreecommitdiff
path: root/coverage/misc.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2017-01-17 10:54:04 -0500
committerNed Batchelder <ned@nedbatchelder.com>2017-01-17 10:54:04 -0500
commit825e8a42586a03021c7e1fc72017c871c7393baf (patch)
treef2d82bbb324393749051838f7248e972785cb80f /coverage/misc.py
parent199f8298be3262da758d9e2c62327d402aafd485 (diff)
downloadpython-coveragepy-825e8a42586a03021c7e1fc72017c871c7393baf.tar.gz
A better way to deal with 2.6 missing SkipTest
Diffstat (limited to 'coverage/misc.py')
-rw-r--r--coverage/misc.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/coverage/misc.py b/coverage/misc.py
index c5f8f20..b3b439c 100644
--- a/coverage/misc.py
+++ b/coverage/misc.py
@@ -284,7 +284,11 @@ class ExceptionDuringRun(CoverageException):
pass
-class StopEverything(unittest.SkipTest if env.TESTING else object):
+# unittest.SkipTest doesn't exist in Python 2.6. We backport it with
+# unittest2 in the coverage.py test suite. But for production, we don't need
+# to derive from SkipTest, so if it doesn't exist, just use object.
+
+class StopEverything(getattr(unittest, 'SkipTest', object)):
"""An exception that means everything should stop.
This derives from SkipTest so that tests that spring this trap will be