mirror of
https://github.com/fedora-python/tox-current-env.git
synced 2025-11-06 11:08:58 +01:00
Skip tox 3/4 tests with tox 4/3 via pytest, not tox
This commit is contained in:
@@ -13,6 +13,7 @@ from utils import (
|
|||||||
NATIVE_EXECUTABLE,
|
NATIVE_EXECUTABLE,
|
||||||
NATIVE_SITE_PACKAGES,
|
NATIVE_SITE_PACKAGES,
|
||||||
NATIVE_TOXENV,
|
NATIVE_TOXENV,
|
||||||
|
TOX_VERSION,
|
||||||
envs_from_tox_ini,
|
envs_from_tox_ini,
|
||||||
is_available,
|
is_available,
|
||||||
modify_config,
|
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():
|
def test_native_toxenv_current_env():
|
||||||
result = tox("-e", NATIVE_TOXENV, "--current-env")
|
result = tox("-e", NATIVE_TOXENV, "--current-env")
|
||||||
assert result.stdout.splitlines()[0] == NATIVE_EXEC_PREFIX_MSG
|
assert result.stdout.splitlines()[0] == NATIVE_EXEC_PREFIX_MSG
|
||||||
@@ -10,6 +10,7 @@ from utils import (
|
|||||||
NATIVE_EXEC_PREFIX_MSG,
|
NATIVE_EXEC_PREFIX_MSG,
|
||||||
NATIVE_SITE_PACKAGES,
|
NATIVE_SITE_PACKAGES,
|
||||||
NATIVE_TOXENV,
|
NATIVE_TOXENV,
|
||||||
|
TOX_VERSION,
|
||||||
TOX_MIN_VERSION,
|
TOX_MIN_VERSION,
|
||||||
envs_from_tox_ini,
|
envs_from_tox_ini,
|
||||||
modify_config,
|
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():
|
def test_native_toxenv_current_env():
|
||||||
result = tox("-e", NATIVE_TOXENV, "--current-env")
|
result = tox("-e", NATIVE_TOXENV, "--current-env")
|
||||||
assert result.stdout.splitlines()[0] == NATIVE_EXEC_PREFIX_MSG
|
assert result.stdout.splitlines()[0] == NATIVE_EXEC_PREFIX_MSG
|
||||||
|
|||||||
3
tox.ini
3
tox.ini
@@ -12,8 +12,7 @@ deps=
|
|||||||
tox3: tox < 4
|
tox3: tox < 4
|
||||||
tox4: tox >=4,< 5
|
tox4: tox >=4,< 5
|
||||||
commands =
|
commands =
|
||||||
!tox4: pytest -v {posargs} tests/test_integration.py
|
pytest -v {posargs} tests
|
||||||
tox4: pytest -v {posargs} tests/test_integration_tox4.py
|
|
||||||
|
|
||||||
[pytest]
|
[pytest]
|
||||||
addopts = -nauto
|
addopts = -nauto
|
||||||
|
|||||||
Reference in New Issue
Block a user