Added color to the quite mode summary. Also changed the output format

slightly to match the output of the standard summary.

--HG--
branch : quiet-color-summary
This commit is contained in:
Andreas Pelme 2013-08-05 09:45:10 +02:00
parent 7d86827b5e
commit afa88a479b
1 changed files with 8 additions and 10 deletions

View File

@ -455,19 +455,17 @@ class TerminalReporter:
parts.append("%d %s" % (len(val), key))
line = ", ".join(parts)
msg = "%s in %.2f seconds" % (line, session_duration)
if self.verbosity >= 0:
markup = dict(bold=True)
markup = {'bold': True}
if 'failed' in self.stats or 'error' in self.stats:
markup['red'] = True
markup = {'red': True, 'bold': True}
else:
markup['green'] = True
markup = {'green': True, 'bold': True}
if self.verbosity >= 0:
self.write_sep("=", msg, **markup)
if self.verbosity == -1:
if line:
self.write("%s, " % line)
self.write("time: %.2f seconds\n" % session_duration)
#else:
# self.write_line(msg, bold=True)
self.write_line(msg, **markup)
def summary_deselected(self):
if 'deselected' in self.stats: