Browse Source

Merge #10222: [tests] test_runner - check unicode

a97ed80 [tests] test_runner - check unicode (John Newbery)

Tree-SHA512: f395297b854a967ad81eed9b822a8f33660fa2ffb9b3bd8fb3b287c32caf5792bd53faad836602f45a5e302800e04d2723d5107531f3643fbf1895e35f98d2ba
0.15
MarcoFalke 8 years ago
parent
commit
6ce733747e
No known key found for this signature in database
GPG Key ID: D2EA4850E7528B25
  1. 8
      test/functional/test_runner.py

8
test/functional/test_runner.py

@ -27,9 +27,17 @@ import logging
# Formatting. Default colors to empty strings. # Formatting. Default colors to empty strings.
BOLD, BLUE, RED, GREY = ("", ""), ("", ""), ("", ""), ("", "") BOLD, BLUE, RED, GREY = ("", ""), ("", ""), ("", ""), ("", "")
try:
# Make sure python thinks it can write unicode to its stdout
"\u2713".encode("utf_8").decode(sys.stdout.encoding)
TICK = "" TICK = ""
CROSS = "" CROSS = ""
CIRCLE = "" CIRCLE = ""
except UnicodeDecodeError:
TICK = "P "
CROSS = "x "
CIRCLE = "o "
if os.name == 'posix': if os.name == 'posix':
# primitive formatting on supported # primitive formatting on supported
# terminal via ANSI escape sequences: # terminal via ANSI escape sequences:

Loading…
Cancel
Save