# HG changeset patch # User Gregory Szorc # Date 2017-06-04 00:04:42 # Node ID 240183a0442918f80688f2357059d7fb2b09f75b # Parent b08431e1b0627e5d0e75de75266223b46d70dd2f 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."""