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.
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.
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.
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