mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Rewrite integration test using py.test
This commit is contained in:
26
test/conftest.py
Normal file
26
test/conftest.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from os.path import join, dirname, abspath
|
||||
default_base_dir = join(dirname(abspath(__file__)), 'completion')
|
||||
|
||||
import run
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
"--base-dir", default=default_base_dir,
|
||||
help="Directory in which integration test case files locate.")
|
||||
parser.addoption(
|
||||
"--thirdparty",
|
||||
help="Include integration tests that requires third party modules.")
|
||||
|
||||
|
||||
def pytest_generate_tests(metafunc):
|
||||
"""
|
||||
:type metafunc: _pytest.python.Metafunc
|
||||
"""
|
||||
if 'case' in metafunc.fixturenames:
|
||||
base_dir = metafunc.config.option.base_dir
|
||||
test_files = {}
|
||||
thirdparty = metafunc.config.option.thirdparty
|
||||
metafunc.parametrize(
|
||||
'case',
|
||||
run.collect_dir_tests(base_dir, test_files, thirdparty))
|
||||
Reference in New Issue
Block a user