Karthikeyan Singaravelan <[email protected]> added the comment:
Thanks for the explanation. This seems to give the desired diff with
charjunk=None passed to multiline string comparison helper. I am not sure how
useful it would be to pass it to sequence and dict comparison that also use
ndiff. I can open a PR if it's okay with the set of strings in the report as a
test case. There are no test case failures in existing unittest folder test
suite so this seems like a safe change to me.
# With patch charjunk=None
./python.exe ../backups/bpo35955_1.py
F
======================================================================
FAIL: test_foo (__main__.FooTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "../backups/bpo35955_1.py", line 6, in test_foo
self.assertEqual("drwxrwxr-x 2 2000 2000\n", "drwxr-xr-x 2 2000 2000\n")
AssertionError: 'drwxrwxr-x 2 2000 2000\n' != 'drwxr-xr-x 2 2000 2000\n'
- drwxrwxr-x 2 2000 2000
? ^
+ drwxr-xr-x 2 2000 2000
? ^
----------------------------------------------------------------------
Ran 1 test in 0.003s
FAILED (failures=1)
# Without patch
➜ cpython git:(master) ✗ python3.7 ../backups/bpo35955_1.py
F
======================================================================
FAIL: test_foo (__main__.FooTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "../backups/bpo35955_1.py", line 6, in test_foo
self.assertEqual("drwxrwxr-x 2 2000 2000\n", "drwxr-xr-x 2 2000 2000\n")
AssertionError: 'drwxrwxr-x 2 2000 2000\n' != 'drwxr-xr-x 2 2000 2000\n'
- drwxrwxr-x 2 2000 2000
? ---
+ drwxr-xr-x 2 2000 2000
? +++
----------------------------------------------------------------------
Ran 1 test in 0.002s
FAILED (failures=1)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35955>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com