Skip to content

Commit e01e8fb

Browse files
committed
Fix the color output for Windows.
1 parent fbfb7a3 commit e01e8fb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pyzen/runner.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def addFailure(self, test, err):
3030
def printErrorList(self, flavour, errors):
3131
for test, err in errors:
3232
self.stream.writeln(self.separator1)
33-
self.stream.writeln("%s%s: %s%s" % (COLOR_FAIL,flavour,self.getDescription(test),COLOR_RESET))
33+
self.stream.write(COLOR_FAIL)
34+
self.stream.writeln("%s: %s" % (flavour,self.getDescription(test)))
35+
self.stream.write(COLOR_RESET)
3436
self.stream.writeln(self.separator2)
3537
self.stream.writeln("%s" % err)
3638

@@ -67,9 +69,11 @@ def run(self, test):
6769
if errored:
6870
if failed: self.stream.write(", ")
6971
self.stream.write("errors=%d" % errored)
70-
self.stream.writeln(")"+COLOR_RESET)
72+
self.stream.writeln(")")
7173
else:
72-
self.stream.writeln(COLOR_SUCCESS+"OK"+COLOR_RESET)
74+
self.stream.write(COLOR_SUCCESS)
75+
self.stream.writeln("OK")
76+
self.stream.write(COLOR_RESET)
7377
return result
7478

7579
def get_test_runner(nocolor):

0 commit comments

Comments
 (0)