Skip to content

Conversation

@dr-carlos
Copy link
Contributor

@dr-carlosdr-carlos commented Nov 6, 2025

All lines in the ForwardRef class (except _evaluate) should now be covered by tests, except

elifcallable(owner):
globals=getattr(owner, "__globals__", None)

I couldn't think of a useful test for those lines that wouldn't involve using the undocumented ForwardRef constructor (as the owner is automatically applied by annotationlib.get_annotations()).

@bedevere-appbedevere-appbot added awaiting review tests Tests in the Lib/test dir labels Nov 6, 2025
@JelleZijlstraJelleZijlstra enabled auto-merge (squash) November 10, 2025 14:53
@JelleZijlstraJelleZijlstra merged commit 19b5730 into python:mainNov 10, 2025
50 checks passed
@JelleZijlstraJelleZijlstra added the needs backport to 3.14 bugs and security fixes label Nov 10, 2025
@miss-islington-app
Copy link

Thanks @dr-carlos for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @dr-carlos for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 10, 2025
* Test unsupported format in ForwardRef.evaluate() * Test dict cell closure with multiple variables * Test all options in ForwardRef repr * Test ForwardRef being a final class (cherry picked from commit 19b5730) Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
@bedevere-app
Copy link

GH-141354 is a backport of this pull request to the 3.14 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 10, 2025
* Test unsupported format in ForwardRef.evaluate() * Test dict cell closure with multiple variables * Test all options in ForwardRef repr * Test ForwardRef being a final class (cherry picked from commit 19b5730) Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
@bedevere-appbedevere-appbot removed the needs backport to 3.14 bugs and security fixes label Nov 10, 2025
@miss-islington-app
Copy link

Sorry @dr-carlos and @JelleZijlstra, I had trouble completing the backport.
Please retry by removing and re-adding the "needs backport to 3.14" label.
Please backport backport using cherry_picker on the command line.

cherry_picker 19b573025e0aa569e7a34081116280133e33979a 3.14 

JelleZijlstra pushed a commit that referenced this pull request Nov 10, 2025
…1354) gh-141174: Improve `ForwardRef` test coverage (GH-141175) * Test unsupported format in ForwardRef.evaluate() * Test dict cell closure with multiple variables * Test all options in ForwardRef repr * Test ForwardRef being a final class (cherry picked from commit 19b5730) Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
@dr-carlosdr-carlos deleted the fwdref-tests branch November 10, 2025 22:02
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
* Test unsupported format in ForwardRef.evaluate() * Test dict cell closure with multiple variables * Test all options in ForwardRef repr * Test ForwardRef being a final class
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@dr-carlos@JelleZijlstra