nose-devs/nose — Issue #294: Possible to modify how nose handles docstrings in tests
Author: jpellerin
Created: 2011-12-14 16:06:43+00:00
State: closed

When including a docstring in a test, nose will display the first line of
the docstring instead of the name of the method being called. This can be
confusing when running a large suite of tests where a test may be included
in multiple modules and can lead to unhelpful failures such as:

======================================================================
FAIL: test how long a long task runs
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/usr/local/lib/python2.4/site-packages/nose-0.9.2-py2.4.egg/nose/tools.py",
line 120, in newfunc
raise TimeExpired("Time limit (%s) exceeded" % limit)
TimeExpired: Time limit (9) exceeded

It would be helpful if nose could be modified so in addition to displaying
the docstring, it also displayed the name of the module/class/test. For
example:

======================================================================
FAIL: test how long a long task runs
(Package.test.test_module.TestClass.test_long_task)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/usr/local/lib/python2.4/site-packages/nose-0.9.2-py2.4.egg/nose/tools.py",
line 120, in newfunc
raise TimeExpired("Time limit (%s) exceeded" % limit)
TimeExpired: Time limit (9) exceeded

would be much more useful while still including the description from the
docstring.

Google Code Info:
Issue #: 41
Author: jcous...@gmail.com
Created On: 2007-03-16T16:50:15.000Z
Closed On: 2007-06-05T01:55:09.000Z