Show More
@@ -993,6 +993,11 class TestResult(unittest._TextTestResul | |||||
993 | # polyfill it. |
|
993 | # polyfill it. | |
994 | self.skipped = [] |
|
994 | self.skipped = [] | |
995 |
|
995 | |||
|
996 | # We have a custom "ignored" result that isn't present in any Python | |||
|
997 | # unittest implementation. It is very similar to skipped. It may make | |||
|
998 | # sense to map it into skip some day. | |||
|
999 | self.ignored = [] | |||
|
1000 | ||||
996 | # Polyfill. |
|
1001 | # Polyfill. | |
997 | def addSkip(self, test, reason): |
|
1002 | def addSkip(self, test, reason): | |
998 | self.skipped.append((test, reason)) |
|
1003 | self.skipped.append((test, reason)) | |
@@ -1003,6 +1008,15 class TestResult(unittest._TextTestResul | |||||
1003 | self.stream.write('s') |
|
1008 | self.stream.write('s') | |
1004 | self.stream.flush() |
|
1009 | self.stream.flush() | |
1005 |
|
1010 | |||
|
1011 | def addIgnore(self, test, reason): | |||
|
1012 | self.ignored.append((test, reason)) | |||
|
1013 | ||||
|
1014 | if self.showAll: | |||
|
1015 | self.stream.writeln('ignored %s' % reason) | |||
|
1016 | else: | |||
|
1017 | self.stream.write('i') | |||
|
1018 | self.stream.flush() | |||
|
1019 | ||||
1006 | class TextTestRunner(unittest.TextTestRunner): |
|
1020 | class TextTestRunner(unittest.TextTestRunner): | |
1007 | """Custom unittest test runner that uses appropriate settings.""" |
|
1021 | """Custom unittest test runner that uses appropriate settings.""" | |
1008 |
|
1022 | |||
@@ -1305,7 +1319,7 class TestRunner(object): | |||||
1305 | elif code == 's': |
|
1319 | elif code == 's': | |
1306 | self._result.addSkip(self, msg) |
|
1320 | self._result.addSkip(self, msg) | |
1307 | elif code == 'i': |
|
1321 | elif code == 'i': | |
1308 | pass |
|
1322 | self._result.addIgnore(self, msg) | |
1309 | else: |
|
1323 | else: | |
1310 | self.fail('Unknown test result code: %s' % code) |
|
1324 | self.fail('Unknown test result code: %s' % code) | |
1311 |
|
1325 |
General Comments 0
You need to be logged in to leave comments.
Login now