Cleanup SameEnvironment and use the same logic for creation in virtualenvs

This commit is contained in:
Dave Halter
2019-02-22 00:24:55 +01:00
parent 48b137a7f5
commit a79d386eba
2 changed files with 9 additions and 3 deletions

View File

@@ -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