From 42f026b99f4d56de602f4a488cc326f32ec6c50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Thu, 31 Aug 2023 16:51:17 +0200 Subject: [PATCH] Tests: Don't assume Python 3.10 is always installed, use current Python version (#3108) --- tests/session/test_env_select.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/session/test_env_select.py b/tests/session/test_env_select.py index 564806600..276dee37a 100644 --- a/tests/session/test_env_select.py +++ b/tests/session/test_env_select.py @@ -13,6 +13,9 @@ from tox.pytest import MonkeyPatch, ToxProjectCreator +CURRENT_PY_ENV = f"py{sys.version_info[0]}{sys.version_info[1]}" # e.g. py310 + + def test_label_core_can_define(tox_project: ToxProjectCreator) -> None: ini = """ [tox] @@ -151,7 +154,7 @@ def test_cli_env_can_be_specified_in_additional_environments(tox_project: ToxPro assert not outcome.err -@pytest.mark.parametrize("env_name", ["py", "py310", ".pkg"]) +@pytest.mark.parametrize("env_name", ["py", CURRENT_PY_ENV, ".pkg"]) def test_allowed_implicit_cli_envs(env_name: str, tox_project: ToxProjectCreator) -> None: proj = tox_project({"tox.ini": ""}) outcome = proj.run("r", "-e", env_name)