Remove outdated options and fix formatting

This commit is contained in:
Ines Montani 2018-11-28 23:33:34 +01:00
parent 73255091f8
commit 8d3bfb3c04
1 changed files with 2 additions and 14 deletions

View File

@ -9,12 +9,6 @@ def pytest_addoption(parser):
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")
def tokenizer():
return get_lang_class("xx").Defaults.create_tokenizer()
@ -143,6 +137,7 @@ def ru_tokenizer():
pymorphy = pytest.importorskip("pymorphy2")
return get_lang_class("ru").Defaults.create_tokenizer()
def pytest_runtest_setup(item):
def getopt(opt):
# When using 'pytest --pyargs spacy' to test an installed copy of
@ -153,13 +148,6 @@ def pytest_runtest_setup(item):
# options weren't given.
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):
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)