]> granicus.if.org Git - python/commit
Improve diff for assertCountEqual() to actually show the differing counts.
authorRaymond Hettinger <python@rcn.com>
Fri, 24 Dec 2010 10:02:22 +0000 (10:02 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 24 Dec 2010 10:02:22 +0000 (10:02 +0000)
commit93e233d6e5ef84b9e6d70917cdfe8ef1f9499cb5
tree3c3859c8f70746ef6145613ae20b695f57f48e09
parentfca8beed4afaaae53549f4ca3fd43a1cfabc85d1
Improve diff for assertCountEqual() to actually show the differing counts.

New output looks like this:

Traceback (most recent call last):
  File "test.py", line 5, in test_ce
    self.assertCountEqual('abracadabra xx', 'simsalabim xx')
AssertionError: Element counts were not equal:
Expected 5, got 2:  'a'
Expected 2, got 1:  'b'
Expected 0, got 2:  'i'
Expected 0, got 2:  'm'
Expected 0, got 1:  'l'
Expected 0, got 2:  's'
Expected 1, got 0:  'c'
Expected 1, got 0:  'd'
Expected 2, got 0:  'r'
Lib/unittest/case.py
Lib/unittest/test/test_assertions.py
Lib/unittest/util.py