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 @@
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 @@
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 @@
# 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 Expand Up @@ -1289,7 +1289,7 @@
pass


class TestForwardRefClass(unittest.TestCase):

Check failure on line 1292 in Lib/test/test_annotationlib.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (F811)

Lib/test/test_annotationlib.py:1292:7: F811 Redefinition of unused `TestForwardRefClass` from line 416
def test_forwardref_instance_type_error(self):
fr = ForwardRef("int")
with self.assertRaises(TypeError):
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.