File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed
Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -2048,21 +2048,14 @@ def test_evaluate_string_format(self):
20482048
20492049 def test_evaluate_string_format_extra_names (self ):
20502050 # Test that internal extra_names are replaced when evaluating as strings
2051-
2052- # As identifier
2053- fr = ForwardRef ("__annotationlib_name_1__" )
2054- fr .__extra_names__ = {"__annotationlib_name_1__" : str }
2055- self .assertEqual (fr .evaluate (format = Format .STRING ), "str" )
2056-
2057- # Via AST visitor
2058- def f (a : ref | str ): ...
2051+ def f (a : unknown | str | int | list [str ] | tuple [int , ...]): ...
20592052
20602053 fr = get_annotations (f , format = Format .FORWARDREF )['a' ]
20612054 # Test the cache is not populated before access
20622055 self .assertIsNone (fr .__resolved_str_cache__ )
20632056
2064- self .assertEqual (fr .evaluate (format = Format .STRING ), "ref | str" )
2065- self .assertEqual (fr .__resolved_str_cache__ , "ref | str" )
2057+ self .assertEqual (fr .evaluate (format = Format .STRING ), "unknown | str | int | list[str] | tuple[int, ...] " )
2058+ self .assertEqual (fr .__resolved_str_cache__ , "unknown | str | int | list[str] | tuple[int, ...] " )
20662059
20672060 def test_evaluate_forwardref_format (self ):
20682061 fr = ForwardRef ("undef" )
You can’t perform that action at this time.
0 commit comments