We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eccbdfe commit f2c6bf1Copy full SHA for f2c6bf1
Lib/test/test_contextlib_async.py
@@ -49,15 +49,11 @@ async def gen():
49
async with ctx():
50
yield 11
51
52
- ret = []
53
- exc = ValueError(22)
54
- with self.assertRaises(ValueError):
55
- async with ctx():
56
- async for val in gen():
57
- ret.append(val)
58
- raise exc
59
-
60
- self.assertEqual(ret, [11])
+ g = gen()
+ async for val in g:
+ self.assertEqual(val, 11)
+ break
+ await g.aclose()
61
62
def test_exit_is_abstract(self):
63
class MissingAexit(AbstractAsyncContextManager):
0 commit comments