1
0
forked from VimPlug/jedi

Fix embedded Python with Jedi (see comments in source code), fixes davidhalter/jedi-vim#870

This commit is contained in:
Dave Halter
2019-02-21 10:18:40 +01:00
parent efd8861d62
commit b4a4dacebd
2 changed files with 41 additions and 2 deletions

View File

@@ -131,6 +131,15 @@ def test_get_default_environment_from_env_does_not_use_safe(tmpdir, monkeypatch)
assert env.path == 'fake'
def test_get_default_environment_when_embedded(monkeypatch):
# When using Python embedded, sometimes the executable is not a Python
# executable.
executable_name = 'RANDOM_EXE'
monkeypatch.setattr(sys, 'executable', executable_name)
env = get_default_environment()
assert env.executable != executable_name
def test_changing_venv(venv_path, monkeypatch):
monkeypatch.setitem(os.environ, 'VIRTUAL_ENV', venv_path)
get_cached_default_environment()