987 # Don't worry too much about accessing the non-public _TextTestResult. |
987 # Don't worry too much about accessing the non-public _TextTestResult. |
988 # It is relatively common in Python testing tools. |
988 # It is relatively common in Python testing tools. |
989 def __init__(self, *args, **kwargs): |
989 def __init__(self, *args, **kwargs): |
990 super(TestResult, self).__init__(*args, **kwargs) |
990 super(TestResult, self).__init__(*args, **kwargs) |
991 |
991 |
|
992 # unittest.TestResult didn't have skipped until 2.7. We need to |
|
993 # polyfill it. |
|
994 self.skipped = [] |
|
995 |
|
996 # Polyfill. |
|
997 def addSkip(self, test, reason): |
|
998 self.skipped.append((test, reason)) |
|
999 |
|
1000 if self.showAll: |
|
1001 self.stream.writeln('skipped %s' % reason) |
|
1002 else: |
|
1003 self.stream.write('s') |
|
1004 self.stream.flush() |
|
1005 |
992 class TextTestRunner(unittest.TextTestRunner): |
1006 class TextTestRunner(unittest.TextTestRunner): |
993 """Custom unittest test runner that uses appropriate settings.""" |
1007 """Custom unittest test runner that uses appropriate settings.""" |
994 |
1008 |
995 def _makeResult(self): |
1009 def _makeResult(self): |
996 return TestResult(self.stream, self.descriptions, self.verbosity) |
1010 return TestResult(self.stream, self.descriptions, self.verbosity) |