commit | 032de7324e30c6b44ef272cea3be205a3d768759 | [log] [tgz] |
---|---|---|
author | Steve Cirelli <scirelli+git@gmail.com> | Mon Feb 03 02:06:50 2020 -0500 |
committer | GitHub <noreply@github.com> | Mon Feb 03 07:06:50 2020 +0000 |
tree | ce07fdab45f022c3271ae041e81e0a5be81212bc | |
parent | 0f2f35e15f9fbee44ce042b724348419d8136bc5 [diff] [blame] |
bpo-39450 Stripped whitespace before parsing the docstring in TestCase.shortDescription (GH-18175)
diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index fa64a6e..5e5d535 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py
@@ -512,7 +512,7 @@ the specified test method's docstring. """ doc = self._testMethodDoc - return doc and doc.split("\n")[0].strip() or None + return doc.strip().split("\n")[0].strip() if doc else None def id(self):