mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
27 lines
689 B
Python
27 lines
689 B
Python
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)
|