mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Use stock assertEqual instead of custom ndiffAssertEqual.
Eventually I'll actually replace the calls in the tests themselves.
This commit is contained in:
parent
88fdeb45ef
commit
eb9e074dca
1 changed files with 1 additions and 9 deletions
|
|
@ -29,15 +29,7 @@ class TestEmailBase(unittest.TestCase):
|
|||
super().__init__(*args, **kw)
|
||||
self.addTypeEqualityFunc(bytes, self.assertBytesEqual)
|
||||
|
||||
def ndiffAssertEqual(self, first, second):
|
||||
"""Like assertEqual except use ndiff for readable output."""
|
||||
if first != second:
|
||||
sfirst = str(first)
|
||||
ssecond = str(second)
|
||||
rfirst = [repr(line) for line in sfirst.splitlines()]
|
||||
rsecond = [repr(line) for line in ssecond.splitlines()]
|
||||
diff = difflib.ndiff(rfirst, rsecond)
|
||||
raise self.failureException(NL + NL.join(diff))
|
||||
ndiffAssertEqual = unittest.TestCase.assertEqual
|
||||
|
||||
def _msgobj(self, filename):
|
||||
with openfile(filename) as fp:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue