Message265969
Note: 2.7 doc says that this is renamed assertCountEqual in 3.x. It was added in 2.7 and 3.2. The 3.x doc is essentially the same, but with this instead: "Equivalent to: assertEqual(Counter(list(first)), Counter(list(second))) ...".
If the method misfunctions, then it should be fixed, not have the bug documented. But you need to provide specific evidence and example. The unittest in 3.x has this test with same number, different elements.
self.assertRaises(self.failureException, self.assertCountEqual,
[1, 2] + [3] * 100, [1] * 100 + [2, 3])
I ran following test with same number, different items.
FAIL: test_Count (__main__.Test)
----------------------------------------------------------------------
Traceback (most recent call last):
File "F:\Python\mypy\tem.py", line 4, in test_Count
self.assertItemsEqual([1,2,3], [1,2,4])
AssertionError: Element counts were not equal:
First has 1, Second has 0: 3
First has 0, Second has 1: 4
This also fails in 3.5 with name change. |
|
Date |
User |
Action |
Args |
2016-05-20 22:30:15 | terry.reedy | set | recipients:
+ terry.reedy, michael.foord, docs@python, vitaly |
2016-05-20 22:30:14 | terry.reedy | set | messageid: <1463783414.93.0.0936679975382.issue27060@psf.upfronthosting.co.za> |
2016-05-20 22:30:14 | terry.reedy | link | issue27060 messages |
2016-05-20 22:30:14 | terry.reedy | create | |
|