gh-131707: fix unawaited coroutine warning in test_coroutines.Corouti… (#131708)

gh-131707: fix unawaited coroutine warning in test_coroutines.CoroutineTest.test_17
This commit is contained in:
Thomas Grainger 2025-03-25 08:29:51 +00:00 committed by GitHub
parent 7d9442f0d5
commit 6fb5f7f4d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -1199,8 +1199,8 @@ async def __anext__(self):
def __aiter__(self):
return self
anext_awaitable = anext(A(), "a").__await__()
self.assertRaises(TypeError, anext_awaitable.close, 1)
with contextlib.closing(anext(A(), "a").__await__()) as anext_awaitable:
self.assertRaises(TypeError, anext_awaitable.close, 1)
def test_with_1(self):
class Manager: