mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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'
This commit is contained in:
parent
fca8beed4a
commit
93e233d6e5
3 changed files with 71 additions and 21 deletions
|
@ -229,12 +229,6 @@ class TestLongMessage(unittest.TestCase):
|
|||
"^Missing: 'key'$",
|
||||
"^Missing: 'key' : oops$"])
|
||||
|
||||
def testassertCountEqual(self):
|
||||
self.assertMessages('assertCountEqual', ([], [None]),
|
||||
[r"\[None\]$", "^oops$",
|
||||
r"\[None\]$",
|
||||
r"\[None\] : oops$"])
|
||||
|
||||
def testAssertMultiLineEqual(self):
|
||||
self.assertMessages('assertMultiLineEqual', ("", "foo"),
|
||||
[r"\+ foo$", "^oops$",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue