From: Nikita Sobolev Date: Tue, 5 Mar 2024 22:08:18 +0000 (+0300) Subject: gh-116112: Fix `ResourceWarning` in `test_asyncio.test_stream` (#116371) X-Git-Tag: v3.13.0a5~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=990a5f17d05214abe8aafedf8e6418a0fb5ffd50;p=thirdparty%2FPython%2Fcpython.git gh-116112: Fix `ResourceWarning` in `test_asyncio.test_stream` (#116371) Co-authored-by: @CendioOssman --- diff --git a/Lib/test/test_asyncio/test_streams.py b/Lib/test/test_asyncio/test_streams.py index bf123ebf9bd1..2cf48538d5d3 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, [])