Skip to content

Commit 40282f8

Browse files
committed
tests: auto skip cffi backend on 3.13 free-threaded builds
cffi doesn't support free-threading until the 2.0 release. And the 2.0 release only implements it on 3.14+. So refuse to run tests against the cffi backend on 3.13 free-threaded builds.
1 parent e04f9b6 commit 40282f8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
import os
2+
import sys
3+
import sysconfig
4+
5+
import pytest
26

37
try:
48
import hypothesis # type: ignore
59
except ImportError:
610
hypothesis = None # type: ignore
711

812

13+
def pytest_configure(config):
14+
if (
15+
os.environ.get("PYTHON_ZSTANDARD_IMPORT_POLICY", "").strip() == "cffi"
16+
and sysconfig.get_config_var("Py_GIL_DISABLED") == 1
17+
and sys.version_info[0:2] == (3, 13)
18+
):
19+
pytest.exit(
20+
"cffi backend not supported on 3.13 free-threaded Python", 0
21+
)
22+
23+
924
if hypothesis:
1025
default_settings = hypothesis.settings(deadline=10000)
1126
hypothesis.settings.register_profile("default", default_settings)

0 commit comments

Comments
 (0)