nose-devs/nose — Issue #14: Feature Request: option to print __name__ of test instead of __doc__
Author: jpellerin
Created: 2011-12-14 15:54:58+00:00
State: open

Currently if a test function does not have a docstring it's name is printed
at verbosity=2. However, if the function does have a docstring then that
is printed instead of the name and there is no way to change this behavior.
I propose an option to choose between __name__ and __doc__. (--func-name
perhaps).

I *think* this code from case.py governs the "name" of a test:
{{{
class TestBase(unittest.TestCase):

def shortDescription(self):
if hasattr(self.test, 'description'):
return self.test.description
func, arg = self._descriptors()
doc = getattr(func, '__doc__', None)
if not doc:
doc = str(self)
return doc.strip().split("\n")[0].strip()
}}}

Google Code Info:
Issue #: 214
Author: chris.bu...@gmail.com
Created On: 2008-10-31T15:09:41.000Z
Closed On: