Improve error reporting on tests.

This commit is contained in:
kenkeiras 2017-05-24 22:06:18 +02:00
parent cbeefcf76b
commit 75d690120b

View File

@ -17,13 +17,13 @@ def main():
test_module.main()
print(" \x1b[1;32m✓\x1b[0m {}".format(test_name))
except AssertionError as ae:
print(" \x1b[1;31m✗\x1b[0m {}: {}".format(test_name,
ae.args[0] if len(ae.args) > 0
else '\b\b \b'))
print(" \x1b[1;31m✗\x1b[0m {}".format(test_name,
(' : [Assertion] {}'.format(ae.args[0])) if len(ae.args) > 0
else ''))
failed = True
except Exception as e:
print(" \x1b[1;7;31m!\x1b[0m {} {}".format(test_name, e))
print(" \x1b[1;7;31m!\x1b[0m {} : [Exception] {}".format(test_name, e))
failed = True
traceback.print_exc()