Skip to content

Commit

Permalink
Shorten output by not displaying full path to file
Browse files Browse the repository at this point in the history
Also put the file name before the test name.  The resulting output will look like

test_760_tomcat.py: test_01_stop_tomcat ... okskip
  • Loading branch information
matyasselmeci committed Dec 14, 2018
1 parent 57ff414 commit 0ce3481
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions osgtest/library/osgunittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,12 @@ def run(self, result=None, **kwargs):
finally:
result.stopTest(self)

def __str__(self):
module = self.__class__.__module__
if '.' in module:
module = module[module.rfind('.')+1:] # strip off all but the last component
return "%s.py: %s" % (module, self._testMethodName)


class OSGTestResult(unittest.TestResult):
"""
Expand Down

0 comments on commit 0ce3481

Please sign in to comment.