@@ -29,11 +29,14 @@ def test_enum(self):
2929        self .assertEqual (annotationlib .Format .VALUE .value , 1 )
3030        self .assertEqual (annotationlib .Format .VALUE , 1 )
3131
32-         self .assertEqual (annotationlib .Format .FORWARDREF .value , 2 )
33-         self .assertEqual (annotationlib .Format .FORWARDREF , 2 )
32+         self .assertEqual (annotationlib .Format .VALUE_WITH_FAKE_GLOBALS .value , 2 )
33+         self .assertEqual (annotationlib .Format .VALUE_WITH_FAKE_GLOBALS , 2 )
3434
35-         self .assertEqual (annotationlib .Format .SOURCE .value , 3 )
36-         self .assertEqual (annotationlib .Format .SOURCE , 3 )
35+         self .assertEqual (annotationlib .Format .FORWARDREF .value , 3 )
36+         self .assertEqual (annotationlib .Format .FORWARDREF , 3 )
37+ 
38+         self .assertEqual (annotationlib .Format .SOURCE .value , 4 )
39+         self .assertEqual (annotationlib .Format .SOURCE , 4 )
3740
3841
3942class  TestForwardRefFormat (unittest .TestCase ):
@@ -370,16 +373,13 @@ def f2(a: undefined):
370373            annotationlib .get_annotations (f2 , format = annotationlib .Format .FORWARDREF ),
371374            {"a" : fwd },
372375        )
373-         self .assertEqual (annotationlib .get_annotations (f2 , format = 2 ), {"a" : fwd })
376+         self .assertEqual (annotationlib .get_annotations (f2 , format = 3 ), {"a" : fwd })
374377
375378        self .assertEqual (
376379            annotationlib .get_annotations (f1 , format = annotationlib .Format .SOURCE ),
377380            {"a" : "int" },
378381        )
379-         self .assertEqual (annotationlib .get_annotations (f1 , format = 3 ), {"a" : "int" })
380- 
381-         with  self .assertRaises (ValueError ):
382-             annotationlib .get_annotations (f1 , format = 0 )
382+         self .assertEqual (annotationlib .get_annotations (f1 , format = 4 ), {"a" : "int" })
383383
384384        with  self .assertRaises (ValueError ):
385385            annotationlib .get_annotations (f1 , format = 42 )
@@ -394,7 +394,7 @@ def f2(a: undefined):
394394            ValueError ,
395395            r"The VALUE_WITH_FAKE_GLOBALS format is for internal use only" ,
396396        ):
397-             annotationlib .get_annotations (f1 , format = 4 )
397+             annotationlib .get_annotations (f1 , format = 2 )
398398
399399    def  test_custom_object_with_annotations (self ):
400400        class  C :
@@ -852,7 +852,7 @@ def test_pep_695_generics_with_future_annotations_nested_in_function(self):
852852class  TestCallEvaluateFunction (unittest .TestCase ):
853853    def  test_evaluation (self ):
854854        def  evaluate (format , exc = NotImplementedError ):
855-             if  format  !=   1   and   format   !=   4 :
855+             if  format  >   2 :
856856                raise  exc 
857857            return  undefined 
858858
0 commit comments