Issue 8351: Suppress large diffs in unitttest.TestCase.assertSequenceEqual() (original) (raw)

Issue8351

Created on 2010-04-08 23:36 by flub, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
case_seq.diff flub,2010-04-08 23:36
Messages (6)
msg102653 - (view) Author: Floris Bruynooghe (flub) Date: 2010-04-08 23:36
This patch adds the ability to suppress large diffs in the failure message of TestCase.assertSequenceEqual(). The maximum size of the diff is customisable as an new keyword parameter with hopefully a sensible default.
msg107129 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-06-05 11:25
Slightly modified version committed revision 81728. (It truncates large diffs rather than omitting them and allows max_diff to be None - meaning no maximum.) Needs some extended tests and needs documenting.
msg107131 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-06-05 12:11
Modified again in revision 81739. No longer uses a new argument, but a class attribute instead. All assert methods that generate failure messages with difflib truncate messages.
msg107135 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-06-05 13:40
Modified again in revision 81752. Assertion methods now inform you when omitting an excessively long diff.
msg107136 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-06-05 14:00
Still some tests and documentation needed. Leaving issue open until it is done. (Also needs backporting to unittest2...)
msg107137 - (view) Author: Michael Foord (michael.foord) * (Python committer) Date: 2010-06-05 14:06
Note that we also have a bit of a performance issue in prettyprint / difflib when the diffs are very big. It can spend a minute or more constructing the diff - only to throw it away because it is too big...
History
Date User Action Args
2022-04-11 14:56:59 admin set github: 52598
2010-06-05 22:32:31 michael.foord set status: open -> closedresolution: acceptedstage: patch review -> resolved
2010-06-05 14:06:12 michael.foord set messages: +
2010-06-05 14:00:55 michael.foord set messages: +
2010-06-05 13:40:43 michael.foord set messages: +
2010-06-05 12:11:54 michael.foord set messages: +
2010-06-05 11:25:16 michael.foord set messages: +
2010-04-09 04:55:33 ezio.melotti set versions: + Python 3.1, Python 2.7
2010-04-09 04🔞56 ezio.melotti set priority: normalnosy: + ezio.melottistage: patch reviewversions: + Python 3.2, - Python 3.3
2010-04-08 23:57:32 michael.foord set assignee: michael.foordnosy: + michael.foord
2010-04-08 23:36:43 flub create