]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116112: Fix `ResourceWarning` in `test_asyncio.test_stream` (#116371)
authorNikita Sobolev <mail@sobolevn.me>
Tue, 5 Mar 2024 22:08:18 +0000 (01:08 +0300)
committerGitHub <noreply@github.com>
Tue, 5 Mar 2024 22:08:18 +0000 (01:08 +0300)
Co-authored-by: @CendioOssman
Lib/test/test_asyncio/test_streams.py

index bf123ebf9bd158f751ca4f445115bcc7b47bc2ac..2cf48538d5d30d241afd1baa916df4292073e02f 100644 (file)
@@ -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, [])