[issue12038] assertEqual doesn't display newline differences quite well

2021-12-09 Thread Irit Katriel
Irit Katriel added the comment: Reproduced on 3.11. -- nosy: +iritkatriel versions: +Python 3.11 -Python 3.3 ___ Python tracker ___ ___

[issue12038] assertEqual doesn't display newline differences quite well

2011-06-26 Thread mouad
mouad added the comment: 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 g

[issue12038] assertEqual doesn't display newline differences quite well

2011-05-16 Thread Michael Foord
Michael Foord added the comment: Yep, ensuring the truncated repr includes at least the *first* difference sounds like the right approach. -- assignee: -> michael.foord ___ Python tracker ___

[issue12038] assertEqual doesn't display newline differences quite well

2011-05-14 Thread Gregory P. Smith
Gregory P. Smith added the comment: We should ensure that the first differing character in the string is always included in what is displayed as a diff. if we're going to shorten a string we should elide something that matches. -- nosy: +gregory.p.smith _

[issue12038] assertEqual doesn't display newline differences quite well

2011-05-13 Thread Terry J. Reedy
Terry J. Reedy added the comment: A possible fix is to condense the output by omitting stuff in the center rather than as the end: "x\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx...x\nx\nx\nx\nx\nx\nx\nx\nx\nx\n" "x\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx\nx...x\nx\nx\nx\nx\nx\nx\nx\nx\nx\r\n" would be clear. -

[issue12038] assertEqual doesn't display newline differences quite well

2011-05-09 Thread Michael Foord
Michael Foord added the comment: Yup, I agree that's pretty sucky. Any suggestions for a fix? -- ___ Python tracker ___ ___ Python-bu

[issue12038] assertEqual doesn't display newline differences quite well

2011-05-09 Thread Antoine Pitrou
New submission from Antoine Pitrou : >>> tc.assertEqual("x\n" * 40 + "\n", "x\n" * 40 + "\r\n") Traceback (most recent call last): File "", line 1, in File "/home/antoine/cpython/default/Lib/unittest/case.py", line 662, in assertEqual assertion_func(first, second, msg=msg) File "/home