Skip to content

Commit c37ed94

Browse files
authored
MAINT: Skip limited_api tests on some platforms. (#32214)
1 parent 5cfd73b commit c37ed94

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎numpy/_core/tests/examples/limited_api/meson.build‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ if py.get_variable('Py_GIL_DISABLED', 0) == 0
7676
endforeach
7777
endif
7878

79-
if py.language_version().version_compare('>=3.15')
79+
if (
80+
py.language_version().version_compare('>=3.15') and
81+
(host_machine.system() != 'windows' or (py.get_variable('Py_GIL_DISABLED', 0) == 1))
82+
)
8083
py.extension_module(
8184
'limited_api_opaque',
8285
'limited_api.c',

‎numpy/_core/tests/test_limited_api.py‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,17 @@ def limited_api_cython_module_names():
200200
return _module_names("limited_api_cython", _PY_ABI3_VERSIONS)
201201

202202

203-
@pytest.mark.skipif(IS_WASM, reason="Can't start subprocess")
204-
@pytest.mark.xfail(
203+
@pytest.mark.skipif(
204+
IS_WASM, reason="platform cannot start subprocesses"
205+
)
206+
@pytest.mark.skipif(
205207
sysconfig.get_config_var("Py_DEBUG"),
206208
reason=(
207209
"Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, "
208210
"and Py_REF_DEBUG"
209211
),
210212
)
211-
@pytest.mark.xfail(
213+
@pytest.mark.skipif(
212214
NOGIL_BUILD,
213215
reason="Py_GIL_DISABLED builds do not support abi3",
214216
)
@@ -218,15 +220,17 @@ def test_limited_api_abi3(install_temp, module_name):
218220
_check_api_module(mod)
219221

220222

221-
@pytest.mark.skipif(IS_WASM, reason="Can't start subprocess")
222-
@pytest.mark.xfail(
223+
@pytest.mark.skipif(
224+
IS_WASM, reason="platform cannot start subprocesses"
225+
)
226+
@pytest.mark.skipif(
223227
sysconfig.get_config_var("Py_DEBUG"),
224228
reason=(
225229
"Py_LIMITED_API is incompatible with Py_DEBUG, Py_TRACE_REFS, "
226230
"and Py_REF_DEBUG"
227231
),
228232
)
229-
@pytest.mark.xfail(
233+
@pytest.mark.skipif(
230234
NOGIL_BUILD,
231235
reason="Py_GIL_DISABLED builds do not support abi3",
232236
)

0 commit comments

Comments
 (0)