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 4e5f2db commit 5f4ae86Copy full SHA for 5f4ae86
Lib/test/test_asyncgen.py
@@ -378,6 +378,19 @@ async def async_gen_wrapper():
378
379
self.compare_generators(sync_gen_wrapper(), async_gen_wrapper())
380
381
+ def test_async_gen_exception_12(self):
382
+ async def gen():
383
+ await anext(me)
384
+ yield 123
385
+
386
+ me = gen()
387
+ ai = me.__aiter__()
388
+ an = ai.__anext__()
389
390
+ with self.assertRaisesRegex(RuntimeError,
391
+ r'anext\(\): asynchronous generator is already running'):
392
+ an.__next__()
393
394
def test_async_gen_3_arg_deprecation_warning(self):
395
async def gen():
396
yield 123
0 commit comments