diff --git a/spacy/tests/test_factory_imports.py b/spacy/tests/test_factory_imports.py index 8982dc98d..0889c0ab0 100644 --- a/spacy/tests/test_factory_imports.py +++ b/spacy/tests/test_factory_imports.py @@ -8,45 +8,57 @@ import importlib @pytest.mark.parametrize( "factory_name,original_module,compat_module", [ - ("make_tagger", "spacy.registrations", "spacy.pipeline.tagger"), - ("make_sentencizer", "spacy.registrations", "spacy.pipeline.sentencizer"), - ("make_ner", "spacy.registrations", "spacy.pipeline.ner"), - ("make_parser", "spacy.registrations", "spacy.pipeline.dep_parser"), - ("make_tok2vec", "spacy.registrations", "spacy.pipeline.tok2vec"), - ("make_spancat", "spacy.registrations", "spacy.pipeline.spancat"), - ("make_spancat_singlelabel", "spacy.registrations", "spacy.pipeline.spancat"), - ("make_lemmatizer", "spacy.registrations", "spacy.pipeline.lemmatizer"), - ("make_entity_ruler", "spacy.registrations", "spacy.pipeline.entityruler"), - ("make_span_ruler", "spacy.registrations", "spacy.pipeline.span_ruler"), + ("make_tagger", "spacy.pipeline.factories", "spacy.pipeline.tagger"), + ("make_sentencizer", "spacy.pipeline.factories", "spacy.pipeline.sentencizer"), + ("make_ner", "spacy.pipeline.factories", "spacy.pipeline.ner"), + ("make_parser", "spacy.pipeline.factories", "spacy.pipeline.dep_parser"), + ("make_tok2vec", "spacy.pipeline.factories", "spacy.pipeline.tok2vec"), + ("make_spancat", "spacy.pipeline.factories", "spacy.pipeline.spancat"), + ( + "make_spancat_singlelabel", + "spacy.pipeline.factories", + "spacy.pipeline.spancat", + ), + ("make_lemmatizer", "spacy.pipeline.factories", "spacy.pipeline.lemmatizer"), + ("make_entity_ruler", "spacy.pipeline.factories", "spacy.pipeline.entityruler"), + ("make_span_ruler", "spacy.pipeline.factories", "spacy.pipeline.span_ruler"), ( "make_edit_tree_lemmatizer", - "spacy.registrations", + "spacy.pipeline.factories", "spacy.pipeline.edit_tree_lemmatizer", ), ( "make_attribute_ruler", - "spacy.registrations", + "spacy.pipeline.factories", "spacy.pipeline.attributeruler", ), - ("make_entity_linker", "spacy.registrations", "spacy.pipeline.entity_linker"), - ("make_textcat", "spacy.registrations", "spacy.pipeline.textcat"), - ("make_token_splitter", "spacy.registrations", "spacy.pipeline.functions"), - ("make_doc_cleaner", "spacy.registrations", "spacy.pipeline.functions"), - ("make_morphologizer", "spacy.registrations", "spacy.pipeline.morphologizer"), - ("make_senter", "spacy.registrations", "spacy.pipeline.senter"), - ("make_span_finder", "spacy.registrations", "spacy.pipeline.span_finder"), + ( + "make_entity_linker", + "spacy.pipeline.factories", + "spacy.pipeline.entity_linker", + ), + ("make_textcat", "spacy.pipeline.factories", "spacy.pipeline.textcat"), + ("make_token_splitter", "spacy.pipeline.factories", "spacy.pipeline.functions"), + ("make_doc_cleaner", "spacy.pipeline.factories", "spacy.pipeline.functions"), + ( + "make_morphologizer", + "spacy.pipeline.factories", + "spacy.pipeline.morphologizer", + ), + ("make_senter", "spacy.pipeline.factories", "spacy.pipeline.senter"), + ("make_span_finder", "spacy.pipeline.factories", "spacy.pipeline.span_finder"), ( "make_multilabel_textcat", - "spacy.registrations", + "spacy.pipeline.factories", "spacy.pipeline.textcat_multilabel", ), - ("make_beam_ner", "spacy.registrations", "spacy.pipeline.ner"), - ("make_beam_parser", "spacy.registrations", "spacy.pipeline.dep_parser"), - ("make_nn_labeller", "spacy.registrations", "spacy.pipeline.multitask"), + ("make_beam_ner", "spacy.pipeline.factories", "spacy.pipeline.ner"), + ("make_beam_parser", "spacy.pipeline.factories", "spacy.pipeline.dep_parser"), + ("make_nn_labeller", "spacy.pipeline.factories", "spacy.pipeline.multitask"), # This one's special because the function was named make_span_ruler, so # the name in the registrations.py doesn't match the name we make the import hook # point to. We could make a test just for this but shrug - # ("make_future_entity_ruler", "spacy.registrations", "spacy.pipeline.span_ruler"), + # ("make_future_entity_ruler", "spacy.pipeline.factories", "spacy.pipeline.span_ruler"), ], ) def test_factory_import_compatibility(factory_name, original_module, compat_module): @@ -70,4 +82,3 @@ def test_factory_import_compatibility(factory_name, original_module, compat_modu f"Factory {factory_name} imported from {original_module} is not the same object " f"as the one imported from {compat_module}" ) -