Skip to content

gh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_async #110500

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

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 7, 2023

It now fails if the original bug is not fixed, and no longer produce ResourceWarning with fixed code.

…_contextlib_async

It now fails if the original bug is not fixed, and no longer produce
ResourceWarning with fixed code.
@ambv
Copy link
Contributor

ambv commented Oct 10, 2023

After 6780d63 there are no RuntimeWarnings visible on Ubuntu and macOS so I had to revert that to confirm this PR is indeed solving the core issue.

Without the change:

/Volumes/RAMDisk/cpython/Lib/contextlib.py:701: RuntimeWarning: coroutine method 'aclose' of 'TestAbstractAsyncContextManager.test_async_gen_propagates_generator_exit.<locals>.gen' was never awaited
  async def __aenter__(self):
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

This warning doesn't appear after the change.

@ambv ambv merged commit 5aa62a8 into python:main Oct 10, 2023
@miss-islington
Copy link
Contributor

Thanks @serhiy-storchaka for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 10, 2023
…_contextlib_async (pythonGH-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>
@bedevere-app
Copy link

bedevere-app bot commented Oct 10, 2023

GH-110610 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Oct 10, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 10, 2023
…_contextlib_async (pythonGH-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>
@bedevere-app
Copy link

bedevere-app bot commented Oct 10, 2023

GH-110611 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Oct 10, 2023
ambv pushed a commit that referenced this pull request Oct 10, 2023
…t_contextlib_async (GH-110500) (#110610)

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>
ambv pushed a commit that referenced this pull request Oct 10, 2023
…t_contextlib_async (GH-110500) (#110611)

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>
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…_contextlib_async (python#110500)

It now fails if the original bug is not fixed, and no longer produce ResourceWarning with fixed code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants