summaryrefslogtreecommitdiff
path: root/Lib/unittest/test
diff options
context:
space:
mode:
authorSteve Cirelli <scirelli+git@gmail.com>2020-02-03 02:06:50 -0500
committerGitHub <noreply@github.com>2020-02-03 07:06:50 +0000
commit032de7324e30c6b44ef272cea3be205a3d768759 (patch)
treece07fdab45f022c3271ae041e81e0a5be81212bc /Lib/unittest/test
parent0f2f35e15f9fbee44ce042b724348419d8136bc5 (diff)
downloadcpython-git-032de7324e30c6b44ef272cea3be205a3d768759.tar.gz
bpo-39450 Stripped whitespace before parsing the docstring in TestCase.shortDescription (GH-18175)
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r--Lib/unittest/test/test_case.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py
index c2401c39b9..f855c4dc00 100644
--- a/Lib/unittest/test/test_case.py
+++ b/Lib/unittest/test/test_case.py
@@ -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."""