[PATCH 1 of 5] tests: use unittest.SkipTest
Gregory Szorc
gregory.szorc at gmail.com
Tue Jun 20 06:12:49 UTC 2017
# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1496534682 25200
# Sat Jun 03 17:04:42 2017 -0700
# Node ID a486c4a371625bd51bb9ba4b1dee7585167427d3
# Parent 661025fd3e1cd5d5e2dee12b7f64312d6cd48a0b
tests: use unittest.SkipTest
unittest.SkipTest was introduced in Python 2.7. We previously defined
it with our own class so we could run on Python 2.6.
diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -711,7 +711,7 @@ class Test(unittest.TestCase):
except KeyboardInterrupt:
self._aborted = True
raise
- except SkipTest as e:
+ except unittest.SkipTest as e:
result.addSkip(self, str(e))
# The base class will have already counted this as a
# test we "ran", but we want to exclude skipped tests
@@ -789,7 +789,7 @@ class Test(unittest.TestCase):
self.fail('hg have failed checking for %s' % failed[-1])
else:
self._skipped = True
- raise SkipTest(missing[-1])
+ raise unittest.SkipTest(missing[-1])
elif ret == 'timeout':
self.fail('timed out')
elif ret is False:
@@ -847,7 +847,7 @@ class Test(unittest.TestCase):
def _run(self, env):
# This should be implemented in child classes to run tests.
- raise SkipTest('unknown test type')
+ raise unittest.SkipTest('unknown test type')
def abort(self):
"""Terminate execution of this test."""
@@ -1486,9 +1486,6 @@ class TTest(Test):
iolock = threading.RLock()
-class SkipTest(Exception):
- """Raised to indicate that a test is to be skipped."""
-
class IgnoreTest(Exception):
"""Raised to indicate that a test is to be ignored."""
More information about the Mercurial-devel
mailing list