Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: Don't assume Python 3.10 is always installed, use current Python version #3108

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/session/test_env_select.py
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand Down