This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients chris.jerdonek, jaraco, tim.peters, xtreak
Date 2019-02-11.19:04:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1549911874.17.0.0638665239866.issue35955@roundup.psfhosted.org>
In-reply-to
Content
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)
History
Date User Action Args
2019-02-11 19:04:35xtreaksetrecipients: + xtreak, tim.peters, jaraco, chris.jerdonek
2019-02-11 19:04:34xtreaksetmessageid: <1549911874.17.0.0638665239866.issue35955@roundup.psfhosted.org>
2019-02-11 19:04:34xtreaklinkissue35955 messages
2019-02-11 19:04:34xtreakcreate