From b3dfea22dde07619ed8cbe5b1fe266efeef0c352 Mon Sep 17 00:00:00 2001 From: Noa Aviel Dove Date: Wed, 23 Aug 2023 22:06:50 -0700 Subject: [PATCH] Simplify document counting in unit tests --- test/indexer/test_indexer.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/indexer/test_indexer.py b/test/indexer/test_indexer.py index 2710a0139..d7c6ec7bb 100644 --- a/test/indexer/test_indexer.py +++ b/test/indexer/test_indexer.py @@ -407,11 +407,7 @@ def _walkthrough(v): return old_file_uuid def _num_docs_by_index(self, hits) -> Mapping[tuple[str, bool], int]: - counter = Counter() - for hit in hits: - entity_type, aggregate = self._parse_index_name(hit) - counter[entity_type, aggregate] += 1 - return counter + return Counter(map(self._parse_index_name, hits)) def test_indexed_matrices(self): """