bpo-39450 Stripped whitespace before parsing the docstring in TestCase.shortDescription (GH-18175)

This commit is contained in:
Steve Cirelli 2020-02-03 02:06:50 -05:00 committed by GitHub
parent 0f2f35e15f
commit 032de7324e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View file

@ -610,6 +610,15 @@ class Test_TestCase(unittest.TestCase, TestEquality, TestHashing):
'Tests shortDescription() for a method with a longer '
'docstring.')
def testShortDescriptionWhitespaceTrimming(self):
"""
Tests shortDescription() whitespace is trimmed, so that the first
line of nonwhite-space text becomes the docstring.
"""
self.assertEqual(
self.shortDescription(),
'Tests shortDescription() whitespace is trimmed, so that the first')
def testAddTypeEqualityFunc(self):
class SadSnake(object):
"""Dummy class for test_addTypeEqualityFunc."""