The unittest.TestCase.assertEqual() now displays the differences in lists,

tuples, dicts and sets on failure.

Many new handy type and comparison specific assert* methods have been added
that fail with error messages actually useful for debugging.  Contributed in
by Google and completed with help from mfoord and GvR at PyCon 2009 sprints.

Discussion lives in http://bugs.python.org/issue2578.
This commit is contained in:
Gregory P. Smith 2009-03-31 16:54:10 +00:00
parent c2784229b8
commit 2839985c7e
6 changed files with 1081 additions and 92 deletions

View file

@ -227,6 +227,7 @@ class StructTest(unittest.TestCase):
BUGGY_RANGE_CHECK = "bBhHiIlL"
def __init__(self, formatpair, bytesize):
super(IntTester, self).__init__(methodName='test_one')
self.assertEqual(len(formatpair), 2)
self.formatpair = formatpair
for direction in "<>!=":