浏览代码

[tests] test_runner - check unicode

tags/v0.15.1
John Newbery 4 年前
父节点
当前提交
a97ed80f97
共有 1 个文件被更改,包括 11 次插入3 次删除
  1. 11
    3
      test/functional/test_runner.py

+ 11
- 3
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:

正在加载...
取消
保存