[Python-checkins] r81754 - in python/branches/py3k: Lib/unittest/case.py

michael.foord python-checkins at python.org
Sat Jun 5 15:49:56 CEST 2010


Author: michael.foord
Date: Sat Jun  5 15:49:56 2010
New Revision: 81754

Log:
Merged revisions 81752 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81752 | michael.foord | 2010-06-05 14:38:16 +0100 (Sat, 05 Jun 2010) | 1 line
  
  unittest.TestCase assertion methods inform you when they have omitted an over long diff on failure. Issue 8351.
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Lib/unittest/case.py

Modified: python/branches/py3k/Lib/unittest/case.py
==============================================================================
--- python/branches/py3k/Lib/unittest/case.py	(original)
+++ python/branches/py3k/Lib/unittest/case.py	Sat Jun  5 15:49:56 2010
@@ -13,6 +13,10 @@
 
 __unittest = True
 
+
+DIFF_OMITTED = ('\nDiff is %s characters long. '
+                 'Set self.maxDiff to None to see it.')
+
 class SkipTest(Exception):
     """
     Raise this exception in a test to skip it.
@@ -711,7 +715,7 @@
         max_diff = self.maxDiff
         if max_diff is None or len(diff) <= max_diff:
             return message + diff
-        return message
+        return message + (DIFF_OMITTED % len(diff))
 
     def assertListEqual(self, list1, list2, msg=None):
         """A list-specific equality assertion.


More information about the Python-checkins mailing list