sknano.testing.GeneratorTestFixtures.assertCountEqual

GeneratorTestFixtures.assertCountEqual(first, second, msg=None)[source]

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.

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.