Skip to content

Commit 6fb5f7f

Browse files
authored
gh-131707: fix unawaited coroutine warning in test_coroutines.Corouti… (#131708)
gh-131707: fix unawaited coroutine warning in test_coroutines.CoroutineTest.test_17
1 parent 7d9442f commit 6fb5f7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_coroutines.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1199,8 +1199,8 @@ async def __anext__(self):
11991199
def __aiter__(self):
12001200
return self
12011201

1202-
anext_awaitable = anext(A(), "a").__await__()
1203-
self.assertRaises(TypeError, anext_awaitable.close, 1)
1202+
with contextlib.closing(anext(A(), "a").__await__()) as anext_awaitable:
1203+
self.assertRaises(TypeError, anext_awaitable.close, 1)
12041204

12051205
def test_with_1(self):
12061206
class Manager:

0 commit comments

Comments
 (0)