From e02bdbd71708321fe6a19308eadbceae1033767e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Sat, 30 Jan 2021 13:59:38 +0000 Subject: Add list_dependencies_command support (#1887) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- tests/tox_env/python/virtual_env/test_virtualenv_api.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/tox_env/python') diff --git a/tests/tox_env/python/virtual_env/test_virtualenv_api.py b/tests/tox_env/python/virtual_env/test_virtualenv_api.py index 0a406596..1fe07ebc 100644 --- a/tests/tox_env/python/virtual_env/test_virtualenv_api.py +++ b/tests/tox_env/python/virtual_env/test_virtualenv_api.py @@ -145,3 +145,13 @@ def test_install_command_no_packages( request: ExecuteRequest = execute_calls.call_args[0][3] found_cmd = request.cmd assert found_cmd[:-1] == ["python", "-m", "pip", "install", "-i", disable_pip_pypi_access[0], "--pre", "-r"] + + +def test_list_dependencies_command(tox_project: ToxProjectCreator, monkeypatch: MonkeyPatch) -> None: + install_cmd = "python -m pip freeze" + proj = tox_project({"tox.ini": f"[testenv]\npackage=skip\nlist_dependencies_command={install_cmd}"}) + execute_calls = proj.patch_execute(lambda r: 0 if "install" in r.run_id else None) + result = proj.run("r", "--result-json", str(proj.path / "out.json")) + result.assert_success() + request: ExecuteRequest = execute_calls.call_args[0][3] + assert request.cmd == ["python", "-m", "pip", "freeze"] -- cgit v1.2.1