|
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
|
@@ -321,11 +321,11 @@ def main():
|
321 | 321 |
|
322 | 322 | args, unknown_args = parser.parse_known_args()
|
323 | 323 | if not args.ansi:
|
324 |
| - global BOLD, GREEN, RED, GREY |
| 324 | + global DEFAULT, BOLD, GREEN, RED |
| 325 | + DEFAULT = ("", "") |
325 | 326 | BOLD = ("", "")
|
326 | 327 | GREEN = ("", "")
|
327 | 328 | RED = ("", "")
|
328 |
| - GREY = ("", "") |
329 | 329 |
|
330 | 330 | # args to be passed on always start with two dashes; tests are the remaining unknown args
|
331 | 331 | tests = [arg for arg in unknown_args if arg[:2] != "--"]
|
@@ -692,7 +692,7 @@ def __repr__(self):
|
692 | 692 | color = RED
|
693 | 693 | glyph = CROSS
|
694 | 694 | elif self.status == "Skipped":
|
695 |
| - color = GREY |
| 695 | + color = DEFAULT |
696 | 696 | glyph = CIRCLE
|
697 | 697 |
|
698 | 698 | 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