* Upd tests after refactor

This commit is contained in:
Matthew Honnibal 2015-07-14 00:08:50 +02:00
parent ba9a22ae0b
commit e1c702e498
4 changed files with 7 additions and 12 deletions

View File

@ -1,7 +1,9 @@
import pytest
from spacy.en import English
from spacy.en import English, LOCAL_DATA_DIR
import os
@pytest.fixture(scope="session")
def en_nlp():
return English(load_vectors=False)
data_dir = os.environ.get('SPACY_DATA', LOCAL_DATA_DIR)
return English(load_vectors=False, data_dir=data_dir)

View File

@ -22,4 +22,4 @@ def test_root(doc):
assert len(np) == 2
assert np.orth_ == 'a sentence'
assert np.root.orth_ == 'sentence'
assert nlp.root.head.orth_ == 'is'
assert np.root.head.orth_ == 'is'

View File

@ -32,7 +32,6 @@ def test_aint(en_tokenizer):
assert tokens[1].orth_ == "n't"
assert tokens[1].lemma_ == "not"
def test_capitalized(en_tokenizer):
tokens = en_tokenizer("can't")
assert len(tokens) == 2

View File

@ -1,16 +1,10 @@
from __future__ import unicode_literals
import pytest
from spacy.en import English
from spacy.parts_of_speech import ADV
@pytest.fixture
def nlp():
return English()
def test_prob(nlp):
tokens = nlp(u'Give it back')
def test_prob(EN):
tokens = EN(u'Give it back', parse=False)
give = tokens[0]
assert give.prob != 0