From: Edward Loper Date: Thu, 12 Aug 2004 02:43:49 +0000 (+0000) Subject: In output_difference(), replace blank lines in `want` with X-Git-Tag: v2.4a3~283 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68ba9a685d2627efb8ffdb54296e9b9892924cc9;p=python In output_difference(), replace blank lines in `want` with (rather than replacing with blank lines in `got`). This makes it easier to see what's intended. --- diff --git a/Lib/doctest.py b/Lib/doctest.py index 9b91277292..a98df1abff 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -1492,10 +1492,10 @@ class OutputChecker: compare `want` and `got`. `indent` is the indentation of the original example. """ - # If s are being used, then replace - # with blank lines in the expected output string. + # If s are being used, then replace blank lines + # with in the actual output string. if not (optionflags & DONT_ACCEPT_BLANKLINE): - want = re.sub('(?m)^%s$' % re.escape(BLANKLINE_MARKER), '', want) + got = re.sub('(?m)^[ ]*(?=\n)', BLANKLINE_MARKER, got) # Check if we should use diff. Don't use diff if the actual # or expected outputs are too short, or if the expected output