From cdd5d69d606f0594c941764d6f471602c9be35cd Mon Sep 17 00:00:00 2001 From: Raphael Mitsch Date: Thu, 15 Dec 2022 14:08:56 +0100 Subject: [PATCH] Fix mypy error by not using SpanGroup.__iter__().. --- spacy/tests/pipeline/test_entity_linker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spacy/tests/pipeline/test_entity_linker.py b/spacy/tests/pipeline/test_entity_linker.py index c6ae4d5a9..d61378002 100644 --- a/spacy/tests/pipeline/test_entity_linker.py +++ b/spacy/tests/pipeline/test_entity_linker.py @@ -507,7 +507,10 @@ def test_el_pipe_configuration(nlp): kb: InMemoryLookupKB, mentions: Iterator[SpanGroup] ): for doc_mentions in mentions: - yield [get_lowercased_candidates(kb, mention) for mention in doc_mentions] + yield [ + get_lowercased_candidates(kb, doc_mentions[idx]) + for idx in range(len(doc_mentions)) + ] @registry.misc("spacy.LowercaseCandidateGenerator.v1") def create_candidates() -> Callable[