##// END OF EJS Templates
run-tests: replace Test.skip() with raise SkipTest...
Gregory Szorc -
r21490:588ebd47 default
parent child Browse files
Show More
@@ -458,12 +458,12 b' class Test(unittest.TestCase):'
458 This will return a tuple describing the result of the test.
458 This will return a tuple describing the result of the test.
459 """
459 """
460 if not os.path.exists(self._path):
460 if not os.path.exists(self._path):
461 return self.skip("Doesn't exist")
461 raise SkipTest("Doesn't exist")
462
462
463 options = self._options
463 options = self._options
464 if not (options.whitelisted and self.name in options.whitelisted):
464 if not (options.whitelisted and self.name in options.whitelisted):
465 if options.blacklist and self.name in options.blacklist:
465 if options.blacklist and self.name in options.blacklist:
466 return self.skip('blacklisted')
466 raise SkipTest('blacklisted')
467
467
468 if options.retest and not os.path.exists('%s.err' % self.name):
468 if options.retest and not os.path.exists('%s.err' % self.name):
469 return self.ignore('not retesting')
469 return self.ignore('not retesting')
@@ -479,7 +479,7 b' class Test(unittest.TestCase):'
479 return self.ignore("doesn't match keyword")
479 return self.ignore("doesn't match keyword")
480
480
481 if not os.path.basename(self.name.lower()).startswith('test-'):
481 if not os.path.basename(self.name.lower()).startswith('test-'):
482 return self.skip('not a test file')
482 raise SkipTest('not a test file')
483
483
484 replacements, port = self._getreplacements()
484 replacements, port = self._getreplacements()
485 env = self._getenv(port)
485 env = self._getenv(port)
@@ -525,7 +525,7 b' class Test(unittest.TestCase):'
525 failed[-1], ret)
525 failed[-1], ret)
526 else:
526 else:
527 self._skipped = True
527 self._skipped = True
528 self._result = self.skip(missing[-1])
528 raise SkipTest(missing[-1])
529 elif ret == 'timeout':
529 elif ret == 'timeout':
530 self._result = self.fail('timed out', ret)
530 self._result = self.fail('timed out', ret)
531 elif out != self._refout:
531 elif out != self._refout:
@@ -584,7 +584,7 b' class Test(unittest.TestCase):'
584
584
585 def _run(self, replacements, env):
585 def _run(self, replacements, env):
586 # This should be implemented in child classes to run tests.
586 # This should be implemented in child classes to run tests.
587 return self._skip('unknown test type')
587 raise SkipTest('unknown test type')
588
588
589 def _getreplacements(self):
589 def _getreplacements(self):
590 port = self._options.port + self._count * 3
590 port = self._options.port + self._count * 3
@@ -687,9 +687,6 b' class Test(unittest.TestCase):'
687 # Failed is denoted by AssertionError (by default at least).
687 # Failed is denoted by AssertionError (by default at least).
688 raise AssertionError(msg)
688 raise AssertionError(msg)
689
689
690 def skip(self, msg):
691 raise SkipTest(msg)
692
693 def ignore(self, msg):
690 def ignore(self, msg):
694 raise IgnoreTest(msg)
691 raise IgnoreTest(msg)
695
692
General Comments 0
You need to be logged in to leave comments. Login now