This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mouad
Recipients ezio.melotti, gregory.p.smith, michael.foord, mouad, pitrou, terry.reedy
Date 2011-06-26.15:25:17
SpamBayes Score 0.0001926116
Marked as misclassified No
Message-id <1309101918.12.0.299581700079.issue12038@psf.upfronthosting.co.za>
In-reply-to
Content
I took on consideration the two suggestion that was in the issue and create this patch that basically show only until the last character that differ and truncate the rest.

I just included one test case, other test case if they should be included (and if my solution got accepted :)), should be more *complex* and check using Regex the correctness of the assertion message, but here is the output that we can see when applying the patch:

>>> tc.assertEqual("x\n" * 40 + "\n", "x\n" * 40 + "\r\n")

'x\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\n...nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\n\n [truncated]... != 'x\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\n...\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\n\r [truncated]...
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
  x
- 
+ 


>>> tc.assertEqual('aaaa', 'abbb')

AssertionError: 'aa [truncated]... != 'ab [truncated]...
- aaaa
+ abbb

>>> tc.assertEqual('aaaa', 'bbbb')

AssertionError: 'a [truncated]... != 'b [truncated]...
- aaaa
+ bbbb

>>> tc.assertEqual("x\n" * 80 + "\n", "x\n" * 80 + "\r")

AssertionError: 'x\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\n...nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\n\n [truncated]... != 'x\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\n...nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\n\r [truncated]...
History
Date User Action Args
2011-06-26 15:25:18mouadsetrecipients: + mouad, terry.reedy, gregory.p.smith, pitrou, ezio.melotti, michael.foord
2011-06-26 15:25:18mouadsetmessageid: <1309101918.12.0.299581700079.issue12038@psf.upfronthosting.co.za>
2011-06-26 15:25:17mouadlinkissue12038 messages
2011-06-26 15:25:17mouadcreate