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

@@ -1,2 +0,0 @@
# This file is here to force git to create the directory, as *.pth files only
# add existing directories.

View File

@@ -1 +0,0 @@
/path/from/egg-link

View File

@@ -1 +0,0 @@
./dir-from-foo-pth

View File

@@ -1 +0,0 @@
import smth; smth.extend_path_foo()

View File

@@ -1 +0,0 @@
./relative/egg-link/path

View File

@@ -1,6 +0,0 @@
import sys
sys.path.append('/foo/smth.py:module')
def extend_path_foo():
sys.path.append('/foo/smth.py:from_func')

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()