|
28 | 28 | import unittest
|
29 | 29 |
|
30 | 30 | # Formatting. Default colors to empty strings.
|
31 |
| -BOLD, GREEN, RED, GREY = ("", ""), ("", ""), ("", ""), ("", "") |
| 31 | +DEFAULT, BOLD, GREEN, RED = ("", ""), ("", ""), ("", ""), ("", "") |
32 | 32 | try:
|
33 | 33 | # Make sure python thinks it can write unicode to its stdout
|
34 | 34 | "\u2713".encode("utf_8").decode(sys.stdout.encoding)
|
|
59 | 59 | kernel32.SetConsoleMode(stderr, stderr_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
|
60 | 60 | # primitive formatting on supported
|
61 | 61 | # terminal via ANSI escape sequences:
|
| 62 | + DEFAULT = ('\033[0m', '\033[0m') |
62 | 63 | BOLD = ('\033[0m', '\033[1m')
|
63 | 64 | GREEN = ('\033[0m', '\033[0;32m')
|
64 | 65 | RED = ('\033[0m', '\033[0;31m')
|
65 |
| - GREY = ('\033[0m', '\033[1;30m') |
66 | 66 |
|
67 | 67 | TEST_EXIT_PASSED = 0
|
68 | 68 | TEST_EXIT_SKIPPED = 77
|
@@ -372,11 +372,11 @@ def main():
|
372 | 372 |
|
373 | 373 | args, unknown_args = parser.parse_known_args()
|
374 | 374 | if not args.ansi:
|
375 |
| - global BOLD, GREEN, RED, GREY |
| 375 | + global DEFAULT, BOLD, GREEN, RED |
| 376 | + DEFAULT = ("", "") |
376 | 377 | BOLD = ("", "")
|
377 | 378 | GREEN = ("", "")
|
378 | 379 | RED = ("", "")
|
379 |
| - GREY = ("", "") |
380 | 380 |
|
381 | 381 | # args to be passed on always start with two dashes; tests are the remaining unknown args
|
382 | 382 | tests = [arg for arg in unknown_args if arg[:2] != "--"]
|
@@ -720,7 +720,7 @@ def __repr__(self):
|
720 | 720 | color = RED
|
721 | 721 | glyph = CROSS
|
722 | 722 | elif self.status == "Skipped":
|
723 |
| - color = GREY |
| 723 | + color = DEFAULT |
724 | 724 | glyph = CIRCLE
|
725 | 725 |
|
726 | 726 | return color[1] + "%s | %s%s | %s s\n" % (self.name.ljust(self.padding), glyph, self.status.ljust(7), self.time) + color[0]
|
|
0 commit comments