spaCy/spacy/tests/conftest.py

29 lines
723 B
Python
Raw Normal View History

import pytest
import os
2016-05-03 10:51:47 +00:00
import spacy
@pytest.fixture(scope="session")
def EN():
2016-05-03 10:51:47 +00:00
return spacy.load("en")
@pytest.fixture(scope="session")
2016-05-03 10:51:47 +00:00
def DE():
return spacy.load("de")
def pytest_addoption(parser):
parser.addoption("--models", action="store_true",
help="include tests that require full models")
parser.addoption("--vectors", action="store_true",
help="include word vectors tests")
parser.addoption("--slow", action="store_true",
help="include slow tests")
def pytest_runtest_setup(item):
for opt in ['models', 'vectors', 'slow']:
if opt in item.keywords and not item.config.getoption("--%s" % opt):
pytest.skip("need --%s option to run" % opt)