Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[3.11] gh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_async (GH-110500) #110611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-110378: Fix test_async_gen_propagates_generator_exit in test_conte…
…xtlib_async (GH-110500)

It now fails if the original bug is not fixed, and no longer produce ResourceWarning with fixed code.
(cherry picked from commit 5aa62a8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
serhiy-storchaka authored and miss-islington committed Oct 10, 2023
commit dd2e259357f10842e7dc47c3b7672f1d81900f9c
14 changes: 5 additions & 9 deletions 14 Lib/test/test_contextlib_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,11 @@ async def gen():
async with ctx():
yield 11

ret = []
exc = ValueError(22)
with self.assertRaises(ValueError):
async with ctx():
async for val in gen():
ret.append(val)
raise exc

self.assertEqual(ret, [11])
g = gen()
async for val in g:
self.assertEqual(val, 11)
break
await g.aclose()

def test_exit_is_abstract(self):
class MissingAexit(AbstractAsyncContextManager):
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.