|
|
@@ -42,7 +42,21 @@ class TextTestRunner(unittest.TextTestRunner):
|
|
|
timeTaken = stopTime - startTime
|
|
|
result.printErrors()
|
|
|
|
|
|
- self.stream.write('%s: %d test%s in %.3fs ' \
|
|
|
+ if not result.wasSuccessful():
|
|
|
+ if self.color:
|
|
|
+ msg = '\033[0;31mFAIL\033[1;m'
|
|
|
+ else:
|
|
|
+ msg = 'FAIL'
|
|
|
+ self.stream.write(msg)
|
|
|
+ else:
|
|
|
+ if self.color:
|
|
|
+ msg = '\033[0;32mOK\033[0;m'
|
|
|
+ else:
|
|
|
+ msg = 'OK'
|
|
|
+
|
|
|
+ self.stream.write(msg)
|
|
|
+
|
|
|
+ self.stream.write(' %s: %d test%s in %.3fs ' \
|
|
|
% (test.filename, result.testsRun,
|
|
|
result.testsRun != 1 and 's' or '', timeTaken))
|
|
|
|
|
|
@@ -60,15 +74,9 @@ class TextTestRunner(unittest.TextTestRunner):
|
|
|
infos = []
|
|
|
|
|
|
if not result.wasSuccessful():
|
|
|
- if self.color:
|
|
|
- msg = '\033[0;31mFAILED\033[1;m'
|
|
|
- else:
|
|
|
- msg = 'FAILED'
|
|
|
- self.stream.write(msg)
|
|
|
-
|
|
|
failed, errored = map(len, (result.failures, result.errors))
|
|
|
|
|
|
- if failed:
|
|
|
+ if failed:
|
|
|
if self.color:
|
|
|
msg = 'failures=\033[1;31m%d\033[1;m'
|
|
|
else:
|
|
|
@@ -81,13 +89,6 @@ class TextTestRunner(unittest.TextTestRunner):
|
|
|
else:
|
|
|
msg = 'errors=%d'
|
|
|
infos.append(msg % errored)
|
|
|
- else:
|
|
|
- if self.color:
|
|
|
- msg = '\033[0;32mOK\033[0;m'
|
|
|
- else:
|
|
|
- msg = 'OK'
|
|
|
-
|
|
|
- self.stream.write(msg)
|
|
|
|
|
|
if skipped:
|
|
|
if self.color:
|