mirror of https://github.com/explosion/spaCy.git
* Upd tests after refactor
This commit is contained in:
parent
ba9a22ae0b
commit
e1c702e498
|
@ -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)
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue