Author ezio.melotti
Recipients Jacek.Bzdak, ezio.melotti, michael.foord, serhiy.storchaka, vstinner
Date 2013-10-14.01:30:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1381714231.96.0.986094229882.issue19217@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a proof of concept to fix the issue (still lacks tests and breaks one existing test).

The problem is that assertSequenceEqual computes the diff regardless of the size of the sequences, and then truncates it if it's too long.  Producing the diff takes time, so checking the size of the sequences and skip the diff if they are too long solves the problem.

In the patch I used an hardcoded and arbitrary value of 30 elements -- the other attributes like maxDiff and _diffThreshold can't be used here.
The value is so low because if the sequence doesn't fit in one line, the output will list one element per line, resulting in 30+ lines of output which is not very readable IMHO.  Also note that regardless of the this diff, the error message indicates what is the position of the first element that differs.
The threshold value I picked could be moved to a _seqDiffThreshold (and possibly _diffThreshold can be renamed to _strDiffThreshold).

This issue is related to #11763.  All other methods should be checked for similar issues.
History
Date User Action Args
2013-10-14 01:30:32ezio.melottisetrecipients: + ezio.melotti, vstinner, michael.foord, serhiy.storchaka, Jacek.Bzdak
2013-10-14 01:30:31ezio.melottisetmessageid: <1381714231.96.0.986094229882.issue19217@psf.upfronthosting.co.za>
2013-10-14 01:30:31ezio.melottilinkissue19217 messages
2013-10-14 01:30:31ezio.melotticreate