mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-27 10:26:35 +03:00
Use local path in test_lemmatizer
This commit is contained in:
parent
1318d0bc65
commit
20c948361b
|
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
||||||
import os
|
import os
|
||||||
import io
|
import io
|
||||||
import pickle
|
import pickle
|
||||||
|
import pathlib
|
||||||
|
|
||||||
from spacy.lemmatizer import Lemmatizer, read_index, read_exc
|
from spacy.lemmatizer import Lemmatizer, read_index, read_exc
|
||||||
from spacy import util
|
from spacy import util
|
||||||
|
@ -12,12 +13,15 @@ import pytest
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def path():
|
def path():
|
||||||
return util.match_best_version('en', None,
|
if 'SPACY_DATA' in os.environ:
|
||||||
os.environ.get('SPACY_DATA', util.get_data_path()))
|
return pathlib.Path(os.environ['SPACY_DATA'])
|
||||||
|
else:
|
||||||
|
return util.match_best_version('en', None, util.get_data_path())
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def lemmatizer(path):
|
def lemmatizer(path):
|
||||||
|
print('Path', repr(path))
|
||||||
return Lemmatizer.load(path)
|
return Lemmatizer.load(path)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user