GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-141174: Improve `ForwardRef` test coverage by dr-carlos · Pull Request #141175 · python/cpython

Conversation

@dr-carlos

@dr-carlos dr-carlos commented Nov 6, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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

cpython/Lib/annotationlib.py

Lines 146 to 147 in 42d0140

elif callable(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()).

  • Issue: annotationlib: Improve test coverage #141174

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dr-carlos added 4 commits November 7, 2025 07:33
@dr-carlos
Test unsupported format in ForwardRef.evaluate()
dbea423
@dr-carlos
Test dict cell closure with multiple variables
aea5887
@dr-carlos
Test all options in ForwardRef repr
98cbdf8
@dr-carlos
Test ForwardRef being a final class
7b431c6
@dr-carlos
dr-carlos requested a review from JelleZijlstra as a code owner November 6, 2025 23:22
@bedevere-app bedevere-app Bot added awaiting review tests Tests in the Lib/test dir labels Nov 6, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Nov 6, 2025
annotationlib: Improve test coverage #141174
Closed
@JelleZijlstra JelleZijlstra added the skip news label Nov 10, 2025
@JelleZijlstra
JelleZijlstra enabled auto-merge (squash) November 10, 2025 14:53
@JelleZijlstra
JelleZijlstra merged commit 19b5730 into python:main Nov 10, 2025
50 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra JelleZijlstra added the needs backport to 3.14 bugs and security fixes label Nov 10, 2025
@miss-islington-app

miss-islington-app Bot commented Nov 10, 2025

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Nov 10, 2025
@miss-islington-app

miss-islington-app Bot commented Nov 10, 2025

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 10, 2025
@dr-carlos @miss-islington
pythongh-141174: Improve ForwardRef test coverage (pythonGH-141175)
58a689a
* 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 <[email protected]>
@bedevere-app

bedevere-app Bot commented Nov 10, 2025

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 10, 2025
@dr-carlos @miss-islington
pythongh-141174: Improve ForwardRef test coverage (pythonGH-141175)
dc02f83
* 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 <[email protected]>
@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Nov 10, 2025
@miss-islington-app

miss-islington-app Bot commented Nov 10, 2025

Copy link
Copy Markdown

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
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned JelleZijlstra Nov 10, 2025
JelleZijlstra pushed a commit that referenced this pull request Nov 10, 2025
@miss-islington @dr-carlos
[3.14] gh-141174: Improve ForwardRef test coverage (GH-141175) (#14…
a188995
…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 <[email protected]>
@dr-carlos
dr-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
@dr-carlos @StanFromIreland
pythongh-141174: Improve ForwardRef test coverage (python#141175)
7177360
* 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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JelleZijlstra JelleZijlstra Awaiting requested review from JelleZijlstra JelleZijlstra is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@JelleZijlstra JelleZijlstra

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@dr-carlos @JelleZijlstra
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.