Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into extra-names
  • Loading branch information
JelleZijlstra authored May 4, 2025
commit 0a75e5f830ac11527369c67729ba2f1c5daaad82
6 changes: 3 additions & 3 deletions Lib/test/test_annotationlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def f(fstring_format: f"{a:02d}"):
pass

with self.assertRaisesRegex(TypeError, format_msg):
annotationlib.get_annotations(f, format=Format.STRING)
get_annotations(f, format=Format.STRING)

def test_shenanigans(self):
# In cases like this we can't reconstruct the source; test that we do something
Expand All @@ -408,7 +408,7 @@ def f(x: x | (1).__class__, y: (1).__class__):
pass

self.assertEqual(
annotationlib.get_annotations(f, format=Format.STRING),
get_annotations(f, format=Format.STRING),
{"x": "x | <class 'int'>", "y": "<class 'int'>"},
)

Expand All @@ -418,7 +418,7 @@ def test_special_attrs(self):
# Forward refs provide a different introspection API. __name__ and
# __qualname__ make little sense for forward refs as they can store
# complex typing expressions.
fr = annotationlib.ForwardRef("set[Any]")
fr = ForwardRef("set[Any]")
self.assertFalse(hasattr(fr, "__name__"))
self.assertFalse(hasattr(fr, "__qualname__"))
self.assertEqual(fr.__module__, "annotationlib")
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.