https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertCountEqual It's implemented with `collections.Counter` objects. https://github.com/python/cpython/blob/c96d00e88ead8f99bb6aa1357928ac4545d9287c/Lib/unittest/case.py#L1161