From acd5bcb0b3e47747b25cb86fe96bb3b5b2e4770e Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Fri, 27 Sep 2019 17:57:59 +0200 Subject: [PATCH] Tidy up fixtures --- spacy/tests/conftest.py | 6 ++++++ spacy/tests/lang/ru/test_lemmatizer.py | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/spacy/tests/conftest.py b/spacy/tests/conftest.py index c88f3314e..0763af32b 100644 --- a/spacy/tests/conftest.py +++ b/spacy/tests/conftest.py @@ -185,6 +185,12 @@ def ru_tokenizer(): return get_lang_class("ru").Defaults.create_tokenizer() +@pytest.fixture +def ru_lemmatizer(): + pytest.importorskip("pymorphy2") + return get_lang_class("ru").Defaults.create_lemmatizer() + + @pytest.fixture(scope="session") def sr_tokenizer(): return get_lang_class("sr").Defaults.create_tokenizer() diff --git a/spacy/tests/lang/ru/test_lemmatizer.py b/spacy/tests/lang/ru/test_lemmatizer.py index b92dfa29c..b228fded8 100644 --- a/spacy/tests/lang/ru/test_lemmatizer.py +++ b/spacy/tests/lang/ru/test_lemmatizer.py @@ -2,17 +2,10 @@ from __future__ import unicode_literals import pytest -from spacy.lang.ru import Russian from ...util import get_doc -@pytest.fixture -def ru_lemmatizer(): - pytest.importorskip("pymorphy2") - return Russian.Defaults.create_lemmatizer() - - def test_ru_doc_lemmatization(ru_tokenizer): words = ["мама", "мыла", "раму"] tags = [