Document that TestCase.assertCountEqual() can take iterables (GH-686)
![](https://secure.gravatar.com/avatar/cc7737cd64a84f1b5c61a160798e97ee.jpg?s=120&d=mm&r=g)
https://github.com/python/cpython/commit/39baace622564867f55cea49483dd1443b8... commit: 39baace622564867f55cea49483dd1443b8655e3 branch: master author: jkleint <jkleint@users.noreply.github.com> committer: Raymond Hettinger <rhettinger@users.noreply.github.com> date: 2019-04-23T01:34:29-07:00 summary: Document that TestCase.assertCountEqual() can take iterables (GH-686) files: M Lib/unittest/case.py diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py index 972a4658b17b..8ff2546fc207 100644 --- a/Lib/unittest/case.py +++ b/Lib/unittest/case.py @@ -1244,9 +1244,8 @@ def assertDictContainsSubset(self, subset, dictionary, msg=None): def assertCountEqual(self, first, second, msg=None): - """An unordered sequence comparison asserting that the same elements, - regardless of order. If the same element occurs more than once, - it verifies that the elements occur the same number of times. + """Asserts that two iterables have the same elements, the same number of + times, without regard to order. self.assertEqual(Counter(list(first)), Counter(list(second)))
participants (1)
-
Raymond Hettinger