Skip to content

Commit 42f026b

Browse files
authored
Tests: Don't assume Python 3.10 is always installed, use current Python version (#3108)
1 parent 4700298 commit 42f026b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/session/test_env_select.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
from tox.pytest import MonkeyPatch, ToxProjectCreator
1414

1515

16+
CURRENT_PY_ENV = f"py{sys.version_info[0]}{sys.version_info[1]}" # e.g. py310
17+
18+
1619
def test_label_core_can_define(tox_project: ToxProjectCreator) -> None:
1720
ini = """
1821
[tox]
@@ -151,7 +154,7 @@ def test_cli_env_can_be_specified_in_additional_environments(tox_project: ToxPro
151154
assert not outcome.err
152155

153156

154-
@pytest.mark.parametrize("env_name", ["py", "py310", ".pkg"])
157+
@pytest.mark.parametrize("env_name", ["py", CURRENT_PY_ENV, ".pkg"])
155158
def test_allowed_implicit_cli_envs(env_name: str, tox_project: ToxProjectCreator) -> None:
156159
proj = tox_project({"tox.ini": ""})
157160
outcome = proj.run("r", "-e", env_name)

0 commit comments

Comments
 (0)