diff options
| author | Vishvananda Ishaya <vishvananda@gmail.com> | 2013-03-26 12:17:39 -0700 |
|---|---|---|
| committer | Vishvananda Ishaya <vishvananda@gmail.com> | 2013-03-26 17:59:08 -0700 |
| commit | 89c501ec139b8c3e5daccb4e52dc9fec4161dea0 (patch) | |
| tree | 7803f9bea058a87a7544f3c9032be4d1dea9fe27 /tools | |
| parent | 2900258d5e117afd302ecff3411658910078d431 (diff) | |
| download | nova-89c501ec139b8c3e5daccb4e52dc9fec4161dea0.tar.gz nova-89c501ec139b8c3e5daccb4e52dc9fec4161dea0.tar.xz nova-89c501ec139b8c3e5daccb4e52dc9fec4161dea0.zip | |
Bring back colorizer again with error results.
This was actually a pretty simple fix. When I switched the base
test result class to testtools I lost the methods that were
printing out the errors at the end. This adds the (colorized!)
methods so errors print successfully.
fixes bug 1159116
Change-Id: Ib09d7e18ddf27015ff735a30137421d865382359
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/colorizer.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/colorizer.py b/tools/colorizer.py index 2df3c2bf8..1dfe04cd0 100755 --- a/tools/colorizer.py +++ b/tools/colorizer.py @@ -302,6 +302,22 @@ class NovaTestResult(testtools.TestResult): self._writeElapsedTime(elapsed) self.stream.writeln() + def printErrors(self): + if self.showAll: + self.stream.writeln() + self.printErrorList('ERROR', self.errors) + self.printErrorList('FAIL', self.failures) + + def printErrorList(self, flavor, errors): + for test, err in errors: + self.colorizer.write("=" * 70, 'red') + self.stream.writeln() + self.colorizer.write(flavor, 'red') + self.stream.writeln(": %s" % test.id()) + self.colorizer.write("-" * 70, 'red') + self.stream.writeln() + self.stream.writeln("%s" % err) + test = subunit.ProtocolTestCase(sys.stdin, passthrough=None) |
