mirror of https://github.com/explosion/spaCy.git
Remove outdated options and fix formatting
This commit is contained in:
parent
73255091f8
commit
8d3bfb3c04
|
@ -9,12 +9,6 @@ def pytest_addoption(parser):
|
||||||
parser.addoption("--slow", action="store_true", help="include slow tests")
|
parser.addoption("--slow", action="store_true", help="include slow tests")
|
||||||
|
|
||||||
|
|
||||||
def pytest_runtest_setup(item):
|
|
||||||
for opt in ["slow"]:
|
|
||||||
if opt in item.keywords and not item.config.getoption("--%s" % opt):
|
|
||||||
pytest.skip("need --%s option to run" % opt)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def tokenizer():
|
def tokenizer():
|
||||||
return get_lang_class("xx").Defaults.create_tokenizer()
|
return get_lang_class("xx").Defaults.create_tokenizer()
|
||||||
|
@ -143,6 +137,7 @@ def ru_tokenizer():
|
||||||
pymorphy = pytest.importorskip("pymorphy2")
|
pymorphy = pytest.importorskip("pymorphy2")
|
||||||
return get_lang_class("ru").Defaults.create_tokenizer()
|
return get_lang_class("ru").Defaults.create_tokenizer()
|
||||||
|
|
||||||
|
|
||||||
def pytest_runtest_setup(item):
|
def pytest_runtest_setup(item):
|
||||||
def getopt(opt):
|
def getopt(opt):
|
||||||
# When using 'pytest --pyargs spacy' to test an installed copy of
|
# When using 'pytest --pyargs spacy' to test an installed copy of
|
||||||
|
@ -153,13 +148,6 @@ def pytest_runtest_setup(item):
|
||||||
# options weren't given.
|
# options weren't given.
|
||||||
return item.config.getoption("--%s" % opt, False)
|
return item.config.getoption("--%s" % opt, False)
|
||||||
|
|
||||||
for opt in ['models', 'vectors', 'slow']:
|
for opt in ["slow"]:
|
||||||
if opt in item.keywords and not getopt(opt):
|
if opt in item.keywords and not getopt(opt):
|
||||||
pytest.skip("need --%s option to run" % opt)
|
pytest.skip("need --%s option to run" % opt)
|
||||||
|
|
||||||
# Check if test is marked with models and has arguments set, i.e. specific
|
|
||||||
# language. If so, skip test if flag not set.
|
|
||||||
if item.get_marker('models'):
|
|
||||||
for arg in item.get_marker('models').args:
|
|
||||||
if not getopt(arg) and not getopt("all"):
|
|
||||||
pytest.skip("need --%s or --all option to run" % arg)
|
|
||||||
|
|
Loading…
Reference in New Issue