From 843dee628810c2045dc6702a9e17c71d45861fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 20 Dec 2022 11:37:10 +0100 Subject: [PATCH] Fix tests for tox 4.0.15 --- tests/test_integration_tox4.py | 15 +++++++-------- tests/utils.py | 1 - tox.ini | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tests/test_integration_tox4.py b/tests/test_integration_tox4.py index 3ab9fbd..90cf7df 100644 --- a/tests/test_integration_tox4.py +++ b/tests/test_integration_tox4.py @@ -11,7 +11,6 @@ from utils import ( NATIVE_SITE_PACKAGES, NATIVE_TOXENV, TOX_VERSION, - TOX_MIN_VERSION, envs_from_tox_ini, modify_config, needs_all_pythons, @@ -36,7 +35,7 @@ def test_print_deps(toxenv, print_deps_stdout_arg): result = tox("-e", toxenv, print_deps_stdout_arg) expected = textwrap.dedent( f""" - tox>={TOX_MIN_VERSION} + tox six py {tox_footer(toxenv)} @@ -57,7 +56,7 @@ def test_print_deps_with_commands_pre_post(projdir, toxenv, pre_post, print_deps result = tox("-e", toxenv, print_deps_stdout_arg) expected = textwrap.dedent( f""" - tox>={TOX_MIN_VERSION} + tox six py {tox_footer(toxenv)} @@ -94,7 +93,7 @@ def test_print_deps_with_tox_requires(projdir, toxenv, print_deps_stdout_arg): f""" setuptools>30 pluggy - tox>={TOX_MIN_VERSION} + tox six py {tox_footer(toxenv)} @@ -166,7 +165,7 @@ def test_allenvs_print_deps(print_deps_stdout_arg): result = tox(print_deps_stdout_arg) expected = [] for env in envs_from_tox_ini(): - expected.extend((f"tox>={TOX_MIN_VERSION}", "six", "py", f"{env}: OK")) + expected.extend(("tox", "six", "py", f"{env}: OK")) expected.pop() # The last "py310: OK" is not there expected.append(tox_footer(spaces=0)) expected = ("\n".join(expected)).splitlines() @@ -189,7 +188,7 @@ def test_print_deps_to_file(toxenv, tmp_path): depspath = tmp_path / "deps" result = tox("-e", toxenv, "--print-deps-to", str(depspath)) assert sorted(depspath.read_text().splitlines()) == sorted( - [f"tox>={TOX_MIN_VERSION}", "six", "py"] + ["tox", "six", "py"] ) expected = tox_footer(toxenv, spaces=0) + "\n" assert prep_tox_output(result.stdout) == expected @@ -209,7 +208,7 @@ def test_allenvs_print_deps_to_file(tmp_path, option): depspath = tmp_path / "deps" result = tox(option, str(depspath)) assert sorted(depspath.read_text().splitlines()) == sorted( - [f"tox>={TOX_MIN_VERSION}", "six", "py"] * len(envs_from_tox_ini()) + ["tox", "six", "py"] * len(envs_from_tox_ini()) ) expected = "" for env in envs_from_tox_ini()[:-1]: @@ -352,7 +351,7 @@ def test_print_deps_without_python_command(tmp_path, print_deps_stdout_arg): result = tox("-e", NATIVE_TOXENV, print_deps_stdout_arg, env=env) expected = textwrap.dedent( f""" - tox>={TOX_MIN_VERSION} + tox six py {tox_footer(NATIVE_TOXENV)} diff --git a/tests/utils.py b/tests/utils.py index 377b2b3..fe7fbcf 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -53,7 +53,6 @@ def tox(*args, quiet=True, **kwargs): TOX_VERSION = ver(tox("--version").stdout.split(" ")[0].split("+")[0]) -TOX_MIN_VERSION = ver(f"{TOX_VERSION.major}.{TOX_VERSION.minor}") TOX4 = TOX_VERSION.major == 4 diff --git a/tox.ini b/tox.ini index d8463de..774bf26 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ extras = deps= tox324: tox >=3.24,<3.25 tox3: tox < 4 - tox4: tox >=4,< 5 + tox4: tox >=4.0.15,< 5 commands = pytest -v {posargs} tests