Bug 1247833 - Display the class name in mozunit output. r=gps

One can run individual tests with python testfile.py Class.method. But
the output for tests only shows the method so looking at a test output
is not enough to tell how to run one particular test. Moreover, there
are many cases where a test file contains multiple classes, and we fail
to identify the difference between those classes.
This commit is contained in:
Mike Hommey 2016-02-12 12:29:51 +09:00
parent 0b338e799d
commit 821bd60307

View File

@ -33,9 +33,10 @@ class _MozTestResult(_TestResult):
return str(test)
def printStatus(self, status, test, message=''):
line = "{status} | {file} | {test}{sep}{message}".format(
line = "{status} | {file} | {klass}.{test}{sep}{message}".format(
status=status,
file=inspect.getfile(test.__class__),
klass=test.__class__.__name__,
test=test._testMethodName,
sep=', ' if message else '',
message=message,