Move sample_venvs to examples

This commit is contained in:
Dave Halter
2020-01-12 00:30:05 +01:00
parent 8dc7f2d899
commit 46f8e53e71
8 changed files with 3 additions and 4 deletions

View File

@@ -4,8 +4,8 @@ import sys
import shutil
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.api.environment import create_environment
@@ -32,14 +32,13 @@ def test_paths_from_assignment(Script):
def test_venv_and_pths(venv_path):
pjoin = os.path.join
CUR_DIR = os.path.dirname(__file__)
site_pkg_path = pjoin(venv_path, 'lib')
if os.name == 'nt':
site_pkg_path = pjoin(site_pkg_path, 'site-packages')
else:
site_pkg_path = glob(pjoin(site_pkg_path, 'python*', 'site-packages'))[0]
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)
venv_paths = virtualenv.get_sys_path()