[issue14265] Fully qualified test name in failure output

Aviv Palivoda report at bugs.python.org
Mon Apr 11 13:50:03 EDT 2016


Aviv Palivoda added the comment:

Included is a patch with the suggested change.
I changed the TestCase.__str__ method to:
    return "%s (%s.%s)" % (self._testMethodName, strclass(self.__class__), self._testMethodName)
instead of
    return "%s (%s)" % (self._testMethodName, strclass(self.__class__))

So now a failed test look like this:

======================================================================
ERROR: test_error_handling (Lib.test.test_logging.StreamHandlerTest.test_error_handling)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/aviv/dev/cpython/Lib/test/test_logging.py", line 641, in test_error_handling
    self.assertIs(h.error_record, r)
AttributeError: 'TestStreamHandler' object has no attribute 'error_record'

----------------------------------------------------------------------

----------
keywords: +patch
nosy: +palaviv
versions: +Python 3.6 -Python 3.3
Added file: http://bugs.python.org/file42434/14265.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14265>
_______________________________________


More information about the Python-bugs-list mailing list