From 990a5f17d05214abe8aafedf8e6418a0fb5ffd50 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Wed, 6 Mar 2024 01:08:18 +0300 Subject: [PATCH] gh-116112: Fix `ResourceWarning` in `test_asyncio.test_stream` (#116371) Co-authored-by: @CendioOssman --- Lib/test/test_asyncio/test_streams.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py index bf123ebf9bd..2cf48538d5d 100644 --- a/Lib/test/test_asyncio/test_streams.py +++ b/Lib/test/test_asyncio/test_streams.py @@ -1188,6 +1188,7 @@ os.close(fd) def test_unhandled_cancel(self): async def handle_echo(reader, writer): + writer.close() asyncio.current_task().cancel() messages = self._basetest_unhandled_exceptions(handle_echo) self.assertEqual(messages, [])