[Python-checkins] python/dist/src/Lib doctest.py,1.36.2.8,1.36.2.9
tim_one at users.sourceforge.net
tim_one at users.sourceforge.net
Tue Aug 3 21:52:51 CEST 2004
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30340/Lib
Modified Files:
Tag: tim-doctest-branch
doctest.py
Log Message:
output_difference: This was identifying both context and unified diffs
as unified diffs in the output.
Index: doctest.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/doctest.py,v
retrieving revision 1.36.2.8
retrieving revision 1.36.2.9
diff -C2 -d -r1.36.2.8 -r1.36.2.9
*** doctest.py 3 Aug 2004 19:35:13 -0000 1.36.2.8
--- doctest.py 3 Aug 2004 19:52:48 -0000 1.36.2.9
***************
*** 1054,1065 ****
diff = difflib.unified_diff(want_lines, got_lines, n=2,
fromfile='Expected', tofile='Got')
elif self._optionflags & CONTEXT_DIFF:
diff = difflib.context_diff(want_lines, got_lines, n=2,
fromfile='Expected', tofile='Got')
else:
assert 0, 'Bad diff option'
# Remove trailing whitespace on diff output.
diff = [line.rstrip() + '\n' for line in diff]
! return _tag_msg("Differences (unified diff)", ''.join(diff))
# If we're not using diff, then simply list the expected
--- 1054,1068 ----
diff = difflib.unified_diff(want_lines, got_lines, n=2,
fromfile='Expected', tofile='Got')
+ kind = 'unified'
elif self._optionflags & CONTEXT_DIFF:
diff = difflib.context_diff(want_lines, got_lines, n=2,
fromfile='Expected', tofile='Got')
+ kind = 'context'
else:
assert 0, 'Bad diff option'
# Remove trailing whitespace on diff output.
diff = [line.rstrip() + '\n' for line in diff]
! return _tag_msg("Differences (" + kind + " diff)",
! ''.join(diff))
# If we're not using diff, then simply list the expected
More information about the Python-checkins
mailing list