Disabled color support for Windows

This commit is contained in:
Julien Kauffmann 2015-05-14 15:30:10 -04:00 committed by Stanislav Kudriashev
parent 3ef747af6a
commit 623436a3cb
1 changed files with 11 additions and 4 deletions

View File

@ -67,7 +67,12 @@ class TimerPlugin(Plugin):
self.timer_top_n = int(options.timer_top_n)
self.timer_ok = self._parse_time(options.timer_ok)
self.timer_warning = self._parse_time(options.timer_warning)
self.timer_no_color = options.timer_no_color
# Windows + nosetests does not support colors (even with colorama).
if os.name == 'nt':
self.timer_no_color = True
else:
self.timer_no_color = options.timer_no_color
def startTest(self, test):
"""Initializes a timer before starting a test."""
@ -167,6 +172,8 @@ class TimerPlugin(Plugin):
_no_color_help = "Don't colorize output (useful for non-tty output)."
parser.add_option("--timer-no-color", action="store_true",
default=False, dest="timer_no_color",
help=_no_color_help)
# Windows + nosetests does not support colors (even with colorama).
if os.name != 'nt':
parser.add_option("--timer-no-color", action="store_true",
default=False, dest="timer_no_color",
help=_no_color_help)