mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
sample_venvs: exclude venvs dir from py.test discovery
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
addopts = --doctest-modules
|
addopts = --doctest-modules
|
||||||
|
|
||||||
# Ignore broken files in blackbox test directories
|
# Ignore broken files in blackbox test directories
|
||||||
norecursedirs = .* docs completion refactor absolute_import namespace_package scripts extensions speed static_analysis not_in_sys_path buildout_project egg-link init_extension_module
|
norecursedirs = .* docs completion refactor absolute_import namespace_package scripts extensions speed static_analysis not_in_sys_path buildout_project sample_venvs init_extension_module
|
||||||
|
|
||||||
# Activate `clean_jedi_cache` fixture for all tests. This should be
|
# Activate `clean_jedi_cache` fixture for all tests. This should be
|
||||||
# fine as long as we are using `clean_jedi_cache` as a session scoped
|
# fine as long as we are using `clean_jedi_cache` as a session scoped
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ def test_paths_from_assignment():
|
|||||||
# invoked with one of those versions, the test below will be run for the
|
# invoked with one of those versions, the test below will be run for the
|
||||||
# matching directory.
|
# matching directory.
|
||||||
CUR_DIR = os.path.dirname(__file__)
|
CUR_DIR = os.path.dirname(__file__)
|
||||||
VENVS = list(glob(os.path.join(CUR_DIR,
|
VENVS = list(glob(
|
||||||
'venvs/venv%d%d' % sys.version_info[:2])))
|
os.path.join(CUR_DIR, 'sample_venvs/venv%d%d' % sys.version_info[:2])))
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('venv', VENVS)
|
@pytest.mark.parametrize('venv', VENVS)
|
||||||
@@ -49,4 +49,6 @@ def test_get_venv_path(venv):
|
|||||||
pjoin('/path', 'from', 'smth.py'),
|
pjoin('/path', 'from', 'smth.py'),
|
||||||
pjoin('/path', 'from', 'smth.py:extend_path')
|
pjoin('/path', 'from', 'smth.py:extend_path')
|
||||||
]
|
]
|
||||||
|
# Ensure that none of venv dirs leaked to the interpreter.
|
||||||
|
assert not set(sys.path).intersection(ETALON)
|
||||||
assert venv_path[:len(ETALON)] == ETALON
|
assert venv_path[:len(ETALON)] == ETALON
|
||||||
|
|||||||
Reference in New Issue
Block a user