diff options
Diffstat (limited to 'Lib/test/test_typing.py')
-rw-r--r-- | Lib/test/test_typing.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 3aed26b..bc9021a 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3015,6 +3015,16 @@ class GetTypeHintTests(BaseTestCase): get_type_hints(barfoo3, globals(), locals(), include_extras=True)["x"], BA2 ) + BA3 = typing.Annotated[int | float, "const"] + def barfoo4(x: BA3): ... + self.assertEqual( + get_type_hints(barfoo4, globals(), locals()), + {"x": int | float} + ) + self.assertEqual( + get_type_hints(barfoo4, globals(), locals(), include_extras=True), + {"x": typing.Annotated[int | float, "const"]} + ) def test_get_type_hints_annotated_refs(self): |