PyDocs

Nav

Development Tools

TestCase.assertCountEqual

unittest

method of TestCase · Added in 3.2 (source)
  • TestCase.assertCountEqual(first, second, msg=None)
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)))

 Example:
    - [0, 1, 1] and [1, 0, 1] compare equal.
    - [0, 0, 1] and [0, 1] compare unequal.
0 Examples
No examples for unittest/TestCase.assertCountEqual.
See Also
No see-alsos for unittest/TestCase.assertCountEqual
0 Notes
No notes for TestCase.assertCountEqual