2727_is_event_driven_platform = has_event_driven_wait ()
2828_is_macos = sys .platform == 'darwin'
2929_is_linux = sys .platform == 'linux'
30+ _is_pypy = sys .implementation .name == 'pypy'
3031_has_pidfd = hasattr (os , 'pidfd_open' )
3132_COORDINATION_TIMEOUT_SECONDS = 5.0
3233
@@ -207,7 +208,7 @@ def test_oserror_fallback_with_reaped_pid():
207208@pytest .mark .parametrize (
208209 'expected' ,
209210 [
210- pytest .param (True , marks = pytest .mark .skipif (not _is_macos , reason = 'macOS only' )),
211+ pytest .param (True , marks = pytest .mark .skipif (not _is_macos or _is_pypy , reason = 'macOS CPython only' )),
211212 pytest .param (True , marks = pytest .mark .skipif (not (_is_linux and _has_pidfd ), reason = 'Linux 3.9+ only' )),
212213 pytest .param (False , marks = pytest .mark .skipif (_is_event_driven_platform , reason = 'Only for fallback platforms' )),
213214 ],
@@ -315,7 +316,7 @@ def worker():
315316@pytest .mark .parametrize (
316317 'waiter_name' ,
317318 [
318- pytest .param ('_wait_kqueue' , marks = pytest .mark .skipif (not _is_macos , reason = 'macOS only' )),
319+ pytest .param ('_wait_kqueue' , marks = pytest .mark .skipif (not _is_macos or _is_pypy , reason = 'macOS CPython only' )),
319320 pytest .param ('_wait_pidfd' , marks = pytest .mark .skipif (not (_is_linux and _has_pidfd ), reason = 'Linux 3.9+ only' )),
320321 ],
321322)
@@ -337,7 +338,7 @@ def test_platform_waiter_directly_returns_without_killing_running_process(waiter
337338 process .wait ()
338339
339340
340- @pytest .mark .skipif (not _is_macos , reason = 'macOS only' )
341+ @pytest .mark .skipif (not _is_macos or _is_pypy , reason = 'macOS CPython only' )
341342def test_macos_wait_for_process_exit_passes_none_to_event_driven_waiter ():
342343 """On macOS, None timeout is forwarded to the event-driven waiter unchanged."""
343344 process = subprocess .Popen (
@@ -353,7 +354,7 @@ def test_macos_wait_for_process_exit_passes_none_to_event_driven_waiter():
353354 process .wait ()
354355
355356
356- @pytest .mark .skipif (not _is_macos , reason = 'macOS only' )
357+ @pytest .mark .skipif (not _is_macos or _is_pypy , reason = 'macOS CPython only' )
357358def test_macos_wait_kqueue_builds_subscription_and_closes_queue ():
358359 """The macOS kqueue waiter subscribes to the child-process exit event and closes the kqueue handle afterwards."""
359360 mock_kqueue = MagicMock ()
@@ -375,7 +376,7 @@ def test_macos_wait_kqueue_builds_subscription_and_closes_queue():
375376 mock_kqueue .close .assert_called_once ()
376377
377378
378- @pytest .mark .skipif (not _is_macos , reason = 'macOS only' )
379+ @pytest .mark .skipif (not _is_macos or _is_pypy , reason = 'macOS CPython only' )
379380def test_macos_wait_for_process_exit_falls_back_after_kqueue_oserror ():
380381 """If the macOS waiter raises OSError, wait_for_process_exit falls back to process.wait()."""
381382 process = subprocess .Popen (
0 commit comments