Make the subprocesses work and return the right sys paths for the different versions

This commit is contained in:
Dave Halter
2017-11-15 08:58:13 +01:00
parent 96149d2e6a
commit 4136dcaf08
6 changed files with 53 additions and 41 deletions

View File

@@ -1,5 +1,26 @@
from jedi.api.virtualenv import Environment, DefaultEnvironment
import pytest
from jedi._compatibility import py_version
from jedi.api.virtualenv import Environment, DefaultEnvironment, NoVirtualEnv
def test_sys_path():
assert DefaultEnvironment('/foo').get_sys_path()
@pytest.mark.parametrize(
'version',
['2.6', '2.7', '3.3', '3.4', '3.5', '3.6', '3.7']
)
def test_versions(version):
executable = 'python' + version
try:
env = Environment('some path', executable)
except NoVirtualEnv:
if int(version.replace('.', '')) == py_version:
# At least the current version has to work
raise
return
sys_path = env.get_sys_path()
assert any(executable in p for p in sys_path)