Skip to content

Update a regex in test_aiohttp_request_coroutine for Python 3.14 #11271

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 4 commits into from
Jul 11, 2025

Conversation

musicinmybrain
Copy link
Contributor

@musicinmybrain musicinmybrain commented Jul 5, 2025

What do these changes do?

Based on downstream testing in Fedora Rawhide, the expected message associated with the TypeError in test_aiohttp_request_coroutine has changed for Python 3.14, which results in a test regression on Python 3.14.

E       AssertionError: Regex pattern did not match.
E        Regex: "^object _SessionRequestContextManager can't be used in 'await' expression$"
E        Input: "'_SessionRequestContextManager' object can't be awaited"

This PR conditionalizes the message regex on the Python interpreter version, fixing the regression.

This can’t easily be reproduced in a virtualenv yet: I have to work around Pydantic and uvloop not being installable for Python 3.14, and even after that, pytest segfaults. However, I have tested the patch with Python 3.14 in Fedora.

Are there changes in behavior for the user?

No; users running tests on Python 3.14 will see one fewer failure.

Is it a substantial burden for the maintainers to support this?

No. It may be desirable to remove the if/else and the old regex once Python 3.14 is the oldest supported Python version.

Related issue number

N/A

Checklist

  • I think the code is well written
  • Unit tests for the changes exist The change fixes a test.
  • Documentation reflects the changes Nothing to document
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt This was an awfully trivial change, but OK.
  • Add a new news fragment into the CHANGES/ folder

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jul 5, 2025
Copy link

codecov bot commented Jul 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.84%. Comparing base (c106c5b) to head (ba4dfc6).
Report is 82 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #11271   +/-   ##
=======================================
  Coverage   98.84%   98.84%           
=======================================
  Files         131      131           
  Lines       43262    43262           
  Branches     2327     2327           
=======================================
  Hits        42761    42761           
  Misses        346      346           
  Partials      155      155           
Flag Coverage Δ
CI-GHA 98.73% <ø> (ø)
OS-Linux 98.46% <ø> (ø)
OS-Windows 96.79% <ø> (-0.01%) ⬇️
OS-macOS 97.68% <ø> (-0.01%) ⬇️
Py-3.10.11 97.33% <ø> (-0.01%) ⬇️
Py-3.10.18 97.82% <ø> (ø)
Py-3.11.13 97.99% <ø> (-0.01%) ⬇️
Py-3.11.9 97.52% <ø> (-0.01%) ⬇️
Py-3.12.10 97.62% <ø> (-0.01%) ⬇️
Py-3.12.11 98.11% <ø> (ø)
Py-3.13.3 98.36% <ø> (-0.01%) ⬇️
Py-3.9.13 97.22% <ø> (-0.01%) ⬇️
Py-3.9.23 97.69% <ø> (-0.01%) ⬇️
Py-pypy7.3.16 85.06% <ø> (-9.91%) ⬇️
VM-macos 97.68% <ø> (-0.01%) ⬇️
VM-ubuntu 98.46% <ø> (ø)
VM-windows 96.79% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codspeed-hq bot commented Jul 5, 2025

CodSpeed Performance Report

Merging #11271 will not alter performance

Comparing musicinmybrain:py314 (ba4dfc6) with master (91108c9)

Summary

✅ 59 untouched benchmarks

@Dreamsorcerer Dreamsorcerer added backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot backport-3.13 Trigger automatic backporting to the 3.13 release branch by Patchback robot labels Jul 8, 2025
@Dreamsorcerer Dreamsorcerer merged commit 331c989 into aio-libs:master Jul 11, 2025
41 of 42 checks passed
Copy link
Contributor

patchback bot commented Jul 11, 2025

Backport to 3.12: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.12/331c989242d730d49c6a001012ad9ee7cfe51112/pr-11271

Backported as #11302

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jul 11, 2025
Copy link
Contributor

patchback bot commented Jul 11, 2025

Backport to 3.13: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.13/331c989242d730d49c6a001012ad9ee7cfe51112/pr-11271

Backported as #11303

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Jul 11, 2025
Dreamsorcerer pushed a commit that referenced this pull request Jul 11, 2025
…quest_coroutine for Python 3.14 (#11303)

**This is a backport of PR #11271 as merged into master
(331c989).**

Co-authored-by: Ben Beasley <code@musicinmybrain.net>
Dreamsorcerer pushed a commit that referenced this pull request Jul 11, 2025
…quest_coroutine for Python 3.14 (#11302)

**This is a backport of PR #11271 as merged into master
(331c989).**

Co-authored-by: Ben Beasley <code@musicinmybrain.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot backport-3.13 Trigger automatic backporting to the 3.13 release branch by Patchback robot bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants