+4
−5
Loading
Sebastian spotted that we swallow exceptions when loadTestsFromName() fails,
often due to syntax errors and the like. Revising his improvements around
this...
* We added a traceback import but didn't actually use it.
* PEP8 nitpick about import order. Imports are grouped by type (standard libs
then stem imports), and within that alphabetical.
* This added extra output for when the user gives '--test' for something that
doesn't exist. We probably already have good enough output around this.
* Calling exceptions 'exc' rather than 'e'. Nitpick of mine, but single letter
variables are ungrepable so I only use them for a few specific things like
list comprehension.
* Inverted order in which we print so we still show 'failed' in the column,
then are followed by the stacktrace.
Errors previously looked like...
version... invalid syntax (version.py, line 30)
failed
... and now look like...
version... failed
Traceback (most recent call last):
File "./run_tests.py", line 342, in _run_test
suite = unittest.TestLoader().loadTestsFromName(test_class)
File "/usr/lib/python2.7/unittest/loader.py", line 91, in loadTestsFromName
module = __import__('.'.join(parts_copy))
File "/home/atagar/Desktop/stem/test/unit/version.py", line 30
blargy blarg, some invalid python stuff... I hope
^
SyntaxError: invalid syntax