This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author benf_wspdigital
Recipients benf_wspdigital
Date 2017-04-27.02:44:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493261074.73.0.807341942876.issue30181@psf.upfronthosting.co.za>
In-reply-to
Content
The docstring of a test case is not correctly parsed for display.

The attached ‘test_foo.py’ module contains two test case functions. Both docstrings conform to PEP 257 <https://www.python.org/dev/peps/pep-0257/>: they have a single-line synopsis and some extra text in a new paragraph.

However, only one of the functions has its docstring synopsis used in the output:

=====
======================================================================
FAIL: test_lower_returns_expected_code (test_foo.Foo_TestCase)
Should return expected code.
----------------------------------------------------------------------
Traceback (most recent call last):
[…]

======================================================================
FAIL: test_reverse_returns_expected_text (test_foo.Foo_TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
[…]

----------------------------------------------------------------------
Ran 2 tests in 0.001s
=====

This violates the docstring parsing as described in PEP 257. The synopsis should be obtained by, first, stripping leading and trailing whitespace from the docstring; then, from that stripped text, taking the first line as the synopsis.

So the expected output for ‘test_foo.Foo_TestCase. test_reverse_returns_expected_text’ should include its docstring synopsis, “Should return expected reverse text.”
History
Date User Action Args
2017-04-27 02:44:34benf_wspdigitalsetrecipients: + benf_wspdigital
2017-04-27 02:44:34benf_wspdigitalsetmessageid: <1493261074.73.0.807341942876.issue30181@psf.upfronthosting.co.za>
2017-04-27 02:44:34benf_wspdigitallinkissue30181 messages
2017-04-27 02:44:33benf_wspdigitalcreate