diff options
author | q0w <43147888+q0w@users.noreply.github.com> | 2022-12-30 07:41:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-29 20:41:43 -0800 |
commit | d8c4cb0ffa1999b5d6466e0099dab76f242b1ba8 (patch) | |
tree | 6d9a51f74aa7fbeb67b018354a9a91c4161bca36 /tests | |
parent | 1d739a2641bcb0545815afbabf8b3da9694ec0ff (diff) | |
download | tox-git-d8c4cb0ffa1999b5d6466e0099dab76f242b1ba8.tar.gz |
Fix --skip-missing-interpreters (#2793)
Closes https://github.com/tox-dev/tox/issues/2649
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tox_env/python/test_python_runner.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/tox_env/python/test_python_runner.py b/tests/tox_env/python/test_python_runner.py index 93d5e497..eca65b2d 100644 --- a/tests/tox_env/python/test_python_runner.py +++ b/tests/tox_env/python/test_python_runner.py @@ -1,5 +1,6 @@ from __future__ import annotations +import sys from pathlib import Path import pytest @@ -121,3 +122,14 @@ def test_extras_are_normalized( result = project.run("c", "-e", "py", "--root", str(demo_pkg_inline), "-k", "extras") result.assert_success() assert result.out == f"[testenv:py]\nextras = {used_extra}\n" + + +@pytest.mark.parametrize( + ("config", "cli", "expected"), + [("false", "true", True), ("true", "false", False), ("false", "config", False), ("true", "config", True)], +) +def test_config_skip_missing_interpreters(tox_project: ToxProjectCreator, config: str, cli: str, expected: str) -> None: + py_ver = ".".join(str(i) for i in sys.version_info[0:2]) + project = tox_project({"tox.ini": f"[tox]\nenvlist=py4,py{py_ver}\nskip_missing_interpreters={config}"}) + result = project.run("--skip-missing-interpreters", cli) + assert result.code == 0 if expected else 1 |