mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 22:44:27 +08:00
Cleanup SameEnvironment and use the same logic for creation in virtualenvs
This commit is contained in:
@@ -131,11 +131,13 @@ 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):
|
||||
@pytest.mark.parametrize('virtualenv', ['', 'fufuuuuu', sys.prefix])
|
||||
def test_get_default_environment_when_embedded(monkeypatch, virtualenv):
|
||||
# When using Python embedded, sometimes the executable is not a Python
|
||||
# executable.
|
||||
executable_name = 'RANDOM_EXE'
|
||||
monkeypatch.setattr(sys, 'executable', executable_name)
|
||||
monkeypatch.setenv('VIRTUAL_ENV', virtualenv)
|
||||
env = get_default_environment()
|
||||
assert env.executable != executable_name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user