summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-10-26 23:12:42 +0200
committerGiampaolo Rodola <g.rodola@gmail.com>2017-10-26 23:12:42 +0200
commit8d72368934542e78e7dcf1e31ecab3821677bbb2 (patch)
treee6ebb5a5ed244a36cbf1b3bb8a93551d3468db11
parent5ed29588e0f8d95ffac21cf3128489383691961b (diff)
downloadpsutil-8d72368934542e78e7dcf1e31ecab3821677bbb2.tar.gz
print full mod representation when running test
-rw-r--r--psutil/tests/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py
index 86930100..50063bc9 100644
--- a/psutil/tests/__init__.py
+++ b/psutil/tests/__init__.py
@@ -729,9 +729,11 @@ class TestCase(unittest.TestCase):
# Print a full path representation of the single unit tests
# being run.
def __str__(self):
+ mod = self.__class__.__module__
+ if mod == '__main__':
+ mod = __file__.split('.')[0]
return "%s.%s.%s" % (
- self.__class__.__module__, self.__class__.__name__,
- self._testMethodName)
+ mod, self.__class__.__name__, self._testMethodName)
# assertRaisesRegexp renamed to assertRaisesRegex in 3.3;
# add support for the new name.