From f71dd2a23810118eb7f35b38a583e69be29f12d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 12 Dec 2022 19:04:32 +0100 Subject: [PATCH] Skip tox 3/4 tests with tox 4/3 via pytest, not tox --- tests/{test_integration.py => test_integration_tox3.py} | 5 +++++ tests/test_integration_tox4.py | 5 +++++ tox.ini | 3 +-- 3 files changed, 11 insertions(+), 2 deletions(-) rename tests/{test_integration.py => test_integration_tox3.py} (99%) diff --git a/tests/test_integration.py b/tests/test_integration_tox3.py similarity index 99% rename from tests/test_integration.py rename to tests/test_integration_tox3.py index 8eb13b1..406c795 100644 --- a/tests/test_integration.py +++ b/tests/test_integration_tox3.py @@ -13,6 +13,7 @@ from utils import ( NATIVE_EXECUTABLE, NATIVE_SITE_PACKAGES, NATIVE_TOXENV, + TOX_VERSION, envs_from_tox_ini, is_available, modify_config, @@ -22,6 +23,10 @@ from utils import ( ) +if TOX_VERSION.major != 3: + pytest.skip("skipping tests for tox 3", allow_module_level=True) + + def test_native_toxenv_current_env(): result = tox("-e", NATIVE_TOXENV, "--current-env") assert result.stdout.splitlines()[0] == NATIVE_EXEC_PREFIX_MSG diff --git a/tests/test_integration_tox4.py b/tests/test_integration_tox4.py index 90ca700..1aee1e4 100644 --- a/tests/test_integration_tox4.py +++ b/tests/test_integration_tox4.py @@ -10,6 +10,7 @@ from utils import ( NATIVE_EXEC_PREFIX_MSG, NATIVE_SITE_PACKAGES, NATIVE_TOXENV, + TOX_VERSION, TOX_MIN_VERSION, envs_from_tox_ini, modify_config, @@ -20,6 +21,10 @@ from utils import ( ) +if TOX_VERSION.major != 4: + pytest.skip("skipping tests for tox 4", allow_module_level=True) + + def test_native_toxenv_current_env(): result = tox("-e", NATIVE_TOXENV, "--current-env") assert result.stdout.splitlines()[0] == NATIVE_EXEC_PREFIX_MSG diff --git a/tox.ini b/tox.ini index ceadfcb..d8463de 100644 --- a/tox.ini +++ b/tox.ini @@ -12,8 +12,7 @@ deps= tox3: tox < 4 tox4: tox >=4,< 5 commands = - !tox4: pytest -v {posargs} tests/test_integration.py - tox4: pytest -v {posargs} tests/test_integration_tox4.py + pytest -v {posargs} tests [pytest] addopts = -nauto