Improve failure reporting for gabbi-run

this isn't perfect yet, but should be an improvement

ideally we'd use `textwrap.indent`, but that doesn't seem to be
available for Python 2
This commit is contained in:
FND 2015-10-19 12:25:18 +02:00
parent 51b1f4bd03
commit 0268894166

View File

@ -95,8 +95,9 @@ class ConciseTestResult(TextTestResult):
# err[1] is the args of the exception
# err[3] is the traceback, not currently used
self.stream.writeln('%s: %s' % (flavor, self.getDescription(test)))
message = str(err[1]).replace('\n', '\\r')
self.stream.writeln('\t%s' % message)
message = str(err[1])
for line in message.splitlines():
self.stream.writeln('\t%s' % line)
class ConciseTestRunner(TextTestRunner):