Improve error reporting on tests.
This commit is contained in:
parent
cbeefcf76b
commit
75d690120b
@ -17,13 +17,13 @@ def main():
|
|||||||
test_module.main()
|
test_module.main()
|
||||||
print(" \x1b[1;32m✓\x1b[0m {}".format(test_name))
|
print(" \x1b[1;32m✓\x1b[0m {}".format(test_name))
|
||||||
except AssertionError as ae:
|
except AssertionError as ae:
|
||||||
print(" \x1b[1;31m✗\x1b[0m {}: {}".format(test_name,
|
print(" \x1b[1;31m✗\x1b[0m {}".format(test_name,
|
||||||
ae.args[0] if len(ae.args) > 0
|
(' : [Assertion] {}'.format(ae.args[0])) if len(ae.args) > 0
|
||||||
else '\b\b \b'))
|
else ''))
|
||||||
failed = True
|
failed = True
|
||||||
|
|
||||||
except Exception as e:
|
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
|
failed = True
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user