Ensure words are added to vocab before test, so that the lexicon is updated correctly.

This commit is contained in:
Matthew Honnibal 2016-10-15 14:12:18 +02:00
parent 75529a9f3b
commit 788657f062
1 changed files with 3 additions and 1 deletions

View File

@ -10,9 +10,11 @@ def nlp():
data_dir = os.environ.get('SPACY_DATA')
else:
data_dir = None
return English(data_dir=data_dir)
return English(path=data_dir)
@pytest.fixture()
def doc(nlp):
for word in ['Hello', ',', 'world', '.', 'Here', 'are', 'two', 'sentences', '.']:
_ = nlp.vocab[word]
return nlp('Hello, world. Here are two sentences.')