You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: [email protected]
Created On: 2008-10-31T15:09:41.000Z
Closed On:
The text was updated successfully, but these errors were encountered:
Yes please! nosetests prints either the name of the test function or the first
sentence of the docstring. This means that, when running nosetests with -v, the
output looks very inconsistent if some test cases has docstrings.
Google Code Info:
Author: [email protected]
Created On: 2009-12-04T15:28:06.000Z
This is much more complicated than I originally thought since this is how the
underlying unittest.py library does it.
For reference in 2.6 one can replace the implementation of
_TextTestResult.getDescription with an unconditional return str(test). But that of
course eliminates all choice and is not a suitable upstream change.
Google Code Info:
Author: [email protected]
Created On: 2010-01-25T20:22:36.000Z
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: [email protected]
Created On: 2008-10-31T15:09:41.000Z
Closed On:
The text was updated successfully, but these errors were encountered: