Skip to content

Commit 19c440d

Browse files
committed
extend testing
1 parent 266997c commit 19c440d

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Lib/doctest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1758,7 +1758,7 @@ def check_output(self, want, got, optionflags):
17581758
# the NORMALIZE_WHITESPACE and ELLIPSIS flags.
17591759
if optionflags & IGNORE_LINEBREAK:
17601760
# `want` originally ends with '\n' so we add it back
1761-
want = ''.join(want.split('\n')) + '\n'
1761+
want = ''.join(want.splitlines()) + '\n'
17621762
if got == want:
17631763
return True
17641764

Lib/test/test_doctest/test_doctest.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,6 +1445,22 @@ def optionflags(): r"""
14451445
abcdefghijklmnopqrstuvwxyz
14461446
ABCDEFGHIJKLMNOPQRSTUVWXYZ
14471447
1448+
... mixing flags:
1449+
1450+
>>> import string
1451+
>>> print(string.ascii_letters) # doctest: +ELLIPSIS, +IGNORE_LINEBREAK
1452+
abc...xyz
1453+
ABC...
1454+
1455+
... mixing flags:
1456+
1457+
>>> import string
1458+
>>> print(list(string.ascii_letters)) # doctest: +IGNORE_LINEBREAK
1459+
... # doctest: +ELLIPSIS
1460+
... # doctest: +NORMALIZE_WHITESPACE
1461+
['a', ..., 'z',
1462+
'A', ..., 'Z']
1463+
14481464
The ELLIPSIS flag causes ellipsis marker ("...") in the expected
14491465
output to match any substring in the actual output:
14501466

0 commit comments

Comments
 (0)