##// END OF EJS Templates
run-tests: record ignored tests by raising IgnoreTest
Gregory Szorc -
r21443:a6845a04 default
parent child Browse files
Show More
@@ -616,6 +616,9 b' class Test(object):'
616 616 return 's', self.name, msg
617 617
618 618 def ignore(self, msg):
619 if self._unittest:
620 raise IgnoreTest(msg)
621
619 622 return 'i', self.name, msg
620 623
621 624 class PythonTest(Test):
@@ -985,6 +988,9 b' iolock = threading.Lock()'
985 988 class SkipTest(Exception):
986 989 """Raised to indicate that a test is to be skipped."""
987 990
991 class IgnoreTest(Exception):
992 """Raised to indicate that a test is to be ignored."""
993
988 994 class TestResult(unittest._TextTestResult):
989 995 """Holds results when executing via unittest."""
990 996 # Don't worry too much about accessing the non-public _TextTestResult.
@@ -1342,6 +1348,8 b' class TestRunner(object):'
1342 1348 raise
1343 1349 except SkipTest, e:
1344 1350 result.addSkip(self, str(e))
1351 except IgnoreTest, e:
1352 result.addIgnore(self, str(e))
1345 1353 except self.failureException:
1346 1354 result.addFailure(self, sys.exc_info())
1347 1355 except Exception:
@@ -1356,10 +1364,8 b' class TestRunner(object):'
1356 1364 self._result.failures.append((self, msg))
1357 1365 elif code == '~':
1358 1366 self._result.addWarn(self, msg)
1359 elif code == 'i':
1360 self._result.addIgnore(self, msg)
1361 1367 # Codes handled in run().
1362 elif code in ('.', 's'):
1368 elif code in ('.', 's', 'i'):
1363 1369 pass
1364 1370 else:
1365 1371 self.fail('Unknown test result code: %s' % code)
General Comments 0
You need to be logged in to leave comments. Login now