mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Run refactoring test using py.test
refactor.collect_file_tests is fixed; it uses global variable refactoring_test_dir which is not defined when refactor is used as a module.
This commit is contained in:
@@ -2,6 +2,7 @@ from os.path import join, dirname, abspath
|
||||
default_base_dir = join(dirname(abspath(__file__)), 'completion')
|
||||
|
||||
import run
|
||||
import refactor
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
@@ -38,11 +39,15 @@ def pytest_generate_tests(metafunc):
|
||||
"""
|
||||
:type metafunc: _pytest.python.Metafunc
|
||||
"""
|
||||
base_dir = metafunc.config.option.base_dir
|
||||
test_files = dict(map(parse_test_files_option,
|
||||
metafunc.config.option.test_files))
|
||||
if 'case' in metafunc.fixturenames:
|
||||
base_dir = metafunc.config.option.base_dir
|
||||
test_files = dict(map(parse_test_files_option,
|
||||
metafunc.config.option.test_files))
|
||||
thirdparty = metafunc.config.option.thirdparty
|
||||
metafunc.parametrize(
|
||||
'case',
|
||||
run.collect_dir_tests(base_dir, test_files, thirdparty))
|
||||
if 'refactor_case' in metafunc.fixturenames:
|
||||
metafunc.parametrize(
|
||||
'refactor_case',
|
||||
refactor.collect_dir_tests(base_dir, test_files))
|
||||
|
||||
Reference in New Issue
Block a user