[Python-checkins] cpython: Use stock assertEqual instead of custom ndiffAssertEqual.

r.david.murray python-checkins at python.org
Sun Apr 10 21:28:44 CEST 2011


http://hg.python.org/cpython/rev/00bfad341323
changeset:   69235:00bfad341323
user:        R David Murray <rdmurray at bitdance.com>
date:        Sun Apr 10 15:28:29 2011 -0400
summary:
  Use stock assertEqual instead of custom ndiffAssertEqual.

Eventually I'll actually replace the calls in the tests themselves.

files:
  Lib/test/test_email/__init__.py |  10 +---------
  1 files changed, 1 insertions(+), 9 deletions(-)


diff --git a/Lib/test/test_email/__init__.py b/Lib/test/test_email/__init__.py
--- a/Lib/test/test_email/__init__.py
+++ b/Lib/test/test_email/__init__.py
@@ -29,15 +29,7 @@
         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:

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list