Skip to content

Commit

Permalink
await deprecated athrow(GeneratorExit, GeneratorExit(), None)
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Apr 13, 2024
1 parent ac70dc2 commit e3ba8f0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Lib/test/test_asyncgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,8 @@ async def gen():

with self.assertWarns(DeprecationWarning):
x = gen().athrow(GeneratorExit, GeneratorExit(), None)
with self.assertWarnsRegex(RuntimeWarning,
f"coroutine method 'athrow' of '{gen.__qualname__}' "
f"was never awaited"):
del x
gc_collect()
with self.assertRaises(GeneratorExit):
x.send(None)

def test_async_gen_api_01(self):
async def gen():
Expand Down

0 comments on commit e3ba8f0

Please sign in to comment.