Skip to content

Commit 54295dd

Browse files
committed
Remove now-unnecessary filterwarnings("ignore::ResourceWarning") decorators
The old tests had filterwarnings("ignore::ResourceWarning" if win32 ...) because _terminate_process_tree didn't call process.wait() or close pipe transports, so GC of the anyio Process wrapper emitted ResourceWarning. _terminate_and_reap now explicitly calls wait() + closes stdin/stdout pipes in the test's AsyncExitStack teardown (i.e., during the test, before GC can fire). The warnings should no longer occur — if they do, CI will tell us and we should fix the root cause rather than suppress. Github-Issue: #1775
1 parent 0e80918 commit 54295dd

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

tests/client/test_stdio.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ class TestChildProcessCleanup:
340340
"""
341341

342342
@pytest.mark.anyio
343-
@pytest.mark.filterwarnings("ignore::ResourceWarning" if sys.platform == "win32" else "default")
344343
async def test_basic_child_process_cleanup(self):
345344
"""Parent spawns one child; terminating the tree kills both."""
346345
async with AsyncExitStack() as stack:
@@ -364,7 +363,6 @@ async def test_basic_child_process_cleanup(self):
364363
await _assert_stream_closed(stream)
365364

366365
@pytest.mark.anyio
367-
@pytest.mark.filterwarnings("ignore::ResourceWarning" if sys.platform == "win32" else "default")
368366
async def test_nested_process_tree(self):
369367
"""Parent → child → grandchild; terminating the tree kills all three."""
370368
async with AsyncExitStack() as stack:
@@ -401,7 +399,6 @@ async def test_nested_process_tree(self):
401399
await _assert_stream_closed(stream)
402400

403401
@pytest.mark.anyio
404-
@pytest.mark.filterwarnings("ignore::ResourceWarning" if sys.platform == "win32" else "default")
405402
async def test_early_parent_exit(self):
406403
"""Parent exits immediately on SIGTERM; process-group termination still
407404
catches the child (exercises the race where the parent dies mid-cleanup).

0 commit comments

Comments
 (0)