2015-06-07 18:53:14 +03:00
|
|
|
import pytest
|
2015-12-29 20:00:48 +03:00
|
|
|
import os
|
2015-06-07 18:53:14 +03:00
|
|
|
|
2016-10-12 20:13:31 +03:00
|
|
|
from ..en import English
|
|
|
|
from ..de import German
|
2015-06-07 18:53:14 +03:00
|
|
|
|
2016-09-26 12:57:54 +03:00
|
|
|
|
2015-06-07 18:53:14 +03:00
|
|
|
@pytest.fixture(scope="session")
|
|
|
|
def EN():
|
2016-10-15 15:13:23 +03:00
|
|
|
return English(path=False)
|
2016-05-03 13:51:47 +03:00
|
|
|
|
2016-05-03 15:24:35 +03:00
|
|
|
@pytest.fixture(scope="session")
|
2016-05-03 13:51:47 +03:00
|
|
|
def DE():
|
2016-10-15 15:13:23 +03:00
|
|
|
return German(path=False)
|
2015-07-23 02:19:03 +03:00
|
|
|
|
|
|
|
|
|
|
|
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)
|