Skip to content

Commit e7a82e8

Browse files
author
Justin Baum
committed
Add edge case as issue laid out
1 parent 88fb0e4 commit e7a82e8

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/doctest.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,16 +1612,20 @@ def check_output(self, want, got, optionflags):
16121612

16131613
# Ignore case if flag
16141614
# Lowercase got and want
1615+
true_line = "True\n"
1616+
false_line = "False\n"
16151617
if (optionflags & IGNORE_CASE):
16161618
got = got.lower()
16171619
want = want.lower()
1620+
true_line = "true\n"
1621+
false_line = "false\n"
16181622

16191623
# The values True and False replaced 1 and 0 as the return
16201624
# value for boolean comparisons in Python 2.3.
16211625
if not (optionflags & DONT_ACCEPT_TRUE_FOR_1):
1622-
if (got,want) == ("True\n", "1\n"):
1626+
if (got, want) == (true_line, "1\n"):
16231627
return True
1624-
if (got,want) == ("False\n", "0\n"):
1628+
if (got, want) == (false_line, "0\n"):
16251629
return True
16261630

16271631
# <BLANKLINE> can be used as a special sequence to signify a

0 commit comments

Comments
 (0)