aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-04-17 13:46:20 -0400
committerJohn Newbery <john@johnnewbery.com>2017-04-17 14:16:43 -0400
commita97ed80f97a7572f084f1381837f96d6f0cbb569 (patch)
treeabefaaa4aa2dd20c2f62bd7befdd889406aeb959 /test
parent2584925077f9658b3953ad931b74779006e59807 (diff)
downloadbitcoin-a97ed80f97a7572f084f1381837f96d6f0cbb569.tar.xz
[tests] test_runner - check unicode
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/test_runner.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
index bb12328ec1..a5a44ea77d 100755
--- a/test/functional/test_runner.py
+++ b/test/functional/test_runner.py
@@ -27,9 +27,17 @@ import logging
# Formatting. Default colors to empty strings.
BOLD, BLUE, RED, GREY = ("", ""), ("", ""), ("", ""), ("", "")
-TICK = "✓ "
-CROSS = "✖ "
-CIRCLE = "○ "
+try:
+ # Make sure python thinks it can write unicode to its stdout
+ "\u2713".encode("utf_8").decode(sys.stdout.encoding)
+ TICK = "✓ "
+ CROSS = "✖ "
+ CIRCLE = "○ "
+except UnicodeDecodeError:
+ TICK = "P "
+ CROSS = "x "
+ CIRCLE = "o "
+
if os.name == 'posix':
# primitive formatting on supported
# terminal via ANSI escape sequences: