Compatibility with my spinal cord reflexes: colorize last summary line.

Provide a red bar if there are any 'failures'. Otherwise make it green.
This commit is contained in:
Christian Theune 2013-07-03 19:43:18 +02:00
parent ca88c02507
commit d9f0a28da2
1 changed files with 6 additions and 2 deletions

View File

@ -454,10 +454,14 @@ class TerminalReporter:
if val:
parts.append("%d %s" %(len(val), key))
line = ", ".join(parts)
# XXX coloring
msg = "%s in %.2f seconds" %(line, session_duration)
if self.verbosity >= 0:
self.write_sep("=", msg, bold=True)
markup = dict(bold=True)
if 'failed' in self.stats:
markup['red'] = True
else:
markup['green'] = True
self.write_sep("=", msg, **markup)
#else:
# self.write_line(msg, bold=True)