Skip to content

[PR #11271/331c9892 backport][3.12] Update a regex in test_aiohttp_request_coroutine for Python 3.14 #11302

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

Conversation

patchback[bot]
Copy link
Contributor

@patchback patchback bot commented Jul 11, 2025

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

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

Copy link

codspeed-hq bot commented Jul 11, 2025

CodSpeed Performance Report

Merging #11302 will not alter performance

Comparing patchback/backports/3.12/331c989242d730d49c6a001012ad9ee7cfe51112/pr-11271 (237d9c5) with 3.12 (40cc09e)

Summary

✅ 59 untouched benchmarks

Copy link

codecov bot commented Jul 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.31%. Comparing base (40cc09e) to head (237d9c5).
Report is 1 commits behind head on 3.12.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             3.12   #11302      +/-   ##
==========================================
- Coverage   98.32%   98.31%   -0.01%     
==========================================
  Files         132      132              
  Lines       43679    43679              
  Branches     2384     2384              
==========================================
- Hits        42946    42943       -3     
- Misses        558      561       +3     
  Partials      175      175              
Flag Coverage Δ
CI-GHA 98.20% <ø> (-0.01%) ⬇️
OS-Linux 97.96% <ø> (-0.01%) ⬇️
OS-Windows 95.67% <ø> (ø)
OS-macOS 97.22% <ø> (ø)
Py-3.10.11 96.85% <ø> (-0.01%) ⬇️
Py-3.10.18 97.34% <ø> (-0.01%) ⬇️
Py-3.11.13 97.54% <ø> (ø)
Py-3.11.9 97.05% <ø> (ø)
Py-3.12.10 97.14% <ø> (ø)
Py-3.12.11 97.63% <ø> (ø)
Py-3.13.3 97.87% <ø> (+<0.01%) ⬆️
Py-3.9.13 96.75% <ø> (ø)
Py-3.9.23 97.24% <ø> (+<0.01%) ⬆️
Py-pypy7.3.16 86.96% <ø> (-2.84%) ⬇️
VM-macos 97.22% <ø> (ø)
VM-ubuntu 97.96% <ø> (-0.01%) ⬇️
VM-windows 95.67% <ø> (ø)

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.

@Dreamsorcerer Dreamsorcerer merged commit 36de40a into 3.12 Jul 11, 2025
36 checks passed
@Dreamsorcerer Dreamsorcerer deleted the patchback/backports/3.12/331c989242d730d49c6a001012ad9ee7cfe51112/pr-11271 branch July 11, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants