diff options
author | Bernát Gábor <bgabor8@bloomberg.net> | 2021-01-10 12:23:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-10 12:23:14 +0000 |
commit | 684a632c714b06a76bb6ddc217eaa0df7b40976f (patch) | |
tree | 1c7dde851d67b9619c606da89e740ace970389a2 /tests | |
parent | 9201a757d0582a8181914dc7a9c863daa136a4b8 (diff) | |
download | virtualenv-684a632c714b06a76bb6ddc217eaa0df7b40976f.tar.gz |
Improve discovery on Windows and provide escape hatchet (#2046)
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/conftest.py | 2 | ||||
-rw-r--r-- | tests/unit/discovery/test_discovery.py | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index b2317fc..4b91773 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -367,7 +367,7 @@ def temp_app_data(monkeypatch, tmp_path): @pytest.fixture(scope="session") def cross_python(is_inside_ci, session_app_data): spec = str(2 if sys.version_info[0] == 3 else 3) - interpreter = get_interpreter(spec, session_app_data) + interpreter = get_interpreter(spec, [], session_app_data) if interpreter is None: msg = "could not find {}".format(spec) if is_inside_ci: diff --git a/tests/unit/discovery/test_discovery.py b/tests/unit/discovery/test_discovery.py index 210498a..59356a2 100644 --- a/tests/unit/discovery/test_discovery.py +++ b/tests/unit/discovery/test_discovery.py @@ -36,14 +36,14 @@ def test_discovery_via_path(monkeypatch, case, tmp_path, caplog, session_app_dat (target / pyvenv_cfg.name).write_bytes(pyvenv_cfg.read_bytes()) new_path = os.pathsep.join([str(target)] + os.environ.get(str("PATH"), str("")).split(os.pathsep)) monkeypatch.setenv(str("PATH"), new_path) - interpreter = get_interpreter(core) + interpreter = get_interpreter(core, []) assert interpreter is not None def test_discovery_via_path_not_found(tmp_path, monkeypatch): monkeypatch.setenv(str("PATH"), str(tmp_path)) - interpreter = get_interpreter(uuid4().hex) + interpreter = get_interpreter(uuid4().hex, []) assert interpreter is None @@ -52,13 +52,13 @@ def test_relative_path(tmp_path, session_app_data, monkeypatch): cwd = sys_executable.parents[1] monkeypatch.chdir(str(cwd)) relative = str(sys_executable.relative_to(cwd)) - result = get_interpreter(relative, session_app_data) + result = get_interpreter(relative, [], session_app_data) assert result is not None def test_discovery_fallback_fail(session_app_data, caplog): caplog.set_level(logging.DEBUG) - builtin = Builtin(Namespace(app_data=session_app_data, python=["magic-one", "magic-two"])) + builtin = Builtin(Namespace(app_data=session_app_data, try_first_with=[], python=["magic-one", "magic-two"])) result = builtin.run() assert result is None @@ -68,7 +68,7 @@ def test_discovery_fallback_fail(session_app_data, caplog): def test_discovery_fallback_ok(session_app_data, caplog): caplog.set_level(logging.DEBUG) - builtin = Builtin(Namespace(app_data=session_app_data, python=["magic-one", sys.executable])) + builtin = Builtin(Namespace(app_data=session_app_data, try_first_with=[], python=["magic-one", sys.executable])) result = builtin.run() assert result is not None, caplog.text |