##// END OF EJS Templates
run-tests: teach unittest about skipped tests
Gregory Szorc -
r21430:cf299265 default
parent child Browse files
Show More
@@ -989,6 +989,20 b' class TestResult(unittest._TextTestResul'
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
@@ -1289,7 +1303,7 b' class TestRunner(object):'
1289 elif code == '.':
1303 elif code == '.':
1290 pass
1304 pass
1291 elif code == 's':
1305 elif code == 's':
1292 pass
1306 self._result.addSkip(self, msg)
1293 elif code == 'i':
1307 elif code == 'i':
1294 pass
1308 pass
1295 else:
1309 else:
General Comments 0
You need to be logged in to leave comments. Login now