Fix tests

This commit is contained in:
Matthew Honnibal 2017-03-16 18:53:47 -05:00
parent adb0b7e43b
commit db51abf685
2 changed files with 2 additions and 14 deletions

View File

@ -16,7 +16,6 @@ from ..tokens import Doc
from ..strings import StringStore
from ..lemmatizer import Lemmatizer
from ..attrs import ORTH, TAG, HEAD, DEP
from ..util import match_best_version, get_data_path
from io import StringIO, BytesIO
from pathlib import Path
@ -91,10 +90,7 @@ def en_entityrecognizer():
@pytest.fixture
def lemmatizer(path):
if path is not None:
return Lemmatizer.load(path)
else:
return None
return English.Defaults.ceate_lemmatizer()
@pytest.fixture
@ -106,14 +102,6 @@ def text_file_b():
return BytesIO()
@pytest.fixture
def path():
if 'SPACY_DATA' in os.environ:
return Path(os.environ['SPACY_DATA'])
else:
return match_best_version('en', None, get_data_path())
# only used for tests that require loading the models
# in all other cases, use specific instances
@pytest.fixture(scope="session")

View File

@ -6,5 +6,5 @@ import pytest
# Note: "chromosomes" worked previous the bug fix
@pytest.mark.parametrize('word,lemmas', [("chromosomes", ["chromosome"]), ("endosomes", ["endosome"]), ("colocalizes", ["colocalize", "colocaliz"])])
def test_issue781(path, lemmatizer, word, lemmas):
def test_issue781(lemmatizer, word, lemmas):
assert lemmatizer(word, 'noun', morphology={'number': 'plur'}) == set(lemmas)