mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
Move sample_venvs to examples
This commit is contained in:
@@ -4,7 +4,7 @@ addopts = --doctest-modules
|
|||||||
# Ignore broken files in blackbox test directories
|
# Ignore broken files in blackbox test directories
|
||||||
norecursedirs = .* docs completion refactor namespace_package
|
norecursedirs = .* docs completion refactor namespace_package
|
||||||
scripts extensions speed static_analysis not_in_sys_path
|
scripts extensions speed static_analysis not_in_sys_path
|
||||||
sample_venvs jedi/third_party
|
jedi/third_party
|
||||||
|
|
||||||
# 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
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ import sys
|
|||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from ..helpers import skip_if_windows, skip_if_not_windows
|
|
||||||
|
|
||||||
|
from ..helpers import skip_if_windows, skip_if_not_windows, get_example_dir
|
||||||
from jedi.inference import sys_path
|
from jedi.inference import sys_path
|
||||||
from jedi.api.environment import create_environment
|
from jedi.api.environment import create_environment
|
||||||
|
|
||||||
@@ -32,14 +32,13 @@ def test_paths_from_assignment(Script):
|
|||||||
def test_venv_and_pths(venv_path):
|
def test_venv_and_pths(venv_path):
|
||||||
pjoin = os.path.join
|
pjoin = os.path.join
|
||||||
|
|
||||||
CUR_DIR = os.path.dirname(__file__)
|
|
||||||
site_pkg_path = pjoin(venv_path, 'lib')
|
site_pkg_path = pjoin(venv_path, 'lib')
|
||||||
if os.name == 'nt':
|
if os.name == 'nt':
|
||||||
site_pkg_path = pjoin(site_pkg_path, 'site-packages')
|
site_pkg_path = pjoin(site_pkg_path, 'site-packages')
|
||||||
else:
|
else:
|
||||||
site_pkg_path = glob(pjoin(site_pkg_path, 'python*', 'site-packages'))[0]
|
site_pkg_path = glob(pjoin(site_pkg_path, 'python*', 'site-packages'))[0]
|
||||||
shutil.rmtree(site_pkg_path)
|
shutil.rmtree(site_pkg_path)
|
||||||
shutil.copytree(pjoin(CUR_DIR, 'sample_venvs', 'pth_directory'), site_pkg_path)
|
shutil.copytree(get_example_dir('sample_venvs', 'pth_directory'), site_pkg_path)
|
||||||
|
|
||||||
virtualenv = create_environment(venv_path)
|
virtualenv = create_environment(venv_path)
|
||||||
venv_paths = virtualenv.get_sys_path()
|
venv_paths = virtualenv.get_sys_path()
|
||||||
|
|||||||
Reference in New Issue
Block a user