Skip to content

Commit 000876e

Browse files
committed
Pass the CI env in tox.ini and use it to conditionally skip tests on CI
1 parent 5066d98 commit 000876e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

testing/test_faulthandler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def test_timeout(pytester: Pytester, enabled: bool) -> None:
7979
If faulthandler is disabled, no traceback will be dumped.
8080
"""
8181
if enabled and "CI" in os.environ:
82-
pytest.xfail(reason="sometimes crashes on CI (#7022)")
82+
pytest.skip(reason="sometimes crashes on CI (#7022)")
8383

8484
pytester.makepyfile(
8585
"""
@@ -110,7 +110,7 @@ def test_timeout():
110110
def test_timeout_and_exit(pytester: Pytester, exit_on_timeout: bool) -> None:
111111
"""Test option to force exit pytest process after a certain timeout."""
112112
if "CI" in os.environ:
113-
pytest.xfail(reason="sometimes crashes on CI (#7022)")
113+
pytest.skip(reason="sometimes crashes on CI (#7022)")
114114

115115
pytester.makepyfile(
116116
"""

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ passenv =
5252
PYTEST_ADDOPTS
5353
TERM
5454
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
55+
CI
5556
setenv =
5657
_PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} {env:_PYTEST_FILES:}
5758

0 commit comments

Comments
 (0)