Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/explosion/spaCy into dev…
Browse files Browse the repository at this point in the history
…elop
  • Loading branch information
honnibal committed Nov 29, 2018
2 parents 008e1ee + 8d3bfb3 commit 93be3ad
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions spacy/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -153,13 +148,6 @@ def getopt(opt):
# 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)

0 comments on commit 93be3ad

Please sign in to comment.