summaryrefslogtreecommitdiff
path: root/tests/tox_env/python
diff options
context:
space:
mode:
authorBernát Gábor <bgabor8@bloomberg.net>2021-01-30 13:59:38 +0000
committerGitHub <noreply@github.com>2021-01-30 13:59:38 +0000
commite02bdbd71708321fe6a19308eadbceae1033767e (patch)
treef8139bef0e04b2f85fc333cbb49fdf2854b6e976 /tests/tox_env/python
parent6d9b2dff59f220f6b3bae1fedcb888fd113bf269 (diff)
downloadtox-git-e02bdbd71708321fe6a19308eadbceae1033767e.tar.gz
Add list_dependencies_command support (#1887)
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
Diffstat (limited to 'tests/tox_env/python')
-rw-r--r--tests/tox_env/python/virtual_env/test_virtualenv_api.py10
1 files changed, 10 insertions, 0 deletions
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"]