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 Jul 22, 2020
1 parent fe1ad85 commit 67d84dc
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 67d84dc

Please sign in to comment.