@@ -1677,18 +1677,21 @@ def test_name_lookup_without_eval(self):
16771677
16781678 def test_evaluate_undefined_generic (self ):
16791679 # Test the codepath where have to eval() with undefined variables.
1680- fwdref = ForwardRef ("glob[int, undef]" ).evaluate (format = Format .FORWARDREF , globals = {"glob" : dict })
1681- self .assertIs (fwdref .__origin__ , dict )
1682- self .assertIs (fwdref .__args__ [0 ], int )
1680+ generic = ForwardRef ("glob[int, undef]" ).evaluate (format = Format .FORWARDREF , globals = {"glob" : dict })
1681+ self .assertNotIsInstance (generic , ForwardRef )
1682+ self .assertIs (generic .__origin__ , dict )
1683+ self .assertIs (generic .__args__ [0 ], int )
16831684
1684- fwdref = ForwardRef ("loc[int, undef]" ).evaluate (format = Format .FORWARDREF , locals = {"loc" : dict })
1685- self .assertIs (fwdref .__origin__ , dict )
1686- self .assertIs (fwdref .__args__ [0 ], int )
1685+ generic = ForwardRef ("loc[int, undef]" ).evaluate (format = Format .FORWARDREF , locals = {"loc" : dict })
1686+ self .assertNotIsInstance (generic , ForwardRef )
1687+ self .assertIs (generic .__origin__ , dict )
1688+ self .assertIs (generic .__args__ [0 ], int )
16871689
16881690 # Ensure that globals overwrite builtins
1689- fwdref = ForwardRef ("list[int, undef]" ).evaluate (format = Format .FORWARDREF , globals = {"list" : dict })
1690- self .assertIs (fwdref .__origin__ , dict )
1691- self .assertIs (fwdref .__args__ [0 ], int )
1691+ generic = ForwardRef ("list[int, undef]" ).evaluate (format = Format .FORWARDREF , globals = {"list" : dict })
1692+ self .assertNotIsInstance (generic , ForwardRef )
1693+ self .assertIs (generic .__origin__ , dict )
1694+ self .assertIs (generic .__args__ [0 ], int )
16921695
16931696 def test_fwdref_invalid_syntax (self ):
16941697 fr = ForwardRef ("if" )
0 commit comments