classification
Title: Improved doctest REPORT_*DIFFs with ELLIPSIS and/or NORMALIZE_WHITESPACE
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: labrat
Priority: normal Keywords: patch

Created on 2010-08-19 11:04 by labrat, last changed 2010-08-19 11:06 by labrat.

Files
File name Uploaded Description Edit
doctest_diff.patch labrat, 2010-08-19 11:05 patch
Messages (2)
msg114340 - (view) Author: W. Trevor King (labrat) Date: 2010-08-19 11:04
I had been struggling to find the failure-causing mismatch in a doctest with lots of output.  REPORT_UDIFF gave lots of false mismatches because I was also using NORMALIZE_WHITESPACE.  Looking through the doctest.py source, I saw a comment suggesting a nicer diff in the similar REPORT_*DIFF and ELLIPSIS situation.  So I went ahead and implemented one.  I'm not super happy with the cleanliness of the implementation, but it ended up being a bit trickier than I'd initially expected.
msg114341 - (view) Author: W. Trevor King (labrat) Date: 2010-08-19 11:05
Here's my patch, or pull from my Mercurial repository
  http://www.physics.drexel.edu/~wking/code/hg/hgwebdir.cgi/python/rev/6638df20c1a4
History
Date User Action Args
2010-08-19 11:06:03labratsetfiles: + doctest_diff.patch
keywords: + patch
messages: + msg114341
2010-08-19 11:04:09labratcreate