[PR #12603/dbe83fd0 backport][3.13] Fix flaky test_handler_returns_not_response on PyPy via debug-mode fixture#12607
Merged
bdraco merged 1 commit intoMay 18, 2026
Conversation
…xture (aio-libs#12603) (cherry picked from commit dbe83fd)
bdraco
commented
May 18, 2026
bdraco
commented
May 18, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3.13 #12607 +/- ##
==========================================
- Coverage 98.29% 98.29% -0.01%
==========================================
Files 128 128
Lines 44842 44847 +5
Branches 2437 2437
==========================================
+ Hits 44078 44082 +4
Misses 589 589
- Partials 175 176 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #12603 as merged into master (dbe83fd).
What do these changes do?
Route
loop.set_debug(True)through a newloop_debug_modefixture in
tests/conftest.pyso the two failing tests intests/test_web_functional.pyturn debug off before theaiohttp_clientfixture finalizes. The fixture is requested asthe last test parameter so pytest tears it down before
aiohttp_client.Leaving debug on through teardown let PyPy 3.11's asyncio
slow-callback logger walk into
Task.__repr__during connectorclose, surfacing a spurious
RuntimeWarning: coroutine was never awaitedthatfilterwarnings = errorpromotes to a teardownfailure. CPython's
reprlib.recursive_reprkeeps the same walkbounded so the flake only manifested on the PyPy CI leg, as seen
on https://github.com/aio-libs/aiohttp/actions/runs/26003637612/job/76431289229.
Are there changes in behavior for the user?
No. Tests-only.
Is it a substantial burden for the maintainers to support this?
No.
Related issue number
None.
Checklist
CONTRIBUTORS.txtCHANGES/folderAgent run details (optional, for reviewers)
Verified the fixture teardown order with an instrumented probe: the
aiohttp_clientteardown runs afterloop_debug_modehas setdebug back to
Falsewhenloop_debug_modeis the last testparameter. Ran the two affected tests against the default C build
and
AIOHTTP_NO_EXTENSIONS=1on CPython 3.14; both pass. ThePyPy 3.11 leg cannot be reproduced locally and will be verified by
CI on this PR.
make doc-spellingpasses on the new fragment (pre-existingflakey/accessorwarnings in older fragments areunaffected).
Drafted with Claude Code (claude-opus-4-7); reviewed by @bdraco.