Show More
@@ -604,6 +604,10 b' class Test(object):' | |||
|
604 | 604 | |
|
605 | 605 | return '.', self.name, '' |
|
606 | 606 | |
|
607 | if self._unittest: | |
|
608 | if warned: | |
|
609 | raise WarnTest(msg) | |
|
610 | ||
|
607 | 611 | return warned and '~' or '!', self.name, msg |
|
608 | 612 | |
|
609 | 613 | def skip(self, msg): |
@@ -991,6 +995,9 b' class SkipTest(Exception):' | |||
|
991 | 995 | class IgnoreTest(Exception): |
|
992 | 996 | """Raised to indicate that a test is to be ignored.""" |
|
993 | 997 | |
|
998 | class WarnTest(Exception): | |
|
999 | """Raised to indicate that a test warned.""" | |
|
1000 | ||
|
994 | 1001 | class TestResult(unittest._TextTestResult): |
|
995 | 1002 | """Holds results when executing via unittest.""" |
|
996 | 1003 | # Don't worry too much about accessing the non-public _TextTestResult. |
@@ -1350,6 +1357,8 b' class TestRunner(object):' | |||
|
1350 | 1357 | result.addSkip(self, str(e)) |
|
1351 | 1358 | except IgnoreTest, e: |
|
1352 | 1359 | result.addIgnore(self, str(e)) |
|
1360 | except WarnTest, e: | |
|
1361 | result.addWarn(self, str(e)) | |
|
1353 | 1362 | except self.failureException: |
|
1354 | 1363 | result.addFailure(self, sys.exc_info()) |
|
1355 | 1364 | except Exception: |
@@ -1362,10 +1371,8 b' class TestRunner(object):' | |||
|
1362 | 1371 | |
|
1363 | 1372 | if code == '!': |
|
1364 | 1373 | self._result.failures.append((self, msg)) |
|
1365 | elif code == '~': | |
|
1366 | self._result.addWarn(self, msg) | |
|
1367 | 1374 | # Codes handled in run(). |
|
1368 | elif code in ('.', 's', 'i'): | |
|
1375 | elif code in ('.', 's', 'i', '~'): | |
|
1369 | 1376 | pass |
|
1370 | 1377 | else: |
|
1371 | 1378 | self.fail('Unknown test result code: %s' % code) |
General Comments 0
You need to be logged in to leave comments.
Login now