[New-bugs-announce] [issue39450] unittest TestCase shortDescription does not strip whitespace

Steve C report at bugs.python.org
Fri Jan 24 20:03:33 EST 2020


New submission from Steve C <scirelli at gmail.com>:

When running unit tests with the --verbose flag test descriptions are run using the first line of the test case's docstring. If the first character of the docstring is a newline, no description is printed.
Examples:
Current code expects docstrings to look like
'''It should return blah blah
This is a test...
'''
Where the description starts on the first line.

Some Python developers start the string on the next line. Example:
'''
It should return blah blah
This is a test...
'''

Lib.unittest.case.TestCase:shortDescription should first strip the docstrip of beginning and trailing whitespace.

----------
components: Library (Lib)
messages: 360666
nosy: Steve C2
priority: normal
severity: normal
status: open
title: unittest TestCase shortDescription does not strip whitespace
type: enhancement
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39450>
_______________________________________


More information about the New-bugs-announce mailing list