gh-116112: Fix `ResourceWarning` in `test_asyncio.test_stream` (#116371)

Co-authored-by: @CendioOssman
This commit is contained in:
Nikita Sobolev 2024-03-06 01:08:18 +03:00 committed by GitHub
parent e205c5cd8f
commit 990a5f17d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View 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, [])