# HG changeset patch # User Gregory Szorc # Date 1496534682 25200 # 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 -r b08431e1b062 -r 240183a04429 tests/run-tests.py --- a/tests/run-tests.py Thu Jun 15 23:23:47 2017 -0700 +++ b/tests/run-tests.py Sat Jun 03 17:04:42 2017 -0700 @@ -711,7 +711,7 @@ 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 @@ 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 @@ 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 @@ 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."""