Skip to content

Commit bc9c877

Browse files
committed
tests: Skip subinterpreter tests on iOS, add pytest timeout
- Add `IOS` platform constant to `tests/env.py` for consistency with existing `ANDROID`, `LINUX`, `MACOS`, `WIN`, `FREEBSD` constants. - Skip `test_multiple_interpreters.py` module on iOS. Subinterpreters are not supported in the iOS simulator environment. These tests were previously skipped implicitly because the modules weren't installed in the wheel; now that they are (commit 6ed6d5a), we need an explicit skip. - Change pytest timeout from 0 (disabled) to 120 seconds. This provides a safety net to catch hanging tests before the CI job times out after hours. Normal test runs complete in 33-55 seconds total (~1100 tests), so 120 seconds per test is very generous. - Add `-v` flag for verbose output to help diagnose any future issues.
1 parent 7148a4a commit bc9c877

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

tests/env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import sysconfig
66

77
ANDROID = sys.platform.startswith("android")
8+
IOS = sys.platform.startswith("ios")
89
LINUX = sys.platform.startswith("linux")
910
MACOS = sys.platform.startswith("darwin")
1011
WIN = sys.platform.startswith("win32") or sys.platform.startswith("cygwin")

tests/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PYBIND11_FINDPYTHON = true
2727

2828
[tool.cibuildwheel]
2929
test-sources = ["tests", "pyproject.toml"]
30-
test-command = "python -m pytest -v -o timeout=0 -p no:cacheprovider tests"
30+
test-command = "python -m pytest -v -o timeout=120 -p no:cacheprovider tests"
3131
environment.PIP_ONLY_BINARY = "numpy"
3232
environment.PIP_PREFER_BINARY = "1"
3333

tests/test_multiple_interpreters.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@
99

1010
import pytest
1111

12+
import env
1213
import pybind11_tests
1314

15+
if env.IOS:
16+
pytest.skip("Subinterpreters not supported on iOS", allow_module_level=True)
17+
1418
# 3.14.0b3+, though sys.implementation.supports_isolated_interpreters is being added in b4
1519
# Can be simplified when we drop support for the first three betas
1620
CONCURRENT_INTERPRETERS_SUPPORT = (

0 commit comments

Comments
 (0)