spaCy/spacy/tests/website/conftest.py
2016-01-16 12:23:45 +01:00

19 lines
390 B
Python

from __future__ import unicode_literals
import pytest
import os
@pytest.fixture(scope='session')
def nlp():
from spacy.en import English
if os.environ.get('SPACY_DATA'):
data_dir = os.environ.get('SPACY_DATA')
else:
data_dir = None
return English(data_dir=data_dir)
@pytest.fixture()
def doc(nlp):
return nlp('Hello, world. Here are two sentences.')