From 0ce34813f7fab9e24328bd5d1b2fd0c31aaf5742 Mon Sep 17 00:00:00 2001 From: Matyas Selmeci Date: Tue, 4 Dec 2018 10:12:20 -0600 Subject: [PATCH] Shorten output by not displaying full path to file Also put the file name before the test name. The resulting output will look like test_760_tomcat.py: test_01_stop_tomcat ... okskip --- osgtest/library/osgunittest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osgtest/library/osgunittest.py b/osgtest/library/osgunittest.py index e97a48c4..368abaa4 100644 --- a/osgtest/library/osgunittest.py +++ b/osgtest/library/osgunittest.py @@ -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): """