+
    BiS9                    b   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt  ^ RIt^ RIHt ^ RIHt ^ RIHtHt ^ RIHt ^ R	IH t  ^ R
I!H"t" ^ RI#H$t$H%t%H&t&H't'H(t(H)t) ]PT                  PW                  ]PX                  4      t-]P\                  ! ]-4       U u. uF  q P_                  R4      '       g   K  V NK  	  up t0]0Pc                  RR.4       ]! ],4      Pd                  R,          R,          t3R R lt4R R lt5 ! R R]Pl                  4      t7 ! R R]Pl                  4      t8 ! R R]Pl                  4      t9 ! R R]Pl                  4      t: ! R R]Pl                  4      t; ! R R ]Pl                  4      t< ! R! R"]Pl                  4      t= ! R# R$]]Pl                  4      t> ! R% R&]Pl                  4      t?]P                   ! R' R(]Pl                  4      4       tA ! R) R*]Pl                  4      tB ! R+ R,]Pl                  4      tC]DR-8X  d\   ]E! ]
P                  4      ^8  d2   ]
P                  ^,          R.8X  d   ]5! 4        ]
P                  ! ^ 4       ]P                  ! 4        R# R#   ] d    Rt ELPi ; iu up i )/    N)StringIO)Path)dedent)support)	os_helper)skip_emscripten_stack_overflowskip_wasi_stack_overflow)ASTTestMixinensure_lazy_imports)to_tuple)
eval_testseval_results
exec_testsexec_resultssingle_testssingle_resultsz.pyztest/test_grammar.pyztest/test_unpack_ex.pydatazast_repr.txtc                :    V ^8  d   QhR\         \        ,          /# )   return)liststr)formats   "-/usr/lib/python3.14/test/test_ast/test_ast.py__annotate__r   *   s     # #c #    c                  $    \         \        ,           # N)r   r    r   r   ast_repr_get_test_casesr!   *   s    
""r   c                    V ^8  d   QhRR/# r   r   Nr    )r   s   "r   r   r   .   s     3 34 3r   c                      \        4        U u. uF"  p \        \        P                  ! V 4      4      NK$  	  pp \        P                  R P                  V4      4       R# u up i )
N)r!   reprastparseAST_REPR_DATA_FILE
write_textjoin)testr   s     r   ast_repr_update_snapshotsr-   .   sD    .E.GH.GdD4!.GDH!!$))D/2 Is   (Ac                   D   a  ] tR t^3t o ]P
                  R 4       tRtV tR# )LazyImportTestc                "    \        R 0 Rm4       R# )r'   N>   reenuminspectargparse
contextlibcollectionsr   selfs   &r   test_lazy_importLazyImportTest.test_lazy_import4   s    E#efr   r    N)	__name__
__module____qualname____firstlineno__r   cpython_onlyr9   __static_attributes____classdictcell____classdict__s   @r   r/   r/   3   s     g gr   r/   c                   8  a  ] tR t^9t o RtR tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R! t$]%PL                  R" 4       t'R# t(R$ t)R% t*R& t+R' t,R( t-R) t.R* t/R+ t0R, t1R- t2R. t3R/ t4R0 t5R1 t6R2 t7R3 t8R4 t9R5 t:R6 t;R7 t<R8 t=R9 t>R: t?]%PL                  ]@! 4       ]A! 4       R; 4       4       4       tBR< tCV 3R= lR> ltDV 3R? lR@ ltEV 3RA lRB ltFRC tGRD tHRE tIRF tJRGtKV tLR# )H	AST_TestsNc                    \        V\        4      '       g   R # RVP                  9  d   R # VR8g  ;'       d    V^ ,          P                  4       # )Fr'   AST)
isinstancetyper<   isupper)r8   namenodes   &&&r   _is_ast_nodeAST_Tests._is_ast_node<   s>    $%%'u}22a!22r   c                   \        V\        P                  4      '       d   VP                  f   R # \        V\        P                  \        P
                  \        P                  34      '       dB   VP                  VP                  3pV P                  W24       VP                  VP                  3pVP                   F  p\        W4      p\        V\        4      '       dT   TpV'       d.   VR8X  d'   V^ ,          P                  V^ ,          P                  3pV F  pV P                  Wv4       K  	  Kw  Vf   K}  V P                  WR4       K  	  V P                  VP                  VP                  4       R # )Ndecorator_list)rH   r'   rG   _fieldsexprstmtexcepthandlerlineno
col_offsetassertGreaterEqualgetattrr   _assertTrueorderassertEqual__match_args__)r8   ast_node
parent_posnode_posrK   value	first_poschilds   &&&     r   rY   AST_Tests._assertTrueorderC   s   (CGG,,0@0@0Hh388S5F5F GHH )<)<=H##H9"//8+>+>?J$$DH+E%&&&	T%55!&q%(2E2E FI"E))%; #"%%e8 % 	))8+B+BCr   c                   \         P                  ! 4       pV P                  VP                  R4       ^*Vn        V P                  VP                  ^*4       V P                  VP
                  R,          ^*4       V P                  \        4      ;_uu_ 4        VP                   RRR4       V P                  \        4      ;_uu_ 4        \         P                  ! ^4       RRR4       R#   + '       g   i     LN; i  + '       g   i     R# ; i)*   foobarNr    )
r'   rG   rZ   rQ   re   __dict__assertRaisesAttributeErrorvararg	TypeErrorr8   xs   & r   test_AST_objectsAST_Tests.test_AST_objectsV   s    GGIB'2&H-r2~..HH / y))GGAJ *) /. *))s   C(C;(C8	;D	c                  a \         P                  P                  oV3R  lpV P                  V4       \         P                  =RpV P	                  \
        V4      ;_uu_ 4        \         P                  ! ^{R7       RRR4       V P	                  \
        V4      ;_uu_ 4        \         P                  ! 4        RRR4       R#   + '       g   i     LN; i  + '       g   i     R# ; i)c                  2   < S \         P                  n        R # r   )r'   rG   rQ   )	old_values   r   cleanup5AST_Tests.test_AST_fields_NULL_check.<locals>.cleanuph   s    'CGGOr   z0type object 'ast.AST' has no attribute '_fields')arg1N)r'   rG   rQ   
addCleanupassertRaisesRegexrh   )r8   rr   msgrq   s   &  @r   test_AST_fields_NULL_check$AST_Tests.test_AST_fields_NULL_checkd   s    GGOO		( GGO@##NC88GG 9##NC88GGI 98 98888s   #C!CC	C%	c                    ! R  R4      p\         P                  ! 4       pV! 4       Vn        W"P                  n        \        P
                  ! VP                  4      p?\        P                  ! 4        V P                  V! 4       4       R# )c                       ] tR t^vtRtR# )0AST_Tests.test_AST_garbage_collection.<locals>.Xr    Nr;   r<   r=   r>   r@   r    r   r   Xr|   v       r   r~   N)	r'   rG   rl   aweakrefrefr   
gc_collectassertIsNone)r8   r~   r   r   s   &   r   test_AST_garbage_collection%AST_Tests.test_AST_garbage_collectionu   sZ    	 	GGIckk!###% r   c           
        \         \        R 3\        \        R3\        \
        R33 F  w  rp\        W4       F  w  rEV P                  RVR7      ;_uu_ 4        \        VRV\        P                  4      pV P                  \        V4      V4       V P                  VR	4       RRR4       V P                  RWCR7      ;_uu_ 4        \        XRV4       RRR4       K  	  K  	  R#   + '       g   i     LK; i  + '       g   i     K  ; i)
execsingleevalparsing)actioninput?N	compiling)r   r   kind)r   r   )r   r   r   r   r   r   zipsubTestcompiler'   PyCF_ONLY_ASTrZ   r   rY   )r8   r   outputr   ioast_trees   &      r   test_snippetsAST_Tests.test_snippets   s    %/v$F%1>8$L%/v$F$HE4 E*\\!\<<&q#tS5F5FGH$$Xh%7;))(F; = \\A\IIHc40 JI +$H =< JIIs   A
C%	C8	%C58D	c                    \         \        ,           \        ,           pV F&  p\        P                  ! V4      p\        VR R4       K(  	  R# )<string>r   N)r   r   r   r'   r(   r   )r8   snippets_to_validatesnippettrees   &   r   test_ast_validationAST_Tests.test_ast_validation   s6    )L8:E+G99W%DD*f- ,r   c                    R F>  pV P                  \        \        P                  \        P                  ! ^*4      VR7       K@  	  R# )   optimizeN)r   r   r   )rg   rj   r'   r(   Constant)r8   optvals   & r   test_parse_invalid_ast AST_Tests.test_parse_invalid_ast   s5    #FiCLL4D'-  / $r   c                   . ROpV EF  w  r#V P                  W#R7      ;_uu_ 4        \        P                  ! RVR7      p\        P                  ! \        P                  ! R4      VR7      pWE3 EF1  pV P                  VP                  ^ ,          \        P
                  4       \        V\        4      '       du   V P                  VP                  ^ ,          P                  \        P                  4       V P                  VP                  ^ ,          P                  P                  V4       K  V P                  VP                  ^ ,          P                  \        P                  4       V P                  VP                  ^ ,          P                  P                  V4       EK4  	  RRR4       EK  	  R#   + '       g   i     EK  ; i)r   	__debug__)r   expectedr   N))r   r   )r   r   )r   F)r   F)r   r'   r(   assertIsInstancebodyExprrH   boolr_   r   rZ   Nameid)r8   casesr   r   res1res2ress   &      r   !test_optimization_levels__debug__+AST_Tests.test_optimization_levels__debug__   s"   M"'VV??yyv>yy;!7&I <C))#((1+sxx@!(D11--chhqk.?.?N((!):):)@)@(K--chhqk.?.?J((!):):)=)=xH ( @? #(???s   E>F44Gc           
     d   . ROpV F  w  r#V P                  RV RV 24      ;_uu_ 4        Rp\        P                  ! V4      pW%P                  ^ ,          n        W5P                  ^ ,          n        V P                  \        4      ;_uu_ 4        \        VRR4       RRR4       RRR4       K  	  . ROpV F  w  rxV P                  RV RV 24      ;_uu_ 4        Rp\        P                  ! V4      pWuP                  ^ ,          n	        WP                  ^ ,          n
        V P                  \        4      ;_uu_ 4        \        VRR4       RRR4       RRR4       K  	  R#   + '       g   i     L; i  + '       g   i     EK  ; i  + '       g   i     LF; i  + '       g   i     K  ; i)	
   zCheck invalid linenos :za = 1r   r   NzCheck invalid col_offset ))r   r   )i)r   r   ))r   r   )r   r'   r(   r   rU   
end_linenorg   
ValueErrorr   rV   end_col_offset)	r8   invalid_linenosrU   r   r   r   invalid_col_offsetsrV   r   s	   &        r   !test_invalid_position_information+AST_Tests.test_invalid_position_information   sJ   
 #2F 6vha
|LMM!yy)&,		!#*4		!'&&z22D*f5 3 NM #2
 +>&J 9*Q~FVWXX!yy)*4		!'.<		!+&&z22D*f5 3 YX +> 32 NMM" 32 YXXsI   A$E6E#E6A$F?FF#E3.E66FFFF/c                   \         P                  ! \         P                  ! \         P                  ! R ^^ R7      .^^ R7      \         P                  ! \         P                  ! R^ ^ R7      .^ ^R7      .. R7      p\	        VRR4       R# )builtinsrK   rU   rV   )namesrU   rV   	tracebackr   type_ignoresr   r   N)r'   ModuleImportaliasr   r8   r   s   & r   >test_compilation_of_ast_nodes_with_default_end_position_valuesHAST_Tests.test_compilation_of_ast_nodes_with_default_end_position_values   sl    zzJJciiZaPQZ[hijJJcii[qQR[\ijk 
  	j&)r   c           
        \         P                  ! R ^ ^ R7      pRRR^ /R^ RR/R^ RRRR/RRRRR^ /3 F{  pV P                  VR7      ;_uu_ 4        \         P                  ! \         P                  ! RRV./VB .. R7      p\        VR	R
4       \         P                  ! V^R7       RRR4       K}  	  R#   + '       g   i     K  ; i)r   r   rU   rV   r   r   )attrsr   r   r   r   r   Nr   r    )r'   r   r   r   r   r   r(   )r8   r   r   r   s   &   r   #test_negative_locations_for_compile-AST_Tests.test_negative_locations_for_compile   s    		{1Cr<+q,+q,,<bAr<\1=	
E E**zzJJ6eW66( "$
 j&1 		$+ +*
 +**s   AB55Cc                   \         P                  ! R 4      p\         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      pVVVVVV3 EF  pR EF  pV P                  WxR7      ;_uu_ 4        \        P                  ! WxR7      p	V P                  \        V	P                  ^ ,          P                  4      ^4       V^8X  di   V	P                  ^ ,          P                  ^ ,          p
V P                  V
\        P                  4       V P                  \        V
4      R^R	^R
^R^/4       MV P                  V	P                  ^ ,          P                  ^ ,          \        P                  4       V P                  V	P                  ^ ,          P                  ^ ,          P                  \        P                  4       \        VRR4       \        VRRVR7       \        V	RR4       \        V	RRVR7       RRR4       EK  	  EK  	  R#   + '       g   i     EK  ; i)z>
            class A:
                """Docstring"""
        zO
            class A:
                """
                Docstring"""
        zA
            def some():
                """Docstring"""
        zi
            def some():
                """Docstring
                                       """
        zG
            async def some():
                """Docstring"""
        ze
            async def some():
                """
                Docstring
            """
        code	opt_levelr   rU   rV   r   r   r   r   Nr   r   r   )textwrapr   r   r'   r(   rZ   lenr   r   Passvarsr   r_   r   r   )r8   class_example1class_example2def_example1def_example2async_def_example1async_def_example2r   r   mod	pass_stmts   &          r   'test_docstring_optimization_single_node1AST_Tests.test_docstring_optimization_single_node   s   ! *  " * 
   (    ( 
 &__ .  &__ .  
D '	\\t\AA))D=C$$S!)9)9%:A> A~$'HHQK$4$4Q$7	--iB(( O (! ,a ,a 0!	 --chhqk.>.>q.A388L--HHQK,,Q/55LL
 D#v.D#v	BCf-CfyA3 BA '
 BAAs   1FI	Ic                   \         P                  ! R 4      p\         P                  ! R4      p\         P                  ! R4      pVVV3 EFi  pR EF^  pV P                  WER7      ;_uu_ 4        \        P                  ! WER7      pV^8X  dT   V P                  VP                  ^ ,          P                  ^ ,          \        P                  \        P                  34       MV P                  VP                  ^ ,          P                  ^ ,          \        P                  4       V P                  VP                  ^ ,          P                  ^ ,          P                  \        P                  4       \        VRR4       \        VRRVR7       \        VRR4       \        VRRVR7       RRR4       EKa  	  EKl  	  R#   + '       g   i     EK|  ; i)	zz
            class A:
                '''
                Docstring
                '''
                x = 1
            zz
            def some():
                '''
                Docstring

            '''
                x = 1
            zp
            async def some():

                '''Docstring

            '''
                x = 1
            r   r   r   r   Nr   )r   r   r   r'   r(   assertNotIsInstancer   r   r   r   r_   r   r   )r8   class_exampledef_exampleasync_def_exampler   r   r   s   &      r   *test_docstring_optimization_multiple_nodes4AST_Tests.test_docstring_optimization_multiple_nodes!  sc    
 oo	
 %OO	
 
D
 '	\\t\AA))D=C A~00HHQK,,Q/ XXsxx0
 --chhqk.>.>q.A388L--HHQK,,Q/55LL
 D#v.D#v	BCf-CfyA# BA '
 BAAs   ,D8F8	8G
c                   \         P                  ! R 4      P                  ^ ,          P                  P                  pV P                  VP                  4       V P                  VP                  4       V P                  VP                  4       R# )zx[::]N)	r'   r(   r   r_   slicer   upperlowerstep)r8   slcs   & r   
test_sliceAST_Tests.test_slice\  s]    ii %%a(..44#))$#))$#((#r   c                    \         P                  ! R 4      P                  ^ ,          pV P                  VP                  4       R# )zfrom . import yN)r'   r(   r   r   module)r8   ims   & r   test_from_importAST_Tests.test_from_importb  s.    YY()..q1"))$r   c                    \         P                  ! R 4      pV P                  VP                  ^ ,          \         P                  4       RP                  4       VP                  ^ ,          n        \        VRR4       R# )zfrom __future__ import divisionz __future__ <test>r   N)r'   r(   r   r   
ImportFromstripr   r   )r8   r   s   & r   !test_non_interned_future_from_ast+AST_Tests.test_non_interned_future_from_astf  sR    ii9:chhqk3>>:+113Xv&r   c                \   \         P                  ! R 4      P                  ^ ,          pV P                  \	        VP
                  4      ^4       VP
                  ^ ,          pV P                  VP                  R4       V P                  VP                  4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       \         P                  ! R4      P                  ^ ,          pVP
                  ^ ,          pV P                  VP                  R4       V P                  VP                  4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       \         P                  ! R4      P                  ^ ,          pVP
                  ^ ,          pV P                  VP                  R4       V P                  VP                  R4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       \         P                  ! R4      P                  ^ ,          pVP
                  ^ ,          pV P                  VP                  R4       V P                  VP                  R4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       R	# )
zfrom bar import yyzfrom bar import **zfrom bar import y as zzzimport bar as foobarfooN)r'   r(   r   rZ   r   r   rK   r   asnamerU   r   rV   r   )r8   r   r   s   &  r   
test_aliasAST_Tests.test_aliasl  s   YY*+003RXX*S)%,,'q)))1-))2.--r2YY*+003S)%,,'q)))1-))2.--r2YY/055a8S)s+q)))1-))2.--r2YY*+003U+u-q)))1-))1---r2r   c                .   V P                  \        P                  \        P                  4       V P                  \        P                  \        P
                  4       V P                  \        P                  \        P                  4       V P                  \        P
                  \        P                  4       V P                  \        P                  \        P                  4       V P                  \        P                  \        P                  4       R # r   )	assertIsSubclassr'   ForrS   r   rR   rG   comprehensionGtr7   s   &r   test_base_classesAST_Tests.test_base_classes  s    cggsxx0chh1chh0chh0c//9cffcgg.r   c                P   \         P                  P                  4        F  w  rVR 8X  d   K  V P                  W4      '       g   K'  V P	                  V4      p\        V\         P                  4      '       g   KZ  V P                  \        VP                  4      \        4       K  	  R# )IndexN)r'   rf   itemsrM   _construct_ast_classrH   rG   assertIsrI   rQ   tuple)r8   rK   itemrl   s   &   r   test_field_attr_existence#AST_Tests.test_field_attr_existence  sm    ,,,,.JDw  ,,--d3a))MM$qyy/59 /r   c                V   / pVP                   P                  4        F  w  r4V\        J d   R W#&   K  V\        J d   ^*W#&   K%  V\        J d   RW#&   K5  \        V\        4      '       g   KM  \        V\        P                  4      '       g   Ko  V P                  V4      W#&   K  	  V! R/ VB # )capybaras   capybarar    )__annotations__r  r   intobjectrH   rI   
issubclassr'   rG   r  )r8   clskwargsrK   typs   &&   r   r  AST_Tests._construct_ast_class  s    ,,224IDcz)!*C&&:c377+C+C#88= 5 }V}r   c                @   \         P                  ! 4       pV P                  VP                  R4       V P                  \         P                  P                  R \
        \         P                  ,          R\
        \         P                  ,          R\         P                  R,          R\
        \         P                  ,          R\
        \         P                  ,          R\         P                  R,          R\
        \         P                  ,          /4       V P                  VP                  . 4       V P                  VP                  4       \         P                  ! \        ^^4      !  pV P                  VP                  ^4       V P                  VP                  ^4       R# )	posonlyargsargsri   
kwonlyargskw_defaultskwargdefaultsN)r)  r*  ri   r+  r,  r-  r.  )r'   	argumentsrZ   rQ   r   r   argrR   r*  r   ri   rangerk   s   & r   test_argumentsAST_Tests.test_arguments  s   MMO %I 	J664=DMcggn$sww-4>SWWt^SXX9
 	 	$!((#MM5A;'#1%r   c                x    \         P                  ! ^4      pRVn        V P                  VP                  R4       R# )r   i  N)r'   r   rQ   rZ   rk   s   & r   test_field_attr_writable"AST_Tests.test_field_attr_writable  s*    LLO	C(r   c           	     	   V P                  \        4      ;_uu_ 4        \        P                  ! 4       pR R R 4       V P	                  XP
                  R4       V P                  \        4      ;_uu_ 4        VP                   R R R 4       \        P                  ! ^*4      pV P	                  VP                  ^*4       V P                  \        4      ;_uu_ 4        VP                   R R R 4       V P                  \        4      ;_uu_ 4        VP                   R R R 4       \        P                  ! ^^R7      pV P	                  VP                  ^4       \        P                  ! ^*^ R7      pV P	                  VP                  ^ 4       V P	                  VP
                  R4       V P	                  VP                  ^*4       V P                  \        \        P                  ^R ^4       V P                  \        \        P                  ^R ^^ R7       V P                  \        4      ;_uu_ 4        V P	                  \        P                  ! ^RR7      P                  R4       R R R 4       V P                  \        R4      ;_uu_ 4        \        P                  ! ^^R7       R R R 4       V P	                  \        P                  ! ^*4      P                  ^*4       V P	                  \        P                  ! R4      P                  R4       V P	                  \        P                  ! R4      P                  R4       V P	                  \        P                  ! R	4      P                  R	4       V P	                  \        P                  ! R
4      P                  R
4       V P                  \        P                  ! R4      P                  R4       V P                  \        P                  ! R4      P                  R4       V P                  \        P                  ! R 4      P                  R 4       V P                  \        P                  ! R4      P                  R4       R #   + '       g   i     EL.; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELR; i  + '       g   i     EL'; i)N)rU   r_   rU   r	  )r
  z1Constant got multiple values for argument 'value'r_   g      @y              @42s   42TF.)r_   r   )assertWarnsDeprecationWarningr'   r   rZ   rQ   rg   rh   r_   rU   re   rj   r
  rv   r  rk   s   & r   test_classattrsAST_Tests.test_classattrs  s!   011A 2$56~..GG / LL"%~..HH / ~..HH / LL+1%LLA&1%$56"%)S\\1dA>)S\\1dAaH 011S\\!7;;UC 2 ##I/bccLL!$ d 	b)//4d+1148e,22E:d+1148e,22E:cll4(..5cll5)//7cll4(..5cll3'--s3U 211 /.. /.. /.. 211 dccsG   Q5Q-RR-3R)R=Q*	-Q>	R	R&	)R:	=S	c                    ! R  R\         P                  4      p ! R R\         P                  4      pV! ^*4      pV P                  VP                  ^*4       V P                  VP                  R4       V P                  \        V4      V4       V P                  \        W14      4       V P                  \        V\         P                  4      4       V P                  \        W24      4       V P                  \        \         P                  ! ^*4      V4      4       V! ^*R7      pV P                  VP                  ^*4       V P                  \        V4      V4       R# )c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )-AST_Tests.test_constant_subclasses.<locals>.Ni  c                6   < \         SV `  ! V/ VB  R V n        R# )spamN)super__init__r  )r8   r*  r%  	__class__s   &*,r   rE  6AST_Tests.test_constant_subclasses.<locals>.N.__init__  s     $1&1r   )r  )r;   r<   r=   r>   rE  r@   rA   __classcell__)rF  rC   s   @@r   NrA    s        r   rI  c                       ] tR tRtRtR# ).AST_Tests.test_constant_subclasses.<locals>.N2i  r    Nr}   r    r   r   N2rK    r   r   rL  rC  r9  N)	r'   r   rZ   r_   r  rI   
assertTruerH   assertFalse)r8   rI  rL  ns   &   r   test_constant_subclasses"AST_Tests.test_constant_subclasses  s    	  	 	 	 bE"%f%a!$
1()
1cll34A*+CLL$4a89BK"%a!$r   c                    \         P                  ! ^*4      .p\         P                  ! V. 4      pV P                  VP                  V4       R# )rd   N)r'   r   r   rZ   r   )r8   r   rl   s   &  r   test_moduleAST_Tests.test_module  s7    R !JJtR &r   c           
        V P                  \        4      ;_uu_ 4        \        P                  ! 4       pR R R 4       V P	                  XP
                  R4       ^Vn        V P	                  VP                  ^4       \        P                  ! ^4      p\        P                  ! ^4      p\        P                  ! 4       p\        P                  ! W$V4      pV P	                  VP                  V4       V P	                  VP                  V4       V P	                  VP                  V4       \        P                  ! ^^^4      pV P	                  VP                  ^4       V P	                  VP                  ^4       V P	                  VP                  ^4       \        P                  ! ^^^^ R7      pV P	                  VP                  ^4       V P	                  VP                  ^4       V P	                  VP                  ^4       V P	                  VP                  ^ 4       V P                  \        \        P                  ^^^^4       V P                  \        \        P                  ^^^^^ R7       \        P                  ! ^^^^ R7      pV P	                  VP                  ^4       V P	                  VP                  ^4       V P	                  VP                  ^4       V P	                  VP                  ^ 4       V P                  \        4      ;_uu_ 4        \        P                  ! ^^^^*R7      pR R R 4       V P	                  VP                  ^*4       R #   + '       g   i     EL,; i  + '       g   i     LB; i)Nr8  )leftoprightrU   )	foobarbazrV  rW  rX  )r;  r<  r'   BinOprZ   rQ   rY  r   AddrV  rW  rX  rU   rg   rj   )r8   rl   n1n3addops   &    r   test_nodeclassesAST_Tests.test_nodeclasses  sv   011		A 2$;< a(\\!_\\!_	IIb$$u%"%IIaA#q!!$IIaAa(#q!!$1% 	)SYY1a;)SYY1a1E II1!A6#q!!$1% 011		!QR0A 2b)U 211P 21s   MM+M(	+M;	c                h    \         P                  ! 4       pV P                  VP                  R4       R # )Nr    )r'   SubrZ   rQ   rk   s   & r   test_no_fieldsAST_Tests.test_no_fields@  s!    GGIB'r   c           	     x   \        ^^R7      p\        P                  ! \        P                  ! \        P                  ! R/ VB 3/ VB .. 4      pV P                  \        4      ;_uu_ 4       p\        VRR4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)r   rU   rV   r   r   Nzbut got expr()r    )dictr'   r   r   rR   rg   rj   r   assertInr   	exception)r8   posmcms   &   r   test_invalid_sumAST_Tests.test_invalid_sumE  s~    !*JJC8C892>y))RAx( *&BLL(9: *)s   ,B))B9	c           	        \         P                  ! \         P                  ! \         P                  ! ^*\         P                  ! 4       4      4      .. 4      p\         P
                  ! V4       V P                  \        4      ;_uu_ 4       p\        VRR4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)rd   r   r   Nzidentifier must be of type str)r'   r   r   r   Loadfix_missing_locationsrg   rj   r   ri  r   rj  )r8   rl  rm  s   &  r   test_invalid_identifier!AST_Tests.test_invalid_identifierL  s    JJ"chhj!9:;R@!!!$y))RAx( *6BLL8IJ *)s   CC	c                f   \         ^^\         3\        ^^\         34      3 Fx  p\        P                  ! \        P                  ! V4      R7      p\        P
                  ! V4       V P                  \        R4      ;_uu_ 4        \        VRR4       RRR4       Kz  	  R#   + '       g   i     K  ; i)r   r   zinvalid type in Constant: typer   r   N)	r!  	frozensetr'   
Expressionr   rr  rv   rj   r   )r8   invalid_constantes   &  r   test_invalid_constantAST_Tests.test_invalid_constantS  s     #aC[)Q3K2H HCLL1A$BCA%%a('';  8V,  !I  s   BB0c                n   \         P                  ! R 4      pRVP                  ^ ,          P                  ^ ,          P                  n        V P	                  \
        4      ;_uu_ 4       p\        VRR4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)zdef f():
 yield from g()Nr   r   zfield 'value' is required)
r'   r(   r   r_   rg   r   r   ri  r   rj  )r8   empty_yield_fromrm  s   &  r   test_empty_yield_fromAST_Tests.test_empty_yield_from\  s}    99%@A7;a %%a(..4z**b$h7 +13r||3DE +*   'B$$B4	c                    ^ RI pR p\        P                  ! VRV4      ;_uu_ 4        V P                  \        \
        P                  R4       RRR4       R#   + '       g   i     R# ; i)r   Nc                      R # r   r    r*  s   *r   bad_normalize0AST_Tests.test_issue31592.<locals>.bad_normalizei  s    r   	normalizeu   ϕ)unicodedatar   	swap_attrrg   rj   r'   r(   )r8   r  r  s   &  r   test_issue31592AST_Tests.test_issue31592d  sG     		{KGGiH= HGGGs   &AA)	c                "   \         P                  ! R 4      pVP                  ^ ,          P                  pVP                  pVP                  pV P                  VP                  ^ 4       V P                  VP                  ^4       V P                  VP                  ^ 4       V P                  VP                  ^4       V P                  VP                  ^ 4       V P                  VP                  ^4       \         P                  ! R4      pVP                  ^ ,          P                  pVP                  pVP                  pV P                  VP                  ^ 4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^ 4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^ 4       V P                  VP                  ^4       V P                  VP                  ^4       V P                  VP                  ^4       R# )z4+5+6+7z
4+5-\
 6-7N)
r'   r(   r   r_   rV  rZ   rV   r   rU   r   )r8   r   parent_binopchild_binopgrandchild_binops   &    r    test_issue18374_binop_col_offset*AST_Tests.test_issue18374_binop_col_offsetn  s   yy#yy|))"''&++00!444a8//333Q7)44a8)88!<yy(yy|))"''&++00!4,,a044a800!4//3++Q/33Q7//3)44a8)00!4)88!<)44a8r   c                    \         P                  ! R 4      pVP                  ^ ,          P                  ^ ,          P                  pV P                  VP                  ^4       R# )z@a.b.c
def f(): passN)r'   r(   r   rP   r_   rZ   r   )r8   r   attr_bs   &  r   *test_issue39579_dotted_name_end_col_offset4AST_Tests.test_issue39579_dotted_name_end_col_offset  sE    yy011,,Q/55..2r   c                   V P                  \        P                  P                  R 4       V P                  \        P                  P                  R4       V P                  \        P
                  P                  R4       V P                  \        P                  P                  R4       \        P                  P                  4        Uu. uF  pRVP                   2NK  	  ppR\        P                  P                  4       ^ ,          P                   2V^ &   V P                  \        P                  P                  P                  R4      V4       R# u upi )z0withitem(expr context_expr, expr? optional_vars)GtEz%Name(identifier id, expr_context ctx)zBcmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotInz     | zexpr = r%   N)rZ   r'   withitem__doc__r  r   cmpoprR   __subclasses__assertCountEqualsplit)r8   rL   expressionss   &  r   test_ast_asdl_signature!AST_Tests.test_ast_asdl_signature  s    --/ab%0))+RS**,pq<?HH<S<S<UV<UD/<UV"388#:#:#<Q#?#G#G"HIAchh..44T:KH Ws   	Ec                v   V P                  \        P                  ! \        P                  ! R 4      \        P                  ! R 4      4      4       V P	                  \        P                  ! \        P                  ! R 4      \        P                  ! R4      4      4       V P	                  \        P                  ! \        P                  ! R 4      \        P                  ! R4      4      4       V P	                  \        P                  ! \        P                  ! R4      \        P                  ! R4      4      4       R# )zx = 10 rl   zx = 10;y = 20zclass C:passN)rM  r'   comparer(   rN  r7   s   &r   test_compare_basicsAST_Tests.test_compare_basics  s    CIIh$789LMNSYYx%8#))B-HISYYx%8#))C.IJKK		/2CIIn4MN	
r   c                   \         P                  ! R RR7      p\         P                  ! R RR7      pV P                  \         P                  ! W4      4       VP                  R,           Vn        RVn        V P                  VP                  VP                  4       V P                  \         P                  ! W4      4       V P                  \         P                  ! W!4      4       VP                  Vn        VP
                  Vn        V P                  \         P                  ! W4      4       V P                  \         P                  ! W!4      4       VP                  R	,           Vn        RVn	        V P                  VP                  VP                  4       V P                  \         P                  ! WRR7      4       V P                  \         P                  ! W!RR7      4       VP                  Vn        VP                  Vn	        V P                  \         P                  ! WRR7      4       V P                  \         P                  ! W!RR7      4       R# )
z	m * x + br   modeSpameggsTcompare_attributesN)rC  )r  )
r'   r(   rM  r  rQ   rC  assertNotEqualrN  _attributesr  r8   r   bs   &  r   test_compare_modified_ast#AST_Tests.test_compare_modified_ast  s{    IIk/IIk/A)*II	)	AIIqyy1Q*+Q*+II	A)*A)*	1AMM1==9QdCDQdCDATBCATBCr   c                    R^R^RR^ R\        4       \        4       RRRRR3p\        VR	R ^4       F  w  r#W,          pV P                  W4R
7      ;_uu_ 4        V P	                  \
        P                  ! \
        P                  ! V4      \
        P                  ! V4      4      4       V P                  \
        P                  ! \
        P                  ! V4      \
        P                  ! V4      4      4       R	R	R	4       K  	  0 Rm0 Rm.pV Fj  pV Fa  pWg0,
           FQ  pV P                  \
        P                  ! \
        P                  ! V4      \
        P                  ! V4      4      4       KS  	  Kc  	  Kl  	  R	#   + '       g   i     EK\  ; i)   g      4@g      ?TFABCDabcdu	   中文字g      N)literalnext_literalig      r   >   r   >   r   )	rw  r  	enumerater   rM  r'   r  r   rN  )	r8   	constants
next_indexconstantnext_constantsame_looking_literal_casessame_looking_literalsr  same_looking_literals	   &        r   test_compare_literalsAST_Tests.test_compare_literals  sU   KG
	" %.ina$@ J%1MhKKKKX 6X8NO   KKX.]0K	 LK %A ##&
" &@!0,AI,M,M($$LL1LL)=> -N 1 &@ LKKs   BE;;Fc                   V P                  \        P                  ! \        P                  ! 4       \        P                  ! 4       4      4       V P	                  \        P                  ! \        P
                  ! 4       \        P                  ! 4       4      4       \        P                  ! R 4      \        P                  ! R 4      r!V P                  \        P                  ! W4      4       V P                  \        P                  ! W4      4       V=V P	                  \        P                  ! W4      4       V=V P                  \        P                  ! W4      4       R# )r   N)rM  r'   r  r\  rN  rc  r   r   r8   a1a2s   &  r   test_compare_fieldless AST_Tests.test_compare_fieldless  s    CGGIswwy9:SWWY	:; #BB+,B+,ER,-EB+,r   c           
     Z   R \         3R\        3R\        33 F  w  rV F  p\        P                  ! W1R7      p\        P                  ! W1R7      pV P                  \        P                  ! WE4      \        P                  ! V4       R\        P                  ! V4       24       K  	  K  	  R# )r   r   r   r  z != N)r   r   r   r'   r(   rM  r  dump)r8   r  sourcessourcer   r  s   &     r   test_compare_modesAST_Tests.test_compare_modes  s    Z Z |$
MD
 "IIf0IIf0KK%#((1+d388A;-'H "
r   c                   R  pV! RR4      w  r#V P                  \        P                  ! W#4      4       V P                  \        P                  ! W#RR7      4       V P                  \        P                  ! W#RR7      4       R# )c                 Z    \         P                  ! V 4      \         P                  ! V4      3# r   r'   r(   r   r  s   &&r   r(   7AST_Tests.test_compare_attributes_option.<locals>.parse  s    99Q<1--r   z2 + 2z2+2Fr  TN)rM  r'   r  rN  )r8   r(   r   r  s   &   r   test_compare_attributes_option(AST_Tests.test_compare_attributes_option  s\    	. We$A)*AUCDQdCDr   c                   \         P                  ! R ^R7      \         P                  ! R ^R7      r!V P                  \         P                  ! W4      4       V P                  \         P                  ! WRR7      4       V=V P                  \         P                  ! WRR7      4       V=V P                  \         P                  ! WRR7      4       R# )r   r8  Tr  N)r'   r   rM  r  rU   rN  r  s   &  r   0test_compare_attributes_option_missing_attribute:AST_Tests.test_compare_attributes_option_missing_attribute  s    #a(#((3q*ABB+,BtDEIREFIBtDEr   c                P   \         P                  ! R RR7       \         P                  ! RRR7       V P                  \        4      ;_uu_ 4        \         P                  ! R RR7       RRR4       V P                  \        4      ;_uu_ 4        \         P                  ! RRR7       RRR4       \         P                  ! RRR7       \         P                  ! RRR7       V P                  \        4      ;_uu_ 4        \         P                  ! RRR7       RRR4       V P                  \        4      ;_uu_ 4        \         P                  ! RRR7       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lv; i  + '       g   i     R# ; i)zdef foo(x, /): ...feature_versionzdef bar(x=1, /): ...Nzlambda x, /: ...zlambda x=1, /: ...      r     r'   r(   rg   SyntaxErrorr7   s   &r   $test_positional_only_feature_version.AST_Tests.test_positional_only_feature_version  s    		&?		(&A{++II*FC ,{++II,fE , 			$f=		&?{++II(&A ,{++II*FC ,+ ,+++
 ,++++s0   EE.:F8FE+	.E>	F	F%	c                    \         P                  ! R RR7       V P                  \        4      ;_uu_ 4        \         P                  ! R RR7       RRR4       R#   + '       g   i     R# ; i)z(x := 0)r  Nr  r  r  r7   s   &r   *test_assignment_expression_feature_version4AST_Tests.test_assignment_expression_feature_version)  s>    		*f5{++IIj&9 ,+++s   AA*	c                    R p\         P                  ! VRR7       V P                  \        4      ;_uu_ 4        \         P                  ! VRR7       RRR4       R#   + '       g   i     R# ; i)zt""r  Nr     r     r  r8   r   s   & r   test_pep750_tstringAST_Tests.test_pep750_tstring.  sC    		$0{++IIdG4 ,+++s   AA,	c                   \         P                  ! R 4      p\        P                  ! VRR7       V P	                  \
        4      ;_uu_ 4        \        P                  ! VRR7       RRR4       R#   + '       g   i     R# ; i)zl
            try:
                ...
            except ValueError, TypeError:
                ...
        r  Nr  r  r   r   r'   r(   rg   r  r  s   & r   !test_pep758_except_without_parens+AST_Tests.test_pep758_except_without_parens4  S        			$0{++IIdG4 ,+++   A//B 	c           	     B   \         P                  ! R 4      p\         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      pVVVVVV3 Fz  pR Fq  pTP                  V'       d   RMR4      pV P                  WxR7      ;_uu_ 4        \        P
                  ! VRR	7       \        P
                  ! VRR	7       R
R
R
4       Ks  	  K|  	  R
#   + '       g   i     K  ; i)zc
            try:
                ...
            except{0} TypeError:
                ...
        zj
            try:
                ...
            except{0} TypeError as exc:
                ...
        zf
            try:
                ...
            except{0} (TypeError,):
                ...
        zm
            try:
                ...
            except{0} (TypeError,) as exc:
                ...
        ze
            try:
                ...
            except{0} (TypeError):
                ...
        zl
            try:
                ...
            except{0} (TypeError) as exc:
                ...
        r  r  )r   starr  N)TFr  r  )r   r   r   r   r'   r(   )	r8   single_exprsingle_expr_with_assingle_tuple_exprsingle_tuple_expr_with_assingle_parens_exprsingle_parens_expr_with_asr   r  s	   &        r   #test_pep758_except_with_single_expr-AST_Tests.test_pep758_except_with_single_expr?  s   oo '  'oo /  %OO -  %-OO 5 %! &__ .  &.__ 6 &" %&
D &{{$3B7\\t\77IIdG<IIdG< 87 &
 877s   
1D	Dc                   \         P                  ! R 4      p\        P                  ! VRR7       V P	                  \
        4      ;_uu_ 4        \        P                  ! VRR7       RRR4       R#   + '       g   i     R# ; i)zm
            try:
                ...
            except* ValueError, TypeError:
                ...
        r  Nr  r  r  r  s   & r   &test_pep758_except_star_without_parens0AST_Tests.test_pep758_except_star_without_parensx  r  r  c                6    \         P                  ! R RR7       R# )zwith (x() if y else z()): ...r  Nr  r  r7   s   &r   @test_conditional_context_managers_parse_with_low_feature_versionJAST_Tests.test_conditional_context_managers_parse_with_low_feature_version  s    		16Jr   c                    \        R 4      p\        P                  ! V4       V P                  \        4      ;_uu_ 4        \        P                  ! VRR7       RRR4       R#   + '       g   i     R# ; i)z9
        try: ...
        except* Exception: ...
        r  N)r  r   )r   r'   r(   rg   r  r  s   & r   %test_exception_groups_feature_version/AST_Tests.test_exception_groups_feature_version  sL       			${++IIdG4 ,+++s   A""A3	c           
     Z   . ROpV Fy  pV P                  V4      ;_uu_ 4        \        P                  ! V4       V P                  \        4      ;_uu_ 4        \        P                  ! VRR7       RRR4       RRR4       K{  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)type X = intr  N)r
  zclass X[T]: passzdef f[T](): pass)r     r   r'   r(   rg   r  r8   samplessamples   &  r    test_type_params_feature_version*AST_Tests.test_type_params_feature_version  q    

 Ff%%		&!&&{33IIfg> 4 &%  43 &%%#   4BB0BBBB*c           
     Z   . ROpV Fy  pV P                  V4      ;_uu_ 4        \        P                  ! V4       V P                  \        4      ;_uu_ 4        \        P                  ! VRR7       RRR4       RRR4       K{  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)type X[*Ts=int] = intr  N)r  zclass X[T=int]: passzdef f[**P=int](): pass)r     r  r  s   &  r   (test_type_params_default_feature_version2AST_Tests.test_type_params_default_feature_version  r  r  c                L   V P                  \        4      ;_uu_ 4        \        P                  ! R RR7       RRR4       V P                  \        4      ;_uu_ 4        \        P                  ! R RR7       RRR4       R#   + '       g   i     LP; i  + '       g   i     R# ; i)passr  N)r   r  )   r   )rg   r   r'   r(   r7   s   &r   "test_invalid_major_feature_version,AST_Tests.test_invalid_major_feature_version  s`    z**IIff5 +z**IIff5 +* +****s   A?B?B	B#	c                X   R F  p\         P                  ! \         P                  ! V\         P                  ! 4       4      4      p\         P                  ! V4       V P                  \        RV R24      ;_uu_ 4        \        VRR4       RRR4       K  	  R#   + '       g   i     K  ; i)True"identifier field can't represent '
' constantr   r   N)r  FalseNone)r'   rx  r   rq  rr  rv   r   r   )r8   r  rR   s   &  r   test_constant_as_nameAST_Tests.test_constant_as_name  s{    /H>>#((8SXXZ"@AD%%d+''
6XYaXbbl4mnnh/ on 0 onns   <BB)c                    . ROpV FT  pV P                  \        RV^ ,           R24      ;_uu_ 4        \        P                  ! V^,          RR7       RRR4       KV  	  R#   + '       g   i     Kk  ; i)r  r   r!  r   r  N))r  s   Truᵉ)r"  s   Falſe)r#  s   Nºne)rv   r   r'   r(   )r8   r  r  s   &  r   test_constant_as_unicode_name'AST_Tests.test_constant_as_unicode_name  sm    
	
 "H''
4Xa[MLN N		(1+F3N N "N N Ns    A!!A2c                     ! R  R\         P                  4      p\         P                  ! V\        P                  4       R# )c                     a  ] tR tRt o ]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       t	]P
                  ! 4       t
]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       t]t]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       t]P
                  ! 4       tR tRtV tR# )3AST_Tests.test_precedence_enum.<locals>._Precedencei  c                Z     V P                  V ^,           4      #   \         d    T u # i ; ir   )rF  r   r7   s   &r   next8AST_Tests.test_precedence_enum.<locals>._Precedence.next  s.     >>$(33!  K s    **r    N)r;   r<   r=   r>   r2   auto
NAMED_EXPRTUPLEYIELDTESTORANDNOTCMPEXPRBORBXORBANDSHIFTARITHTERMFACTORPOWERAWAITATOMr.  r@   rA   rB   s   @r   _Precedencer+    s     JIIKEIIKE99;DB))+C))+C))+C99;DC99;D99;DIIKEIIKE99;DYY[FIIKEIIKE99;D   r   rD  N)r2   IntEnum_test_simple_enum_ast_unparserD  )r8   rD  s   & r   test_precedence_enumAST_Tests.test_precedence_enum  s*    	 $,, 	 6 	{L,D,DEr   c                   a aa R o^o\         e"   \         P                  ! 4       p\        SV4      oVV V3R lpV! RR4       V! RR4       V! RR4       V! RR4       R# )i  Nc           	        < WS,          ,           p\         P                  ! V4       WS,          ,           pR P                  WS4      pSP                  \        VR7      ;_uu_ 4        \
        P                  ! 4       ;_uu_ 4        \         P                  ! V4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zCompiling ({!r} + {!r} * {})rw   N)r'   r(   r   rg   RecursionErrorr   infinite_recursion)prefixrepeated	expect_okbrokendetailscrash_depthr8   success_depths   &&   r   check_limit7AST_Tests.test_ast_recursion_limit.<locals>.check_limit  s    M!99IIIi 44F4;;+7G"">w"??//11IIf% 2 @?11 @??s$   'CB.	C.B>9CC	r   ()z.bz[0]z*a)_testinternalcapiget_c_recursion_remainingmin)r8   	remainingrV  rT  rU  s   f  @@r   test_ast_recursion_limit"AST_Tests.test_ast_recursion_limit  s^     ()CCEIy9M		& 	CCCCr   c                    V P                  \        R R7      ;_uu_ 4        \        P                  ! R4       RRR4       R#   + '       g   i     R# ; i)z,source code string cannot contain null bytesrL  za bN)rg   r  r'   r(   r7   s   &r   test_null_bytesAST_Tests.test_null_bytes  sF    {>  @ @IIf@ @ @ @s   AA	c                T   < V ^8  d   QhRS[ S[P                  ,          RS[RS[RR/# )r   rL   attrr  r   N)rI   r'   rG   r   )r   rC   s   "r   r   AST_Tests.__annotate__  s2     0 0d377m 03 0 0PT 0r   c           	     P   V P                  VP                   R V 24      ;_uu_ 4        \        P                  ! V4      p^ p\        P                  ! V4       F+  p\        Wa4      '       g   K  \        WbR4       V^,          pK-  	  V P                  V^4       \        P                  ! RV RVP                   24      pV P                  \        RV R24      ;_uu_ 4        \        VRR4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i).Nzfield 'z' is required for ^$r   r   )r   r;   r'   r(   walkrH   setattrrZ   r1   escaperv   r   r   )r8   rL   rc  r  r   foundra   rz  s   &&&&    r   assert_none_checkAST_Tests.assert_none_check  s    \\T]]O1TF34499V$DE$e**E.QJE ( UA&		GD6);DMM?KLA''
as!H==h/ > 54 >= 544s+   A D.A3D!D	/DDDD%	c                   < V ^8  d   QhRR/# r#   r    )r   rC   s   "r   r   rd  
  s     7 7$ 7r   c           	     B   \         P                  R R3\         P                  RR3\         P                  RR3\         P                  RR3\         P                  RR	3\         P
                  R
R3\         P                  RR3.pV F  w  r#pV P                  W#V4       K  	  R# )rK   zimport spam as SPAMr0  zdef spam(SPAM): spamtargetz[spam for SPAM in spam]iterz[spam for spam in SPAM]r_   zspam(**SPAM)patternzmatch spam:
 case SPAM: spamcontext_exprzwith SPAM: spamN)r'   r   r0  r  keyword
match_caser  rm  )r8   testsrL   rc  r  s   &    r   test_none_checksAST_Tests.test_none_checks
  s    YY 56WWe34*CD(AB[['>2^^Y(GH\\>+<=
 #(D""4v6 #(r   c                   < V ^8  d   QhRR/# r#   r    )r   rC   s   "r   r   rd    s     B B4 Br   c           
     V   \         P                  4       P                  R 4      p\        \	        4       VRR7       FW  w  r#V P                  VR7      ;_uu_ 4        V P                  \        \        P                  ! V4      4      V4       RRR4       KY  	  R#   + '       g   i     Kn  ; i)r%   T)strict)
test_inputN)
r)   	read_textr  r   r!   r   rZ   r&   r'   r(   )r8   	snapshotsr,   snapshots   &   r   	test_reprAST_Tests.test_repr  su    &00288>	!"9";YtTND..  ciio!6A /. U...s   0BB(c           	         R RR,          ,           pV P                  \        R4      ;_uu_ 4        \        \        P                  ! \        V4      R7      4       RRR4       R#   + '       g   i     R# ; i)0x0rz  i'  z Exceeds the limit \(\d+ digits\)r9  N)rv   r   r&   r'   r   r   )r8   r  s   & r   test_repr_large_input_crash%AST_Tests.test_repr_large_input_crash  sX    v%##J$GI IDL12I I I Is   *A##A4	c                <   \         P                  ! R 4      \         P                  ! R4      \         P                  ! R4      .pV F@  pV P                  \        R4      ;_uu_ 4        \        P
                  ! V4       RRR4       KB  	  R#   + '       g   i     KW  ; i)z
                 def f():
                     try:
                         pass
                     finally:
                         return 42
                 z
                 for x in y:
                     try:
                         pass
                     finally:
                         break
                 z
                 for x in y:
                     try:
                         pass
                     finally:
                         continue
                 finallyN)r   r   assertWarnsRegexSyntaxWarningr'   r(   r8   srcssrcs   &  r   test_pep_765_warningsAST_Tests.test_pep_765_warnings$  s}    OO   OO   OO  
. C&&}i@@		# A@ @@@s   %B

Bc                    \         P                  ! R 4      \         P                  ! R4      \         P                  ! R4      .pV F  p\        P                  ! V4       K  	  R# )z
                 try:
                     pass
                 finally:
                     def f():
                         return 42
                 z
                 try:
                     pass
                 finally:
                     for x in y:
                         break
                 z
                 try:
                     pass
                 finally:
                     for x in y:
                         continue
                 N)r   r   r'   r(   r  s   &  r   test_pep_765_no_warnings"AST_Tests.test_pep_765_no_warnings@  sW    OO   OO   OO  
. CIIcN r   c                   \         P                  ! R 4      pV P                  VP                  ^ ,          P                  \         P
                  4       V P                  VP                  ^ ,          P                  P                  ^ ,          \         P                  4       \         P                  ! R4      pV P                  VP                  ^ ,          P                  \         P
                  4       V P                  VP                  ^ ,          P                  P                  ^ ,          \         P                  4       V P                  VP                  ^ ,          P                  P                  ^,          \         P                  4       R# )zt"Hello"zt"Hello {name}"N)	r'   r(   r   r   r_   TemplateStrvaluesr   Interpolationr   s   & r   test_tstringAST_Tests.test_tstring[  s    yy$diil00#//Bdiil0077:CLLI yy*+diil00#//Bdiil0077:CLLIdiil0077:C<M<MNr   r    )Mr;   r<   r=   r>   maxDiffrM   rY   rm   rx   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r2  r5  r=  rP  rS  r`  rd  rn  rs  r{  r  r   r?   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r$  r'  rH  r	   r   r]  r`  rm  rx  r  r  r  r  r  r@   rA   rB   s   @r   rE   rE   9   s    G3D&"	!
1./I64*,(@BD9Bv$%'$3L/:&*)+4Z%('
,*\(
;K-F > >9>3
I
D<*X-EFD:
5	57=r	5K5
?
?60	4F< #% &   .
0 07 7B B386
O 
Or   rE   c                   ~   a  ] tR tRt o ]R 4       tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tRtV tR# )	CopyTestsih  c               #  \   a "   V 3R  lo S ! \         P                  4       Rj  xL
  R#  L5i)c              3      <"   V P                   R 8w  d   R# V \        P                  J d   R# V x  V P                  4        F  pS! V4       Rj  xL
  K  	  R#  L
5i)r'   N)r<   r'   r  r  )r$  subdos   & r   r  &CopyTests.iter_ast_classes.<locals>.dor  sL     ~~&ciiI))+c7"" ,"s   AAAAN)r'   rG   )r  s   @r   iter_ast_classesCopyTests.iter_ast_classesk  s     	# cgg;s    ,*,c           
        ^ RI p\        VP                  ^,           4       F  p\         Fx  pV P	                  W2R7      ;_uu_ 4        \        VRRR4      pVP                  VP                  WB4      4      pV P                  \        V4      \        V4      4       RRR4       Kz  	  K  	  R#   + '       g   i     K  ; i)r   N)r   protocolr   r   i   )
pickler1  HIGHEST_PROTOCOLr   r   r   loadsdumpsrZ   r   )r8   r  r  r   r   ast2s   &     r   test_picklingCopyTests.test_pickling~  s    f559:H"\\t\??"4fe<D!<<T(DED$$Xd^Xd^D @? # ;???s   AB,	,B=c           
        R p\         P                  ! \        P                  ! V4      4      p\         P                  ! V4       F&  p\         P
                  ! V4       F	  pW4n        K  	  K(  	   \        P                  ! ^4      ;_uu_ 4        \        P                  ! V4      pRRR4       \         P                  ! V4       F  p\        VR4      '       g   K  V=K  	  \         P                  ! X4       F  p\         P
                  ! T4       F  p\        TR4      '       g   K  \        T\         P                  \         P                  \         P                  \         P                   \         P"                  34      '       d   Kv  T P%                  \'        TP                  4      \'        T4      4       K  	  K  	  R#   + '       g   i     EL!; i  \         P                  ! T4       F  p\        TR4      '       g   K  T=K  	  i ; i)a=  
        ('',)
        while i < n:
            if ch == '':
                ch = format[i]
                if ch == '':
                    if freplace is None:
                        '' % getattr(object)
                elif ch == '':
                    if zreplace is None:
                        if hasattr:
                            offset = object.utcoffset()
                            if offset is not None:
                                if offset.days < 0:
                                    offset = -offset
                                h = divmod(timedelta(hours=0))
                                if u:
                                    zreplace = '' % (sign,)
                                elif s:
                                    zreplace = '' % (sign,)
                                else:
                                    zreplace = '' % (sign,)
                elif ch == '':
                    if Zreplace is None:
                        Zreplace = ''
                        if hasattr(object):
                            s = object.tzname()
                            if s is not None:
                                Zreplace = s.replace('')
                    newformat.append(Zreplace)
                else:
                    push('')
            else:
                push(ch)

        Nparent)r'   r(   r   r   ri  iter_child_nodesr  r   rN  copydeepcopyhasattrrH   expr_contextboolopunaryopr  operatorrZ   r   )r8   r   r   rL   ra   tree2s   &     r   test_copy_with_parents CopyTests.test_copy_with_parents  s[   #H yy./HHTND--d3# 4 #	$++C00d+ 1
 4** ' HHUOD--d35(++Ju$$cjj#++syy#,,G 5 5 $$Xell%;Xd^L	 4 $ 100
 4** 's*   .G F;#G ;G		G )H=Hc           
         V P                  4        F  pV P                  VR 7      ;_uu_ 4        V P                  VR4       RRR4       \        VP                  4      pV P                  WR7      ;_uu_ 4        V! R/ \
        P                  V4      B pV P                  \        \        P                  V^4       V P                  \        VP                  ^4       RRR4       K  	  R#   + '       g   i     L; i  + '       g   i     K  ; i))klass__replace__N)r  fieldsr    )r  r   assertHasAttrsetrQ   rh  fromkeysrg   rj   r  replacer  )r8   r  r  rL   s   &   r   test_replace_interface CopyTests.test_replace_interface  s    **,EE**""5-8 + 'FE995t}}V45!!)T\\4C!!)T-=-=qA	 :9 -** :99s   C)8A#C<)C9<Dc                   V P                  4        EF  p\        VP                  4      p\        VP                  4      pV P	                  WVR 7      ;_uu_ 4        V Uu/ uF  qD\        4       bK  	  ppV Uu/ uF  qf\        4       bK  	  ppV! R/ VB p\        P                  ! V4      p	V P                  \        P                  ! WRR7      4       V! R/ VBVB p\        P                  ! V4      p	V P                  \        P                  ! WRR7      4       V F  p/ V3 F  p
V! R/ VBV
B p\        4       p\        P                  ! V3/ WK/B p	V Fd  pW\,          pV P                  \        W4      V4       W8w  d   V P                  \        W4      V4       KI  V P                  \        W4      V4       Kf  	  V P                  \        P                  ! WRR7      4       K  	  K  	  V F  pV! R/ VBVB p\        4       p\        P                  ! V3/ W/B p	V Fi  pVV,          pV P                  \        VV4      V4       VV8w  d   V P                  \        V	V4      V4       KM  V P                  \        V	V4      V4       Kk  	  V P                  \        P                  ! WRR7      4       K  	  RRR4       EK  	  R# u upi u upi   + '       g   i     EK  ; i))r  r  
attributesTr  Nr    )r  r  rQ   r  r   r"  r  r  rM  r'   r  r  rX   rN  )r8   r  r  r  field
old_fieldsrc  	old_attrsrL   repl
init_attrs	new_valuefrq   	attributenew_attrr   old_attrs   &                 r   test_replace_nativeCopyTests.test_replace_native  sf   **,E'FU../JEZPP <BB6%VXo6
B8BC
68^
	C *z*||D)D4 PQ7z7Y7||D)D4 PQ#E')9o
$@z@Z@$*H	#||DGU4FG!'A(2I MM'$*:IF z $gd.>	 J $gd.>	 J "( ((TTX)YZ '6 $$ ",I ;:;;D%xH<<F0EFD'#,Q<gdA&6A	> MM'$*:HE MM'$*:HE ( $$S[[PT%UV ",C QP	 - CC	 QPPs+   KK
2K8K	
H*K
KK c                    \        4       \        4       r!\        P                  ! WR 7      pV P                  VP                  V4       V P                  VP
                  V4       \        4       p\        P                  ! W4R7      pV P                  VP                  V4       V P                  VP
                  V4       V P                  VP                  V4       V P                  VP
                  VP
                  4       R# )r   ctxr   N)r"  r'   r   r  r   r  r  r  )r8   nidr  rL   new_nidr  s   &     r   &test_replace_accept_known_class_fields0CopyTests.test_replace_accept_known_class_fields  s    8VXSxx3(dggs#dhh$(||D-dggs#dhh$dggw'dhh)r   c                   \         P                  ! R 4      P                  ^ ,          P                  pV P	                  VP
                  R 4       V P	                  VP                  ^4       \        4       p\        P                  ! WR7      pV P	                  VP                  ^4       V P	                  VP
                  VP
                  4       V P	                  VP                  VP                  4       V P	                  VP                  V4       VP                  4       w   rEV P	                  VR,          R 4       V P	                  VR,          VP                  4       V P	                  VR,          ^4       VP                  4       w   rEV P	                  VR,          R 4       V P	                  VR,          VP                  4       V P	                  VR,          V4       R# )rl   r8  r   r  rU   N)r'   r(   r   r_   rZ   r   rU   r"  r  r  r  
__reduce__)r8   rL   rU   r  _states   &     r   *test_replace_accept_known_class_attributes4CopyTests.test_replace_accept_known_class_attributes  sW   yy~""1%++#&a( ||D0a($''*488,f-oo'1tc*utxx0x!,oo'1tc*utxx0x&1r   c                     ! R  R\         P                  4      pR\        4       r2V! W#4      pV P                  VP                  V4       V P                  VP
                  V4       \        P                  ! V4      pV P                  VP                  V4       V P                  VP
                  V4       V P                  VP                  V4       V P                  VP
                  V4       V! W#4      p\        4       p\        P                  ! WFR7      pV P                  VP                  V4       V P                  VP
                  V4       V P                  VP                  VP                  4       V P                  VP
                  V4       R# )c                   *    ] tR tRtRtR]R]/tRtRt	R# )GCopyTests.test_replace_accept_known_custom_class_fields.<locals>.MyNodei/  rK   r   r    N)rK   r   )
r;   r<   r=   r>   rQ   r   r"  r   r[   r@   r    r   r   MyNoder  /  s    &G%sFF;O-Nr   r  rK   )r   N)r'   rG   r"  r  rK   r   r  r  )r8   r  rK   r   rL   r  	repl_datas   &      r   -test_replace_accept_known_custom_class_fields7CopyTests.test_replace_accept_known_custom_class_fields.  s   	.SWW 	.
 VXdd!dii&dii&||D!dii&dii&dii&dii&d!H	||D1dii&dii&dii+dii+r   c                    ! R  R\         P                  4      pV! 4       pV P                  VP                  ^ 4       V P                  VP                  ^4       \        4       p\        P                  ! W#R7      pV P                  VP                  ^ 4       V P                  VP                  ^4       V P                  VP                  ^ 4       V P                  VP                  V4       R# )c                   "    ] tR tRt^ t^tRtRtR# )KCopyTests.test_replace_accept_known_custom_class_attributes.<locals>.MyNodeiN  r    Nrl   r  )r;   r<   r=   r>   rl   r  r  r@   r    r   r   r  r  N  s    AA$Kr   r  )r  N)r'   rG   rZ   rl   r  r"  r  r  )r8   r  rL   r  r  s   &    r   1test_replace_accept_known_custom_class_attributes;CopyTests.test_replace_accept_known_custom_class_attributesM  s    	%SWW 	%
 x##H||D&####r   c                F   \         P                  ! R 4      P                  ^ ,          P                  p\	        4       ;Vn        pVP                  pV P                  VP                  R 4       V P                  VP                  V4       V P                  VP
                  V4       \        P                  ! V4      pV P                  VP                  R 4       V P                  VP                  V4       V P                  VP
                  V4       V P                  VP                  R 4       V P                  VP                  V4       V P                  \        \        VR4       \        P                  ! VRR7      pV P                  VP                  R 4       V P                  VP                  V4       V P                  VP
                  V4       V P                  VP                  R4       V P                  VP                  V4       V P                  \        \        VR4       R# )rl   extrar  r  N)r'   r(   r   r_   r"  r  r  r  r   r  r  rg   rh   rX   )r8   rL   r  contextr  s   &    r   0test_replace_ignore_known_custom_instance_fields:CopyTests.test_replace_ignore_known_custom_instance_fields`  sk   yy~""1%++#X%
U(( 	dggs#dhh(djj%(||D!dggs#dhh(djj%(dggs#dhh(.'4A ||DS)dggs#dhh(djj%(dggs#dhh(.'4Ar   c                0   \         P                  ! R 4      P                  ^ ,          P                  pVP                  pV=V P                  \        \        VR4       V P                  VP                  V4       RpV P                  \        \        P                  ! V4      4      ;_uu_ 4        \        P                  ! V4       RRR4       V P                  \        \        VR4       V P                  VP                  V4       \         P                  ! R 4      P                  ^ ,          P                  pVP                  pV=V P                  \        \        VR4       V P                  VP                  V4       \        P                  ! VRR7      pV P                  \        \        VR4       V P                  VP                  V4       V P                  VP
                  R4       V P                  VP                  V4       R#   + '       g   i     ELJ; i)rl   r   z2Name.__replace__ missing 1 keyword argument: 'id'.Nr  r  )r'   r(   r   r_   r  r   rg   rh   rX   r  rv   rj   r1   rk  r  r  )r8   rL   r  rw   r  s   &    r   !test_replace_reject_missing_field+CopyTests.test_replace_reject_missing_field  sg   yy~""1%++((G.'4>dhh(B##Iryy~>>LL ? 	.'4>dhh( yy~""1%++((G.'4>dhh(||DS).'4>dhh(dggs#dhh(% ?>>s   ,HH	c                   \         P                  ! R \         P                  ! 4       R7      pV P                  VP                  R4       V P                  VP                  . 4       \        P                  ! VRR7      pV P                  VP                  R4       V P                  VP                  R4       V P                  VP                  . 4       R# )r
  rK   r*  Nr	  rK   )
r'   FunctionDefr/  r  returnsrZ   rP   r  r  rK   )r8   rL   node2s   &  r   .test_replace_accept_missing_field_with_default8CopyTests.test_replace_accept_missing_field_with_default  s    E@dllD),,b1T.U+emmT*--r2r   c                >   \         P                  ! R 4      P                  ^ ,          P                  p\	        4       ;Vn        pVP                  pV P                  VR4       RpV P                  \        \        P                  ! V4      4      ;_uu_ 4        \        P                  ! V^R7       RRR4       V P                  VP                  R 4       V P                  VP                  V4       V P                  VP
                  V4       R#   + '       g   i     Lf; i)rl   r  z<Name.__replace__ got an unexpected keyword argument 'extra'.)r  N)r'   r(   r   r_   r"  r  r  r  rv   rj   r1   rk  r  r  r  r   )r8   rL   r  r  rw   s   &    r   8test_replace_reject_known_custom_instance_fields_commitsBCopyTests.test_replace_reject_known_custom_instance_fields_commits  s    yy~""1%++#X%
U(( 	4)L##Iryy~>>LLQ' ? 	dggs#dhh(djj%( ?>s   DD	c                0   \         P                  ! R 4      P                  ^ ,          P                  pVP                  pV P                  \        \        VR4       RpV P                  \        \        P                  ! V4      4      ;_uu_ 4        \        P                  ! V^R7       RRR4       V P                  VP                  R 4       V P                  VP                  V4       V P                  \        \        VR4       R#   + '       g   i     Lf; i)rl   unknownz>Name.__replace__ got an unexpected keyword argument 'unknown'.)r   N)r'   r(   r   r_   r  rg   rh   rX   rv   rj   r1   rk  r  r  r  r   )r8   rL   r  rw   s   &   r   +test_replace_reject_unknown_instance_fields5CopyTests.test_replace_reject_unknown_instance_fields  s    yy~""1%++(( 	.'4CN##Iryy~>>LLq) ? 	dggs#dhh(.'4C ?>s   DD	r    N)r;   r<   r=   r>   staticmethodr  r  r  r  r  r  r  r  r  r  r  r  r  r  r@   rA   rB   s   @r   r  r  h  sh       $E9Mv
B4Wl* 22,>$&B>):3)D Dr   r  c                      a  ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t] ! 4       R 4       t!] ! 4       R 4       t"R t#V t$R# )!ASTHelpers_Testi  Nc                    \         P                  ! R 4      p\        R RR\         P                  4      pV P	                  \         P
                  ! V4      \         P
                  ! V4      4       R# )z
foo(1 + 1)z	<unknown>r   N)r'   r(   r   r   rZ   r  r  s   &  r   
test_parseASTHelpers_Test.test_parse  sF    IIl#L+vs7H7HI!chhqk2r   c                (    ^^ ,           R#   \          dz    T P                  \        4      ;_uu_ 4       p\        P                  ! R4       RRR4       M  + '       g   i     M; iT P                  XP                  P                  4        R# i ; i)r   z'\U'N)	Exceptionrg   r  r'   literal_evalassertIsNotNonerj  __context__r8   rz  s   & r   test_parse_in_error#ASTHelpers_Test.test_parse_in_error  sg    	:aCC 	:"";//1  ) 0///  !8!89	:s&   	 (BA	BA% -BBc                   \         P                  ! R 4      pV P                  \         P                  ! V4      R4       V P                  \         P                  ! VRR7      R4       V P                  \         P                  ! VRR7      R4       R# )	spam(eggs, "and cheese")Module(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), args=[Name(id='eggs', ctx=Load()), Constant(value='and cheese')]))])Fannotate_fieldszZModule([Expr(Call(Name('spam', Load()), [Name('eggs', Load()), Constant('and cheese')]))])Tinclude_attributesa  Module(body=[Expr(value=Call(func=Name(id='spam', ctx=Load(), lineno=1, col_offset=0, end_lineno=1, end_col_offset=4), args=[Name(id='eggs', ctx=Load(), lineno=1, col_offset=5, end_lineno=1, end_col_offset=9), Constant(value='and cheese', lineno=1, col_offset=11, end_lineno=1, end_col_offset=23)], lineno=1, col_offset=0, end_lineno=1, end_col_offset=24), lineno=1, col_offset=0, end_lineno=1, end_col_offset=24)])Nr'   r(   rZ   r  r8   rL   s   & r   	test_dumpASTHelpers_Test.test_dump  st    yy34$S	
 	$>*	
 	$4@I	
r   c                &   \         P                  ! R 4      pV P                  \         P                  ! V^R7      R4       V P                  \         P                  ! VRRR7      R4       V P                  \         P                  ! VR^R7      R	4       R
# )r  indentzModule(
   body=[
      Expr(
         value=Call(
            func=Name(id='spam', ctx=Load()),
            args=[
               Name(id='eggs', ctx=Load()),
               Constant(value='and cheese')]))])F	)r  r  zwModule(
	[
		Expr(
			Call(
				Name('spam', Load()),
				[
					Name('eggs', Load()),
					Constant('and cheese')]))])T)r  r  ac  Module(
   body=[
      Expr(
         value=Call(
            func=Name(
               id='spam',
               ctx=Load(),
               lineno=1,
               col_offset=0,
               end_lineno=1,
               end_col_offset=4),
            args=[
               Name(
                  id='eggs',
                  ctx=Load(),
                  lineno=1,
                  col_offset=5,
                  end_lineno=1,
                  end_col_offset=9),
               Constant(
                  value='and cheese',
                  lineno=1,
                  col_offset=11,
                  end_lineno=1,
                  end_col_offset=23)],
            lineno=1,
            col_offset=0,
            end_lineno=1,
            end_col_offset=24),
         lineno=1,
         col_offset=0,
         end_lineno=1,
         end_col_offset=24)])Nr  r  s   & r   test_dump_indent ASTHelpers_Test.test_dump_indent  s{    yy34$q1 44 	5 	$dK N) 	* 	$4J !M! !	"r   c                   \         P                  ! ^^R7      pV P                  \         P                  ! V4      R4       V P                  \         P                  ! VRR7      R4       \         P                  ! \         P                  ! R\         P
                  ! 4       R7      ^^R7      pV P                  \         P                  ! V4      R	4       V P                  \         P                  ! VR
R7      R4       V P                  \         P                  ! VRR7      R4       V P                  \         P                  ! VR
RR7      R4       \         P                  ! \         P                  ! R\         P
                  ! 4       R7      R7      pV P                  \         P                  ! V4      R4       V P                  \         P                  ! VR
R7      R4       \         P                  ! \         P                  ! R4      .R7      pV P                  \         P                  ! VR
R7      R4       \         P                  ! \         P                  ! R4      .R7      pV P                  \         P                  ! VR
R7      R4       \         P                  ! \         P                  ! R4      .\         P                  ! R4      .R7      pV P                  \         P                  ! VR
R7      R4       \         P                  ! \         P                  ! R4      .\         P                  ! R4      .R7      pV P                  \         P                  ! VR
R7      R4       \         P                  ! 4       pV P                  \         P                  ! VR
R7      R4       \         P                  ! R. \         P                  ! R\         P                  ! R 4      4      .. \         P                  ! R!\         P
                  ! 4       R"7      .4      pV P                  \         P                  ! V4      R#4       V P                  \         P                  ! VR
R7      R$4       R # )%r  rg  zRaise()Tr  zRaise(lineno=3, col_offset=4)rz  r  )excrU   rV   z#Raise(exc=Name(id='e', ctx=Load()))Fr  zRaise(Name('e', Load()))z;Raise(exc=Name(id='e', ctx=Load()), lineno=3, col_offset=4))r  r  z0Raise(Name('e', Load()), lineno=3, col_offset=4))causez%Raise(cause=Name(id='e', ctx=Load()))zRaise(cause=Name('e', Load()))rl   r  zarguments([], [arg('x')])r)  zarguments([arg('x')])r  )r)  r+  z,arguments([arg('x')], kwonlyargs=[arg('y')]))r*  r+  z0arguments([], [arg('x')], kwonlyargs=[arg('y')])arguments()Tr   N	dataclassr  z~ClassDef(name='T', keywords=[keyword(arg='a', value=Constant(value=None))], decorator_list=[Name(id='dataclass', ctx=Load())])zRClassDef('T', [], [keyword('a', Constant(None))], [], [Name('dataclass', Load())]))r'   RaiserZ   r  r   rq  r/  r0  ClassDefru  r   r  s   & r   test_dump_incomplete$ASTHelpers_Test.test_dump_incomplete  s   yya0$	
 	$4@+	
 yySXX#((*=aTUV$1	
 	$>&	
 	$4@I	
 	$RVW>	
 yysxx3CHHJ?@$3	
 	$>,	
 }}3773<.1$>'	
 }}#''#,8$>#	
 }}#''#,SWWS\NS$>:	
 }}3773<.cggcl^L$>>	
 }}$>	
 ||[[cll4012XXksxxz23
 	$ M	
 	$>`	
r   c                N  a a V 3R  loV3R lpS! \         P                  ! 4       RRR7       S! \         P                  ! R\         P                  ! 4       R7      RRR7       S! \         P                  ! RR	7      R
R
R7       S! \         P                  ! . R	7      RRR7       S! \         P
                  ! RR	7      RRR7       S! \         P
                  ! . R	7      RRR7       S! \         P
                  ! RR	7      RRR7       S! \         P                  ! \         P
                  ! ^*4      RR"R7      RRR7       S! \         P                  ! \         P
                  ! ^*4      . R"R7      RRR7       V! RRRR7       V! RRRRR7       V! RRRR7       V! RRRR7       V! RR R!R7       R# )#c           	        < SP                  R R7      ;_uu_ 4        SP                  \        P                  ! V 3RR /VB V4       RRR4       SP                  RR7      ;_uu_ 4        SP                  \        P                  ! V 3RR/VB V4       RRR4       R#   + '       g   i     L^; i  + '       g   i     R# ; i)F)
show_emptyr0  NT)r   rZ   r'   r  )rL   emptyfullr%  r8   s   &&&,r   
check_node8ASTHelpers_Test.test_dump_show_empty.<locals>.check_node^  s    //  HHT>e>v> 0
 ..  HHT=d=f= /. 0/
 /..s   *B(*B/B,	/C 	c                 D   < S! \         P                  ! V 4      W3/ VB  R # r   r  )r   r1  r2  r%  r3  s   &&&,r   
check_text8ASTHelpers_Test.test_dump_show_empty.<locals>.check_textj  s    syy>v>r   r&  zNarguments(posonlyargs=[], args=[], kwonlyargs=[], kw_defaults=[], defaults=[]))r1  r2  r  r  zName(id='', ctx=Load())Nr9  zMatchSingleton(value=None)zMatchSingleton(value=[])zConstant(value=None)zConstant(value=[])zConstant(value=''))r_   r   
conversionz@Interpolation(value=Constant(value=42), str=None, conversion=-1)z>Interpolation(value=Constant(value=42), str=[], conversion=-1)zdef a(b: int = 0, *, c): ...zModule(body=[FunctionDef(name='a', args=arguments(args=[arg(arg='b', annotation=Name(id='int', ctx=Load()))], kwonlyargs=[arg(arg='c')], kw_defaults=[None], defaults=[Constant(value=0)]), body=[Expr(value=Constant(value=Ellipsis))])])a.  Module(body=[FunctionDef(name='a', args=arguments(posonlyargs=[], args=[arg(arg='b', annotation=Name(id='int', ctx=Load()))], kwonlyargs=[arg(arg='c')], kw_defaults=[None], defaults=[Constant(value=0)]), body=[Expr(value=Constant(value=Ellipsis))], decorator_list=[], type_params=[])], type_ignores=[])a}  Module(body=[FunctionDef(name='a', args=arguments(args=[arg(arg='b', annotation=Name(id='int', ctx=Load(), lineno=1, col_offset=9, end_lineno=1, end_col_offset=12), lineno=1, col_offset=6, end_lineno=1, end_col_offset=12)], kwonlyargs=[arg(arg='c', lineno=1, col_offset=21, end_lineno=1, end_col_offset=22)], kw_defaults=[None], defaults=[Constant(value=0, lineno=1, col_offset=15, end_lineno=1, end_col_offset=16)]), body=[Expr(value=Constant(value=Ellipsis, lineno=1, col_offset=25, end_lineno=1, end_col_offset=28), lineno=1, col_offset=25, end_lineno=1, end_col_offset=28)], lineno=1, col_offset=0, end_lineno=1, end_col_offset=28)])a  Module(body=[FunctionDef(name='a', args=arguments(posonlyargs=[], args=[arg(arg='b', annotation=Name(id='int', ctx=Load(), lineno=1, col_offset=9, end_lineno=1, end_col_offset=12), lineno=1, col_offset=6, end_lineno=1, end_col_offset=12)], kwonlyargs=[arg(arg='c', lineno=1, col_offset=21, end_lineno=1, end_col_offset=22)], kw_defaults=[None], defaults=[Constant(value=0, lineno=1, col_offset=15, end_lineno=1, end_col_offset=16)]), body=[Expr(value=Constant(value=Ellipsis, lineno=1, col_offset=25, end_lineno=1, end_col_offset=28), lineno=1, col_offset=25, end_lineno=1, end_col_offset=28)], decorator_list=[], type_params=[], lineno=1, col_offset=0, end_lineno=1, end_col_offset=28)], type_ignores=[])T)r1  r2  r  r  r  zModule(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), args=[Name(id='eggs', ctx=Load()), Constant(value='and cheese')], keywords=[]))], type_ignores=[])zspam(eggs, text="and cheese")zModule(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), args=[Name(id='eggs', ctx=Load())], keywords=[keyword(arg='text', value=Constant(value='and cheese'))]))])zModule(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), args=[Name(id='eggs', ctx=Load())], keywords=[keyword(arg='text', value=Constant(value='and cheese'))]))], type_ignores=[])z*import _ast as ast; from module import subzModule(body=[Import(names=[alias(name='_ast', asname='ast')]), ImportFrom(module='module', names=[alias(name='sub')], level=0)])zModule(body=[Import(names=[alias(name='_ast', asname='ast')]), ImportFrom(module='module', names=[alias(name='sub')], level=0)], type_ignores=[])r   )r'   r/  r   rq  MatchSingletonr   r  )r8   r6  r3  s   f @r   test_dump_show_empty$ASTHelpers_Test.test_dump_show_empty]  s   
		? 	MMOa	
 	HH
++*		
 	T*.-	
 	R(,+	
 	LLt$('	
 	LLr"&%	
 	LLr"&%	
 	CLL$4$2NTS	
 	CLL$4"LRQ	
 	*  B	
 	* R
 U#		
 	& X u	
 	+ ~ N	
 	8 U e	
r   c           	        \         P                  ! R RR7      p\         P                  ! \         P                  ! ^4      VP                  P
                  4      VP                  n        V P                  \         P                  ! VRR7      R4       \         P                  ! R\         P                  ! 4       4      p\         P                  ! ^^^^VR7      p\         P                  ! V\         P                  ! RRVR	7      4      pV P                  VP                  4       V P                  VP                  4       V P                  VP                  ^4       V P                  VP                  ^4       R# )
1 + 1r   r  Tr  zExpression(body=BinOp(left=Constant(value=1, lineno=1, col_offset=0, end_lineno=1, end_col_offset=1), op=Add(), right=Constant(value=2, lineno=1, col_offset=4, end_lineno=1, end_col_offset=5), lineno=1, col_offset=0, end_lineno=1, end_col_offset=5))rC  )rV   rU   r   r   funcN)rV   rU   r>  )r'   r(   copy_locationr   r   rX  rZ   r  r   rq  Callr   r   r   rU   rV   )r8   r  r>  news   &   r   test_copy_location"ASTHelpers_Test.test_copy_location  s    iif-**3<<?CHHNNK#$?=	
 xx
+hh!A!ATXYSXXdQU%VW#..)#,,-Q'+r   c                   \         P                  ! R 4      pVP                  P                  \         P                  ! \         P
                  ! \         P                  ! R\         P                  ! 4       4      \         P                  ! R4      .. 4      4      4       V P                  V\         P                  ! V4      4       RV n        V P                  \         P                  ! VRR7      R4       R# )zwrite("spam")rC  r  NTr  aw  Module(body=[Expr(value=Call(func=Name(id='write', ctx=Load(), lineno=1, col_offset=0, end_lineno=1, end_col_offset=5), args=[Constant(value='spam', lineno=1, col_offset=6, end_lineno=1, end_col_offset=12)], lineno=1, col_offset=0, end_lineno=1, end_col_offset=13), lineno=1, col_offset=0, end_lineno=1, end_col_offset=13), Expr(value=Call(func=Name(id='spam', ctx=Load(), lineno=1, col_offset=0, end_lineno=1, end_col_offset=0), args=[Constant(value='eggs', lineno=1, col_offset=0, end_lineno=1, end_col_offset=0)], lineno=1, col_offset=0, end_lineno=1, end_col_offset=0), lineno=1, col_offset=0, end_lineno=1, end_col_offset=0)]))r'   r(   r   appendr   r@  r   rq  r   rZ   rr  r  r  r8   r  s   & r   test_fix_missing_locations*ASTHelpers_Test.test_fix_missing_locations  s    ii(#((6388:*F+.<<+?*@""F G 	Hc77<=#$?	[	
r   c                   \         P                  ! R RR7      pV P                  \         P                  ! V^R7      V4       V P                  \         P                  ! VRR7      R4       \         P                  ! R RR7      pV P                  \         P                  ! VP
                  ^R7      VP
                  4       V P                  \         P                  ! VRR7      R4       \         P                  ! \         P                  ! R\         P                  ! 4       4      . . ^R7      pV P                  \         P                  ! V4      P                  ^4       V P                  \         P                  ! V4      P                  4       R	# )
r=  r   r  rO  Tr  zExpression(body=BinOp(left=Constant(value=1, lineno=4, col_offset=0, end_lineno=4, end_col_offset=1), op=Add(), right=Constant(value=1, lineno=4, col_offset=4, end_lineno=4, end_col_offset=5), lineno=4, col_offset=0, end_lineno=4, end_col_offset=5))r,   )r>  r*  keywordsrU   N)r'   r(   rZ   increment_linenor  r   r@  r   rq  rU   r   r   rF  s   & r   test_increment_lineno%ASTHelpers_Test.test_increment_lineno  s   iif---cQ7=#$?=	
 iif---chh!<chhG#$?=	
 hh&#((*-BA
 	--c2991=#..s3>>?r   c                   \         P                  ! \        R 4      RR7      p\         P                  ! V^R7       V P	                  VP
                  ^ ,          P                  ^4       V P	                  VP
                  ^,          P                  ^	4       V P	                  VP
                  ^,          P                  R4       R# )zb        a = 1
        b = 2 # type: ignore
        c = 3
        d = 4 # type: ignore@tag
        T)type_commentsrJ  z@tagN)r'   r(   r   rL  rZ   r   rU   tagrF  s   & r   test_increment_lineno_on_module/ASTHelpers_Test.test_increment_lineno_on_module  s    ii   
 !" 	SA&))!,33Q7))!,33Q7))!,00&9r   c                
   \         P                  ! R RR7      p\        \         P                  ! VP                  4      4      pV P                  VP                  R4      P                  R4       V P                  VR. R. /4       R# )foo()r   r  r>  r
  rK  r*  N)r'   r(   rh  iter_fieldsr   rZ   popr   )r8   rL   ds   &  r   test_iter_fields ASTHelpers_Test.test_iter_fields  s`    yyv.+,v))51ZVR89r   c           	     6   \         P                  ! R RR7      pV P                  \        \	        \         P
                  ! VP                  4      4      4      ^4       \         P
                  ! VP                  4      pV P                  \        V4      P                  R4       V P                  \        V4      P                  ^4       V P                  \        V4      P                  ^*4       V P                  \         P                  ! \        V4      4      R4       R# )zspam(23, 42, eggs='leek')r   r  rC  z1keyword(arg='eggs', value=Constant(value='leek'))N)r'   r(   rZ   r   r   r  r   r.  r   r_   r  )r8   rL   iterators   &  r   test_iter_child_nodes%ASTHelpers_Test.test_iter_child_nodes  s    yy46BT#"6"6tyy"ABCQG''		2h**F3h--r2h--r2$x.1?	
r   c                   \         P                  ! R 4      pV P                  \         P                  ! V4      R4       \         P                  ! R4      pV P                  \         P                  ! VP                  ^ ,          4      R4       \         P                  ! R4      pV P                  \         P                  ! VP                  ^ ,          4      R4       \         P                  ! R4      pV P                  \         P                  ! VP                  ^ ,          4      R4       \         P                  ! R4      pV P                  \         P                  ! VP                  ^ ,          RR7      R4       \         P                  ! R	4      pV P                  \        \         P                  VP                  ^ ,          4       R
# )z"""line one
  line two"""zline one
line twoz&class foo:
  """line one
  line two"""z&def foo():
  """line one
  line two"""z#async def foo():
  """spam
  ham"""zspam
hamF)cleanz
spam
  hamrl   N)r'   r(   rZ   get_docstringr   rg   rj   r  s   & r   test_get_docstring"ASTHelpers_Test.test_get_docstring  s2   yy56**40-	/ yyCD**499Q<8-	/ yyCD**499Q<8-	/ yy@A**499Q<8+Fyy@A**499Q<uE}Uyy~)S%6%6		!Er   c                $   V P                  \        P                  ! \        P                  ! R 4      4      4       \        P                  ! R4      pV P                  \        P                  ! V4      4       \        P                  ! R4      pV P                  \        P                  ! V4      4       \        P                  ! R4      pV P                  \        P                  ! VP                  ^ ,          4      4       \        P                  ! R4      pV P                  \        P                  ! VP                  ^ ,          4      4       \        P                  ! R4      pV P                  \        P                  ! VP                  ^ ,          4      4       \        P                  ! R4      pV P                  \        P                  ! VP                  ^ ,          4      4       \        P                  ! R4      pV P                  \        P                  ! VP                  ^ ,          4      4       \        P                  ! R4      pV P                  \        P                  ! VP                  ^ ,          4      4       \        P                  ! R4      pV P                  \        P                  ! VP                  ^ ,          4      4       \        P                  ! R	4      pV P                  \        P                  ! VP                  ^ ,          4      4       R
# )r  zx = "not docstring"zdef foo():
  passzclass foo:
  passz class foo:
  x = "not docstring"z class foo:
  def bar(self): passz def foo():
  x = "not docstring"zasync def foo():
  passz&async def foo():
  x = "not docstring"zasync def foo():
  42N)r   r'   ra  r(   r   r  s   & r   test_get_docstring_none'ASTHelpers_Test.test_get_docstring_none2  s   #++CIIbM:;yy./#++D12yy-.#++D12yy-.#++DIIaL9:yy<=#++DIIaL9:yy<=#++DIIaL9:yy-.#++DIIaL9:yy<=#++DIIaL9:yy34#++DIIaL9:yyBC#++DIIaL9:yy12#++DIIaL9:r   c                   \         P                  ! R 4      pV P                  VP                  ^ ,          P                  ^ 4       V P                  VP                  ^ ,          P
                  ^4       V P                  VP                  ^,          P                  ^ ,          P                  ^4       V P                  VP                  ^,          P                  ^ ,          P
                  ^4       V P                  VP                  ^,          P                  ^,          P                  ^ ,          P                  ^4       V P                  VP                  ^,          P                  ^,          P                  ^ ,          P
                  ^	4       V P                  VP                  ^,          P                  ^,          P                  ^4       V P                  VP                  ^,          P                  ^,          P
                  ^4       V P                  VP                  ^,          P                  ^ 4       V P                  VP                  ^,          P
                  ^4       R# )z"""line one
line two"""

def foo():
  """line one
  line two"""

  def bar():
    """line one
    line two"""
  """line one
  line two"""
"""line one
line two"""

N)r'   r(   rZ   r   rV   rU   r  s   & r   :test_multi_line_docstring_col_offset_and_lineno_issue16806JASTHelpers_Test.test_multi_line_docstring_col_offset_and_lineno_issue16806M  s   yy+
 	100!41,,a01**1-88!<1**1-44a81**1-2215@@!D1**1-2215<<a@1**1-88!<1**1-44b9100!41,,b1r   c                    \         P                  ! R 4      pVP                  ^ ,          P                  ^ ,          pV P	                  VP
                  ^4       V P	                  VP                  ^ 4       R# )z if a:
    pass
elif b:
    pass
Nr'   r(   r   orelserZ   rU   rV   r8   rL   	elif_stmts   &  r   test_elif_stmt_start_position-ASTHelpers_Test.test_elif_stmt_start_position`  sU    yy?@IIaL''*	))1---q1r   c                    \         P                  ! R 4      pVP                  ^ ,          P                  ^ ,          pV P	                  VP
                  ^4       V P	                  VP                  ^ 4       R# )z/if a:
    pass
elif b:
    pass
else:
    pass
Nrk  rm  s   &  r   'test_elif_stmt_start_position_with_else7ASTHelpers_Test.test_elif_stmt_start_position_with_elsef  sU    yyPQIIaL''*	))1---q1r   c                    \         P                  ! R 4      pVP                  ^ ,          P                  P                  ^ ,          pV P                  VP                  ^4       V P                  VP                  ^	4       R# )z
f(*[0, 1])N)r'   r(   r   r_   r*  rZ   r   r   )r8   rL   starred_exprs   &  r   *test_starred_expr_end_position_within_call:ASTHelpers_Test.test_starred_expr_end_position_within_calll  sZ    yy&yy|))..q100!444a8r   c                8   V P                  \        P                  ! R 4      . RO4       V P                  \        P                  ! R4      R^*/4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      0 Rm4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      \        4       4       V P	                  \
        \        P                  R	4       V P                  \        P                  ! R
4      ^4       V P                  \        P                  ! R4      ^4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        \        P                  ! R4      4      R4       V P	                  \
        \        P                  R4       V P	                  \
        \        P                  R4       V P	                  \
        \        P                  R4       R# )z	[1, 2, 3]z{"foo": 42}r
  z(True, False, None)Nz	{1, 2, 3}zb"hi"s   hizset()rU  6z+6z-6z3.25g      
@z+3.25z-3.25z-0.0z++6z+Truez2+3r   r   r  )TFN>   r   r   r  ig      
)rZ   r'   r  r  rg   r   r&   r7   s   &r   test_literal_eval!ASTHelpers_Test.test_literal_evalr  s   ))+6	B))-85"+F))*?@BUV))+6	B))'2E:))'2CE:*c&6&6@))#.2))$/3))$/4))&148))'2D9))'2E:c..v67@*c&6&6>*c&6&6@*c&6&6>r   c           	        \         P                  ! R 4      ;_uu_ 4        \        P                  ! R4       V P	                  \
        4      ;_uu_ 4       p\        P                  ! R4       RRR4       V P                  R\        XP                  4      4       V P                  R\        VP                  4      4       RRR4       R#   + '       g   i     Ld; i  + '       g   i     R# ; i)i  NzExceeds the limit z Consider hexadecimal   3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333  33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333)	r   adjust_int_max_str_digitsr'   r  rg   r  ri  r   rj  )r8   err_ctxs   & r   test_literal_eval_str_int_limit/ASTHelpers_Test.test_literal_eval_str_int_limit  s    ..t44X&"";//7  * 0MM.G4E4E0FGMM2C8I8I4JK 54// 544s$   4CC	*ACCCC*	c                T   V P                  \        P                  ! R 4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R	4      R4       V P                  \        P                  ! R
4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        \        P                  R4       V P                  \        \        P                  R4       V P                  \        \        P                  R4       V P                  \        \        P                  R4       V P                  \        \        P                  R4       R# )6jy              @z-6jz6.75jy              @z-6.75jz3+6jz-3+6jz3-6jz-3-6jz
3.25+6.75jz-3.25+6.75jz
3.25-6.75jz-3.25-6.75jz(3+6j)z-6j+3z-6j+3jz3+-6jz3+(0+6j)z-(3+6j)Ny             y             y      @      @y            @y      @      y            y      
@      @y      
      @y      
@      y      
      )rZ   r'   r  rg   r   r7   s   &r   test_literal_eval_complex)ASTHelpers_Test.test_literal_eval_complex  s   ))$/4))%0#6))'2E:))(3V<))&148))'2E:))&148))'2E:)),7D))-8+F)),7D))-8+F))(3T:*c&6&6@*c&6&6A*c&6&6@*c&6&6
C*c&6&6	Br   c                   \         P                  ! \         P                  ! ^4      \         P                  ! ^4      .\         P                  ! ^4      .R7      pV P                  \        \         P
                  V4       \         P                  ! \         P                  ! ^4      .\         P                  ! ^4      \         P                  ! ^4      .R7      pV P                  \        \         P
                  V4       R# )r   )keysr  N)r'   Dictr   rg   r   r  )r8   	malformeds   & r   &test_literal_eval_malformed_dict_nodes6ASTHelpers_Test.test_literal_eval_malformed_dict_nodes  s    HH3<<?CLLO"Dcll[\oM^_	*c&6&6	BHH3<<?"3S\\!_cll[\o<^_	*c&6&6	Br   c                4   V P                  \        P                  ! R 4      R4       V P                  \        P                  ! R4      R4       V P                  \        P                  ! R4      R4       V P                  \        \        P                  R4       R# )z    -1z		-1z 	 -1z
 -1Nr   )rZ   r'   r  rg   IndentationErrorr7   s   &r   test_literal_eval_trailing_ws-ASTHelpers_Test.test_literal_eval_trailing_ws  sl    ))(3R8))(3R8))(3R8*C,<,<gFr   c           	     T   R pV P                  \        V4      ;_uu_ 4        \        P                  ! R4       RRR4       \        P                  ! \        P
                  ! 4       \        P                  ! \        P
                  ! 4       \        P                  ! ^4      4      4      pV P                  \        VRR4      4       RpV P                  \        V4      ;_uu_ 4        \        P                  ! V4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z#malformed node or string on line 3:z{'a': 1,
'b':2,
'c':++3,
'd':4}NrU   zmalformed node or string:)	rv   r   r'   r  UnaryOpUAddr   r   rX   )r8   rw   rL   s   &  r   "test_literal_eval_malformed_lineno2ASTHelpers_Test.test_literal_eval_malformed_lineno  s    4##J44AB 5 {{HHJCHHJQ@B'$$78*##J44T" 54 54 544s   D"DD	D'	c                    V P                  \        R 4      ;_uu_ 4        \        P                  ! R4       RRR4       R#   + '       g   i     R# ; i)zunexpected indentz4
                \
                (\
            \ N)rv   r  r'   r  r7   s   &r   test_literal_eval_syntax_errors/ASTHelpers_Test.test_literal_eval_syntax_errors  s9    ##K1DEE   FEEEs   A  A	c                n   \         P                  ! R \         P                  ! RR7      .RRRR7      .p\         P                  ! V. 4      pV P	                  \
        4      ;_uu_ 4       p\        VRR4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)timesleepr  Nr   r   levelrU   rV   r,   r   zinvalid integer value: None)
r'   r  r   r   rg   r   r   ri  r   rj  )r8   r   r   rm  s   &   r   test_bad_integer ASTHelpers_Test.test_bad_integer  s    f&)iiW&=%>%)&*t= > jjr"z**bC( +3S5FG +*r  c           	         \         P                  ! R \         P                  ! R^ ^ R7      .R^ ^ R7      .p\         P                  ! V. 4      p\	        VRR4      p/ p\        W44       V P                  RV4       R# )r  r  r   Nr  r,   r   )r'   r  r   r   r   r   ri  )r8   r   r   r   nss   &    r   test_level_as_none"ASTHelpers_Test.test_level_as_none  ss    f&)iiW78Q'H &I%)&'A	7 8
 jjr"sFF+Tgr"r   c           	        \         P                  ! \         P                  ! 4       ^ ^ \         P                  ! ^4      R7      pWn        V P                  \        4      ;_uu_ 4        \        P                  ! 4       ;_uu_ 4        \        \         P                  ! V4      RR4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; ir   )rW  rU   rV   operandr   r   Nr'   r  Notr   r  rg   rM  r   rN  r   rx  r  s   & r   test_recursion_direct%ASTHelpers_Test.test_recursion_direct  s    KK3779Q1cllSToV	~..++--q)8V< . /.-- /..s$   %C
"B7	%C
7CC

C	c           	     J   \         P                  ! \         P                  ! 4       ^ ^ \         P                  ! ^4      R7      p\         P                  ! \         P                  ! 4       ^ ^ \         P                  ! ^4      R7      pW!n        Wn        V P                  \        4      ;_uu_ 4        \        P                  ! 4       ;_uu_ 4        \        \         P                  ! V4      RR4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; ir  r  )r8   rz  r  s   &  r   test_recursion_indirect'ASTHelpers_Test.test_recursion_indirect  s    KK3779Q1cllSToVKK3779Q1cllSToV		~..++--q)8V< . /.-- /..s$   ,D
"C>	,D>D	DD"	)r  )%r;   r<   r=   r>   r  r  r  r  r   r,  r:  rB  rG  rM  rR  rY  r]  rb  re  rh  ro  rr  rv  r{  r  r  r  r  r  r  r  r  r   r  r  r@   rA   rB   s   @r   r  r    s     G3
:
(5"n>
@d
L,"
&@0
::	
F,;62&229?&LC*CG
#	H
# $%= &= $%= &=r   r  c                    
  a  ] tR tRt o RER]/R lltRFR]/R lltRFR ltR tR t	R	 t
R
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R  t!R! t"R" t#R# t$R$ t%R% t&R& t'R' t(R( t)R) t*R* t+R+ t,R, t-R- t.R. t/R/ t0R0 t1]2Pf                  ! R14      R2 4       t4]5Pl                  ! ^4      t7]5Pp                  ! ]74      t9]5Pl                  ! R34      t:]5Pp                  ! ]:4      t;]5Pl                  ! R44      t<]5Pz                  ! R44      t>]5P~                  ! R5]5P                  ! 4       4      tA]5Pp                  ! ]5P                  ! ]5P                  ! ]5P~                  ! R3]5P                  ! 4       4      R6]5P                  ! 4       4      R7]5P                  ! 4       4      4      ]5Pp                  ! ]5P                  ! ]5P                  ! ]5P~                  ! R3]5P                  ! 4       4      R6]5P                  ! 4       4      R7]5P                  ! 4       4      4      ]5Pp                  ! ]5Pl                  ! R84      4      ]5Pp                  ! ]5Pl                  ! R44      4      ]5Pp                  ! ]5Pl                  ! RG4      4      ]5Pz                  ! R94      ]5P                  ! ]5Pz                  ! R94      .4      ]5P                  ! ]5P                  ! ]5Pz                  ! R94      .4      .4      ]5P                  ! ]7]<.];.4      ]5P                  ! ]<]7.];]9.R:R;7      ]5P                  ! ]<]5P                  ! ]5P~                  ! R<]5P                  ! 4       4      ]5P                  ! 4       4      .];]9.R=R;7      ]5P                  ! ]5P                  ! ]5P                  ! ]:R6]5P                  ! 4       4      R7]5P                  ! 4       4      . . . R>7      ]5P                  ! ]A. R:.]9.R>7      ]5P                  ! ]A. . ]9.R>7      ]5P                  ! ]A]5Pz                  ! R94      .. . R>7      ]5P                  ! ]A]5P                  ! 4       .. . R>7      ]5P                  ! ]A. . ]5P                  ! 4       .R>7      ]5P                  ! ]<. R:.]9.R>7      ]5P                  ! ]5P                  ! R:4      .4      ]5P                  ! R?R@7      ]5P                  ! . 4      ]5P                  ! ]9.4      ]5P                  ! ]9];]5Pz                  ! RA4      .4      ]5P                  ! RBR@7      ]5P                  ! R3R@7      ]5P                  ! ]5P                  ! RB4      .4      ]5P                  ! . . RBR;7      .tKRC tLRDtMV tNR# )HASTValidatorTestsi  Nr#  c               B   ^ ;Vn         Vn        \        P                  ! V4       Vf   \	        VRV4       R# V P                  V4      ;_uu_ 4       p\	        VRV4       RRR4       V P                  V\        XP                  4      4       R#   + '       g   i     L7; i)r   Nr   )	rU   rV   r'   rr  r   rg   ri  r   rj  )r8   r   rw   r  r#  rm  s   &&&&$ r   r   ASTValidatorTests.mod  ss    &''
S^!!#&;C4(""3''2Xt, (MM#s2<<01 ('s   BB	c                   \         P                  ! \         P                  ! V4      .. 4      pV P                  WBVR 7       R# ))r#  N)r'   r   r   r   )r8   rL   rw   r#  r   s   &&&$ r   rR   ASTValidatorTests.expr  s-    jj#((4.)2.s#r   c                X    \         P                  ! V.. 4      pV P                  W24       R # r   )r'   r   r   )r8   rS   rw   r   s   &&& r   rS   ASTValidatorTests.stmt  s     jj$$r   c           	     t   \         P                  ! \         P                  ! \         P                  ! R \         P                  ! 4       4      4      .4      pV P                  VRR4       \         P                  ! \         P                  ! R \         P                  ! 4       4      4      pV P                  VRR4       R# )rl   must have Load contextr   r   N)r'   Interactiver   r   Storer   rx  )r8   rl  s   & r   rS  ASTValidatorTests.test_module  sn    OOSXXchhsCIIK&@ABC,h7NN388C56,f5r   c                  a RV3R llp\         P                  ! R\         P                  ! R\         P                  ! 4       4      4      .pV! V! VR7      R4       V! V! VR7      R4       V! V! VR7      R4       V! V! \         P                  ! ^4      .R7      R4       V! V! \         P                  ! ^4      .R	7      R
4       \         P                  ! R\         P                  ! R\         P
                  ! 4       4      4      .pV! V! V\         P                  ! R\         P                  ! 4       4      .R7      R4       \         P                  ! R\         P                  ! R\         P
                  ! 4       4      4      \         P                  ! R\         P                  ! R\         P
                  ! 4       4      4      .pV! V! VR \         P                  ! R\         P                  ! 4       4      .R7      R4       R # )Nc           	         < V f   . p Vf   . pVf   . pVf   . pVf   . p\         P                  ! WW#WdV4      p S! V 4      # r   )r'   r/  )r*  r)  ri   r+  r-  r.  r,  facs   &&&&&&&r   r/  5ASTValidatorTests._check_arguments.<locals>.arguments  s\     |" !
" ==F!,X?Dt9r   rl   r  r  r%  )r+  )r.  z"more positional defaults than args)r,  z3length of kwonlyargs is not the same as kw_defaults)r*  r.  r   r  r  )r+  r,  )NNNNNNN)r'   r0  r   r  r   rq  )r8   r  checkr/  r*  s   &f&  r   _check_arguments"ASTValidatorTests._check_arguments  sX   	  SXXc399;789iT"$<=iD)+CDi4(*BCi#,,q/!23;	=iS\\!_$56L	NSXXc388:678iTSXXc399;-G,HI/	1SXXc388:67SXXc388:679i4'+SXXc399;-G&HJ2	4r   c                    \         P                  ! . . R . . R . 4      p\         P                  ! RV. . R R . 4      pV P                  VR4       \         P                  ! RV\         P                  ! 4       .\         P
                  ! R\         P                  ! 4       4      .R R . 4      pV P                  VR4       \         P                  ! RV\         P                  ! 4       .. \         P
                  ! R\         P                  ! 4       4      R . 4      pV P                  VR4       \         P                  ! R\         P                  ! 4       \         P                  ! 4       .4      pV P                  V4       R pV P                  W0P                  4       R # )Nrl   zempty body on FunctionDefr  c           	      b    \         P                  ! R V \         P                  ! 4       .. RR. 4      # )rl   N)r'   r  r   r  s   &r   r  +ASTValidatorTests.test_funcdef.<locals>.fac2  s%    ??3sxxzlBdBOOr   )r'   r/  r  rS   r   r   r  r  )r8   r   r  r  s   &   r   test_funcdefASTValidatorTests.test_funcdef'  s   MM"b$Bb9OOCBD$;		!01OOCSXXZL388C3M2NPTVZ\^_		!-.OOCSXXZL"HHS#))+6bB		!-.OOC388:,?		!	Pc99-r   c                    R  pRp\         P                  ! \        P                  ! V4      4      pVP                  ^ ,          pV P                  V\         P                  4       V P                  V! V4      4       R# )c                    V \         P                  R c;e   w  R8X  d   \         P                  Rc ;e   w   d    ^8H  d   w  \         P                  R c;e   w  R8X  d    d    ^8H  d   w  \         P                  R c ;e{   w    dv    ^8H  do   w  \         P
                  R c;eX   w  R8X  dP   \         P                  R c ;e;   w   \         P
                  R c;e%   w  R8X  d   \         P                  R c ;e   w   R#      R# )r    r
  r  r	  r  pacaranaTF)r'   r  r/  r0  r   r   rq  )rL   s   &r   matcher@ASTValidatorTests.test_funcdef_pattern_matching.<locals>.matcher8  sx    __ GUCMM,P?O?O%1\chhj%G%Gchh&Fz388:%(XX%Ej#((*	G
  r   zZ
            @capybara
            def foo(bar) -> pacarana:
                pass
        N)r'   r(   r   r   r   r   r  rM  )r8   r  r   r  funcdefs   &    r   test_funcdef_pattern_matching/ASTValidatorTests.test_funcdef_pattern_matching6  sY    	!
 8??401++a.gs7()r   c                ,   R
R lpV P                  V! \        P                  ! R\        P                  ! 4       4      .R7      R4       V P                  V! \        P                  ! R\        P                  ! R\        P                  ! 4       4      4      .R7      R4       V P                  V! . R7      R4       V P                  V! R .R7      R4       V P                  V! \        P                  ! R\        P                  ! 4       4      .R	7      R4       R # )Nc                     V f   . p Vf   . pVf   \         P                  ! 4       .pVf   . pVf   . p\         P                  ! RWW#V4      # )Nmyclass)r'   r   r+  )basesrK  r   rP   type_paramss   &&&&&r   r$  ,ASTValidatorTests.test_classdef.<locals>.clsM  s[    }|
|%!#" <<	5 $kC Cr   rl   )r  r  )rK  rv  zempty body on ClassDefNone disallowed)rP   )NNNNN)rS   r'   r   r  ru  )r8   r$  s   & r   test_classdefASTValidatorTests.test_classdefL  s    	C 			#SXXc399;789*	,		#C#syy{1K LMN*	,		#2, 89		#D6"$56		#chhsCIIK&@%AB*	,r   c           	     >   V P                  \        P                  ! . 4      R 4       V P                  \        P                  ! R.4      R4       V P                  \        P                  ! \        P                  ! R\        P                  ! 4       4      .4      R4       R# )zempty targets on DeleteNr  rl   zmust have Del context)rS   r'   Deleter   rq  r7   s   &r   test_deleteASTValidatorTests.test_deletec  sa    		#**R.";<		#**dV$&78		#**chhsCHHJ789)	+r   c           
        V P                  \        P                  ! . \        P                  ! ^4      4      R4       V P                  \        P                  ! R.\        P                  ! ^4      4      R4       V P                  \        P                  ! \        P                  ! R\        P
                  ! 4       4      .\        P                  ! ^4      4      R4       V P                  \        P                  ! \        P                  ! R\        P                  ! 4       4      .\        P                  ! R\        P                  ! 4       4      4      R4       R# )r  zempty targets on AssignNr  rl   must have Store contextr  r  )rS   r'   Assignr   r   rq  r  r7   s   &r   test_assignASTValidatorTests.test_assigni  s    		#**Ra13LM		#**dVS\\!_57HI		#**chhsCHHJ78#,,q/J+	-		#**chhsCIIK89 #ciik :<*	,r   c           	     :   \         P                  ! \         P                  ! R \         P                  ! 4       4      \         P                  ! 4       \         P                  ! R\         P                  ! 4       4      4      pV P                  VR4       \         P                  ! \         P                  ! R \         P                  ! 4       4      \         P                  ! 4       \         P                  ! R\         P                  ! 4       4      4      pV P                  VR4       R# )rl   r  r  r  N)r'   	AugAssignr   rq  r\  rS   r  )r8   augs   & r   test_augassign ASTValidatorTests.test_augassignr  s    mmCHHS#((*5swwyHHS#((*57		#01mmCHHS#))+6	HHS#))+68		#/0r   c           
        \         P                  ! R \         P                  ! 4       4      p\         P                  ! R\         P                  ! 4       4      p\         P                  ! 4       pV P                  \         P                  ! W. . 4      R4       V P                  \         P                  ! \         P                  ! R \         P                  ! 4       4      W#.. 4      R4       V P                  \         P                  ! V\         P                  ! R\         P                  ! 4       4      V.. 4      R4       \         P                  ! \         P                  ! R \         P                  ! 4       4      4      pV P                  \         P                  ! WV.. 4      R4       V P                  \         P                  ! WV.V.4      R4       R# )rl   r  zempty body on Forr  r  N)r'   r   r  rq  r   rS   r  r   )r8   rl   r  prz  s   &    r   test_forASTValidatorTests.test_forz  s   HHS#))+&HHS#((*%HHJ		#''!B')<=		#''#((3
3QR@+	-		#''!SXXc399;7!bA*	,HHSXXc399;/0		#''!R(*BC		#''!aS)+CDr   c                `   V P                  \        P                  ! \        P                  ! ^4      . . 4      R4       V P                  \        P                  ! \        P                  ! R\        P
                  ! 4       4      \        P                  ! 4       .. 4      R4       V P                  \        P                  ! \        P                  ! ^4      \        P                  ! 4       .\        P                  ! \        P                  ! R\        P
                  ! 4       4      4      .4      R4       R# )r  zempty body on Whilerl   r  N)rS   r'   Whiler   r   r  r   r   r7   s   &r   
test_whileASTValidatorTests.test_while  s    		#))CLLOR46KL		#))CHHS#))+6bI*	,		#))CLLOchhj\!hhsxxSYY['ABCE5	7r   c                ^   V P                  \        P                  ! \        P                  ! ^4      . . 4      R4       \        P                  ! \        P                  ! R\        P
                  ! 4       4      \        P                  ! 4       .. 4      pV P                  VR4       \        P                  ! \        P                  ! ^4      \        P                  ! \        P                  ! R\        P
                  ! 4       4      4      .. 4      pV P                  VR4       \        P                  ! \        P                  ! ^4      \        P                  ! 4       .\        P                  ! \        P                  ! R\        P
                  ! 4       4      4      .4      pV P                  VR4       R# )r  zempty body on Ifrl   r  N)rS   r'   Ifr   r   r  r   r   )r8   r   s   & r   test_ifASTValidatorTests.test_if  s    		#&&a"b13EFFF388C-
|R@		!-.FF3<<?SXXchhsCIIK.H%I$JBO		!-.FF3<<?SXXZLHHSXXc399;789;		!-.r   c                   \         P                  ! 4       pV P                  \         P                  ! . V.4      R 4       \         P                  ! \         P
                  ! ^4      R4      pV P                  \         P                  ! V.. 4      R4       \         P                  ! \         P                  ! R\         P                  ! 4       4      R4      pV P                  \         P                  ! V.V.4      R4       \         P                  ! \         P
                  ! ^4      \         P                  ! R\         P                  ! 4       4      4      pV P                  \         P                  ! V.V.4      R4       R# )zempty items on WithNzempty body on Withrl   r  r  )	r'   r   rS   Withr  r   r   r  rq  )r8   r  r   s   &  r   	test_withASTValidatorTests.test_with  s    HHJ		#((2s#%:;LLa$/		#((A3#%9:LL#syy{3T:		#((A3$&>?LLa#((3
*CD		#((A3$&?@r   c                   \         P                  ! R \         P                  ! ^4      4      pV P                  VR4       \         P                  ! \         P                  ! R\         P
                  ! 4       4      R 4      pV P                  VR4       \         P                  ! \         P                  ! ^4      \         P                  ! R\         P
                  ! 4       4      4      pV P                  VR4       R # )Nz!Raise with cause but no exceptionrl   r  )r'   r*  r   rS   r   r  )r8   rs   & r   
test_raiseASTValidatorTests.test_raise  s    IIdCLLO,		!89IIchhsCIIK0$7		!-.IIcll1osxxSYY['AB		!-.r   c                F   \         P                  ! 4       p\         P                  ! . . . V.4      pV P                  VR 4       \         P                  ! \         P                  ! \         P
                  ! R\         P                  ! 4       4      4      .. . V.4      pV P                  VR4       \         P                  ! V.. . . 4      pV P                  VR4       \         P                  ! V.. V.V.4      pV P                  VR4       \         P                  ! V.\         P                  ! RR. 4      .. . 4      pV P                  VR4       \         P                  ! \         P
                  ! R\         P                  ! 4       4      RV.4      .pV P                  \         P                  ! V.V. . 4      R4       \         P                  ! RRV.4      .p\         P                  ! V.V\         P                  ! \         P
                  ! R\         P                  ! 4       4      4      .V.4      pV P                  VR4       \         P                  ! V.W1.\         P                  ! \         P
                  ! R\         P                  ! 4       4      4      .4      pV P                  VR4       R# )zempty body on Tryrl   r  z-Try has neither except handlers nor finalbodyz%Try has orelse but no except handlersNempty body on ExceptHandlerr  )r'   r   TryrS   r   r   r  ExceptHandlerr8   r  trz  s   &   r   test_tryASTValidatorTests.test_try  s   HHJGGBB$		!()GGSXXchhsCIIK89:BQCH		!-.GGQCR$		!DEGGQCaS1#&		!<=GGQC#++D#r:;RD		!23sxxSYY[93DE		#''1#q"b)+CDtS1#./GGQCSXXchhsCIIK&@ABQCH		!-.GGQCC#((388C+E"F!GH		!-.r   c                F   \         P                  ! 4       p\         P                  ! . . . V.4      pV P                  VR 4       \         P                  ! \         P                  ! \         P
                  ! R\         P                  ! 4       4      4      .. . V.4      pV P                  VR4       \         P                  ! V.. . . 4      pV P                  VR4       \         P                  ! V.. V.V.4      pV P                  VR4       \         P                  ! V.\         P                  ! RR. 4      .. . 4      pV P                  VR4       \         P                  ! \         P
                  ! R\         P                  ! 4       4      RV.4      .pV P                  \         P                  ! V.V. . 4      R4       \         P                  ! RRV.4      .p\         P                  ! V.V\         P                  ! \         P
                  ! R\         P                  ! 4       4      4      .V.4      pV P                  VR4       \         P                  ! V.W1.\         P                  ! \         P
                  ! R\         P                  ! 4       4      4      .4      pV P                  VR4       R# )zempty body on TryStarrl   r  z1TryStar has neither except handlers nor finalbodyz)TryStar has orelse but no except handlersNr  r  )r'   r   TryStarrS   r   r   r  r  r  s   &   r   test_try_starASTValidatorTests.test_try_star  s   HHJKKBQC(		!,-KK#((3		"<=>BL		!-.KKRR(		!HIKKR!qc*		!@AKKc//c2>?RH		!23sxxSYY[93DE		#++qc1b"-/GHtS1#./KKQ#((3		*D!E FL		!-.KKQchhsxxSYY[/I&J%KL		!-.r   c           	        V P                  \        P                  ! \        P                  ! R \        P                  ! 4       4      R4      R4       \        P                  ! \        P                  ! R \        P
                  ! 4       4      \        P                  ! R\        P                  ! 4       4      4      pV P                  VR4       R# )rl   Nr  r  )rS   r'   Assertr   r  rq  )r8   assrts   & r   test_assertASTValidatorTests.test_assert  ss    		#**SXXc399;7>*	,

388C488C57		%12r   c                R    V P                  \        P                  ! . 4      R 4       R# )zempty names on ImportN)rS   r'   r   r7   s   &r   test_importASTValidatorTests.test_import      		#**R."9:r   c                    \         P                  ! R \         P                  ! RR 4      .R4      pV P                  VR4       V P                  \         P                  ! R . ^ 4      R4       R # )Nrl   zNegative ImportFrom levelzempty names on ImportFromi)r'   r  r   rS   )r8   imps   & r   test_importfrom!ASTValidatorTests.test_importfrom  sM    nnTCIIc4$8#93?		#23		#..r1-/JKr   c                R    V P                  \        P                  ! . 4      R 4       R# )zempty names on GlobalN)rS   r'   Globalr7   s   &r   test_globalASTValidatorTests.test_global  r  r   c                R    V P                  \        P                  ! . 4      R 4       R# )zempty names on NonlocalN)rS   r'   Nonlocalr7   s   &r   test_nonlocalASTValidatorTests.test_nonlocal  s    		#,,r"$=>r   c                    \         P                  ! \         P                  ! R \         P                  ! 4       4      4      pV P	                  VR4       R# rl   r  N)r'   r   r   r  rS   r  s   & r   	test_exprASTValidatorTests.test_expr  s0    HHSXXc399;/0		!-.r   c           	        \         P                  ! \         P                  ! 4       . 4      pV P                  VR 4       \         P                  ! \         P                  ! 4       \         P                  ! ^4      .4      pV P                  VR 4       \         P                  ! \         P                  ! 4       \         P                  ! ^4      R.4      pV P                  VR4       \         P                  ! \         P                  ! 4       \         P                  ! ^4      \         P
                  ! R\         P                  ! 4       4      .4      pV P                  VR4       R# )zless than 2 valuesNr  rl   r  )r'   BoolOpAndrR   r   r   r  )r8   r  s   & r   test_boolopASTValidatorTests.test_boolop  s    JJswwy"%		!)*JJswwy3<<?"34		!)*JJswwy3<<?D"9:		!&'JJswwy3<<?CHHS#))+4N"OP		!-.r   c                    \         P                  ! \         P                  ! 4       \         P                  ! R \         P                  ! 4       4      4      pV P                  VR4       R# r  )r'   r  r  r   r  rR   )r8   us   & r   test_unaryopASTValidatorTests.test_unaryop  s8    KK	388C#=>		!-.r   c           
        \         P                  ! . . R . . R . 4      pV P                  \         P                  ! V\         P                  ! R\         P
                  ! 4       4      4      R4       R pV P                  W P                  4       R # )Nrl   r  c                     \         P                  ! V \         P                  ! R \         P                  ! 4       4      4      # rl   )r'   Lambdar   rq  r  s   &r   r  *ASTValidatorTests.test_lambda.<locals>.fac  s$    ::dCHHS#((*$=>>r   )r'   r/  rR   r,  r   r  r  )r8   r   r  s   &  r   test_lambdaASTValidatorTests.test_lambda  s`    MM"b$Bb9		#**Qciik :;*	,	?c99-r   c                   \         P                  ! R \         P                  ! 4       4      p\         P                  ! R\         P                  ! 4       4      pW!V3WV3WV33 F'  pV P	                  \         P
                  ! V!  R4       K)  	  R# rl   r  r  N)r'   r   rq  r  rR   IfExp)r8   lsr*  s   &   r   
test_ifexpASTValidatorTests.test_ifexp	  sc    HHS#((*%HHS#))+&1Iay1)3DIIcii&(@A 4r   c                P   \         P                  ! . \         P                  ! R \         P                  ! 4       4      .4      pV P	                  VR4       \         P                  ! \         P                  ! R \         P                  ! 4       4      .R.4      pV P	                  VR4       R# )rl   zsame number of keys as valuesNr  )r'   r  r   rq  rR   )r8   rX  s   & r   	test_dictASTValidatorTests.test_dict	  sj    HHR#((3
345		!45HHchhsCHHJ/04&9		!&'r   c                    V P                  \        P                  ! R .4      R4       \        P                  ! \        P                  ! R\        P                  ! 4       4      .4      pV P                  VR4       R # Nr  rl   r  )rR   r'   Setr   r  r8   r4  s   & r   test_setASTValidatorTests.test_set	  sL    		#''4&/#45GGSXXc399;/01		!-.r   c           	        V P                  V! . 4      R 4       \        P                  ! \        P                  ! R\        P                  ! 4       4      \        P                  ! R\        P                  ! 4       4      . ^ 4      pV P                  V! V.4      R4       \        P                  ! \        P                  ! R\        P
                  ! 4       4      \        P                  ! R\        P
                  ! 4       4      . ^ 4      pV P                  V! V.4      R4       \        P                  ! R\        P
                  ! 4       4      p\        P                  ! R\        P                  ! 4       4      p\        P                  ! W4R.^ 4      pV P                  V! V.4      R4       \        P                  ! W4\        P                  ! R\        P
                  ! 4       4      .^ 4      pV P                  V! V.4      R4       R# )z comprehension with no generatorsrl   r  r  r  Nr  )rR   r'   r  r   rq  r  )r8   r  grl   r  s   &&   r   _check_comprehension&ASTValidatorTests._check_comprehension	  sK   		#b'=>chhsCHHJ7!hhsCHHJ7Q@		#qc(56chhsCIIK8!hhsCIIK8"aA		#qc(45HHS#))+&HHS#((*%aTFA.		#qc(-.aSXXc399;%?$@!D		#qc(45r   c           	       a \         P                  ! \         P                  ! R \         P                  ! 4       4      \         P                  ! R \         P                  ! 4       4      . ^ 4      pV P                  S! \         P                  ! R \         P                  ! 4       4      V.4      R4       V3R lpV P                  V4       R# )rl   r  c                 f   < S! \         P                  ! R \         P                  ! 4       4      V 4      # r+  )r'   r   r  )gensr  s   &r   wrap,ASTValidatorTests._simple_comp.<locals>.wrap'	  s!    sxxSYY[1488r   N)r'   r  r   r  rq  rR   rB  )r8   r  rA  rG  s   &f  r   _simple_compASTValidatorTests._simple_comp"	  s}    chhsCIIK8!hhsCHHJ7Q@		#chhsCIIK01#6*	,	9!!$'r   c                D    V P                  \        P                  4       R # r   )rI  r'   ListCompr7   s   &r   test_listcompASTValidatorTests.test_listcomp+	  s    #,,'r   c                D    V P                  \        P                  4       R # r   )rI  r'   SetCompr7   s   &r   test_setcompASTValidatorTests.test_setcomp.	  s    #++&r   c                D    V P                  \        P                  4       R # r   )rI  r'   GeneratorExpr7   s   &r   test_generatorexp#ASTValidatorTests.test_generatorexp1	  s    #**+r   c                   \         P                  ! \         P                  ! R \         P                  ! 4       4      \         P                  ! R\         P                  ! 4       4      . ^ 4      p\         P
                  ! \         P                  ! R\         P                  ! 4       4      \         P                  ! R \         P                  ! 4       4      V.4      pV P                  VR4       \         P
                  ! \         P                  ! R\         P                  ! 4       4      \         P                  ! R \         P                  ! 4       4      V.4      pV P                  VR4       R pV P                  V4       R# )r  r  rl   r  c                     \         P                  ! R \         P                  ! 4       4      p\         P                  ! R\         P                  ! 4       4      p\         P                  ! WV 4      # r  )r'   r   rq  DictComp)compskvs   &  r   factory0ASTValidatorTests.test_dictcomp.<locals>.factory=	  s?    chhj)Achhj)A<<e,,r   N)r'   r  r   r  rq  rY  rR   rB  )r8   rA  cr]  s   &   r   test_dictcompASTValidatorTests.test_dictcomp4	  s    chhsCIIK8!hhsCHHJ7Q@LL#syy{3#sxxz2QC9		!-.LL#sxxz2#syy{3aS:		!-.	- 	!!'*r   c           	     >   V P                  \        P                  ! \        P                  ! R \        P                  ! 4       4      4      R4       V P                  \        P
                  ! \        P                  ! R \        P                  ! 4       4      4      R4       R# )rl   zmust have LoadN)rR   r'   Yieldr   r  	YieldFromr7   s   &r   
test_yieldASTValidatorTests.test_yieldC	  sT    		#))CHHS#))+679IJ		#--ciik :;=MNr   c                   \         P                  ! R \         P                  ! 4       4      p\         P                  ! V\         P                  ! 4       .. 4      pV P                  VR4       \         P                  ! V\         P                  ! 4       .\         P                  ! ^4      \         P                  ! ^4      .4      pV P                  VR4       \         P                  ! \         P                  ! R4      \         P                  ! 4       .V.4      pV P                  V4       \         P                  ! V\         P                  ! 4       .\         P                  ! R4      .4      pV P                  V4       R# )rl   zno comparatorsz,different number of comparators and operandsblahN)r'   r   rq  CompareInrR   r   )r8   rV  comps   &  r   test_compareASTValidatorTests.test_compareG	  s    xxSXXZ({{4#&&(R0		$(){{4#&&(cll1os||A-OP		$FG{{3<</#&&(dVD		${{4#&&(cll6.B-CD		$r   c                   \         P                  ! R \         P                  ! 4       4      p\         P                  ! R\         P                  ! 4       4      .p\         P                  ! R\         P                  ! R\         P                  ! 4       4      4      .p\         P                  ! \         P                  ! R \         P
                  ! 4       4      W#4      pV P                  VR4       \         P                  ! VR.V4      pV P                  VR4       \         P                  ! R\         P                  ! R\         P
                  ! 4       4      4      .p\         P                  ! WV4      pV P                  VR4       R# )rl   r  wr  r  Nr  )r'   r   rq  ru  r@  r  rR   )r8   r>  r*  rK  callbad_keywordss   &     r   	test_callASTValidatorTests.test_callR	  s    xxSXXZ(chhj)*KKSXXc388:%>?@xxciik2DC		$01xxtfh/		$)*C#syy{)CDExxL1		$01r   c                    \         P                  ! \         P                  ! R \         P                  ! 4       4      R\         P                  ! 4       4      pV P                  VR4       R# r1  )r'   	Attributer   r  rq  rR   )r8   rc  s   & r   test_attribute ASTValidatorTests.test_attribute^	  s:    }}SXXc399;7chhjI		$01r   c           	        \         P                  ! \         P                  ! R \         P                  ! 4       4      \         P                  ! ^4      \         P
                  ! 4       4      pV P                  VR4       \         P                  ! R \         P
                  ! 4       4      p\         P                  ! V\         P                  ! R\         P                  ! 4       4      \         P
                  ! 4       4      pV P                  VR4       \         P                  ! R \         P                  ! 4       4      pVRR3RVR3RRV33 FQ  p\         P                  ! V!  pV P                  \         P                  ! W%\         P
                  ! 4       4      R4       KS  	  \         P                  ! . \         P
                  ! 4       4      pV P                  \         P                  ! W%\         P
                  ! 4       4      4       \         P                  ! V.\         P
                  ! 4       4      pV P                  \         P                  ! W%\         P
                  ! 4       4      R4       R# )rl   r  r  N)	r'   	Subscriptr   r  r   rq  rR   SliceTuple)r8   r  rl   r4  r*  sls   &     r   test_subscript ASTValidatorTests.test_subscriptb	  sm   mmCHHS#))+6QHHJ(		#/0HHS#((*%mmAsxxSYY[9HHJ(		#/0HHS#))+&dOdAt_tT1oEDD!BIIcmmA388:6.0 F YYr388:&		#--sxxz23YYsCHHJ'		#--sxxz24LMr   c           	     x   \         P                  ! \         P                  ! \         P                  ! R \         P                  ! 4       4      \         P
                  ! 4       4      .\         P
                  ! 4       4      p\         P                  ! V.\         P                  ! ^4      4      pV P                  VR4       R# )rl   r  N)	r'   ListStarredr   rq  r  r  r   rS   )r8   rV  assigns   &  r   test_starredASTValidatorTests.test_starredt	  si    xxSXXc388:%>		LM		%TFCLLO4		&34r   c           	     
   V P                  V! R .\        P                  ! 4       4      R4       V P                  V! \        P                  ! R\        P                  ! 4       4      .\        P                  ! 4       4      R4       R # r;  )rR   r'   rq  r   r  )r8   r  s   &&r   	_sequenceASTValidatorTests._sequencez	  sR    		#tfchhj)+<=		#sxxSYY[12CHHJ?*	,r   c                D    V P                  \        P                  4       R # r   )r  r'   r  r7   s   &r   	test_listASTValidatorTests.test_list	  s    sxx r   c                D    V P                  \        P                  4       R # r   )r  r'   r{  r7   s   &r   
test_tupleASTValidatorTests.test_tuple	  s    syy!r   cpuc           
        \          F  pV P                  V4      ;_uu_ 4        \        P                  P	                  \
        V4      p\        VR RR7      ;_uu_ 4       pVP                  4       pRRR4       \        P                  ! XV4      p\        WRR4       \        P                  ! WB4      pV P                  \        P                  ! WV4      4       RRR4       K  	  R#   + '       g   i     L|; i  + '       g   i     EK  ; i)r  zutf-8)encodingNr   )STDLIB_FILESr   ospathr+   STDLIBopenreadr'   r(   r   rM  r  )r8   r   fnfpr  r   mod2s   &      r   test_stdlib_validates'ASTValidatorTests.test_stdlib_validates	  s    "Ff%%WW\\&&1"cG44WWYF 5ii+(yy,C 67 &% # 54 &%%s$   ;C6C#/A&C6#C3.C66Drl   Tcarterr  r  .stringr  )restlollegit)patterns	kwd_attrskwd_patternsr"  r  xxxr  c                   \         P                  ! R \         P                  ! 4       4      pV P                   F  pV P	                  \         P
                  ! V^R7      4      ;_uu_ 4        \         P                  ! V\         P                  ! V\         P                  ! 4       .R7      .R7      p\         P                  ! V4      p\         P                  ! V.. 4      pV P                  \        4      ;_uu_ 4        \        VRR4       RRR4       RRR4       K  	  R#   + '       g   i     L; i  + '       g   i     EK
  ; i)rl   r  )rs  r   )subjectr   r   r   N)r'   r   rq  _MATCH_PATTERNSr   r  Matchrv  r   rr  r   rg   r   r   )r8   name_xrs  rL   r   s   &    r   test_match_validation_pattern/ASTValidatorTests.test_match_validation_pattern
  s    #sxxz*++Gchhwq9::yy"$+$'HHJ< 006TFB/&&z22FHf5 3 ;: , 32 ;::s%   )BD/8DD/D,'D//Er    )Nr   r   rz  )Or;   r<   r=   r>   r   r   rR   rS   rS  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r
  r  r  r  r  r  r#  r'  r.  r5  r8  r>  rB  rI  rM  rQ  rU  r`  re  rl  rr  rv  r}  r  r  r  r  r   requires_resourcer  r'   r   
constant_1
MatchValue	pattern_1
constant_x	pattern_xconstant_truer9  pattern_truer   rq  name_carterru  r  MatchSequenceMatchMappingr  
MatchClass	MatchStarMatchAsMatchOrr  r  r@   rA   rB   s   @r   r  r    sH    2Z 2$* $6 4D.*,,.+,1E7/A//(/(3;L
;?///.B(/
6((',+O	
22N$5,
!" u%	8 &	8 aJz*Ic"Jz*ILL&M%%d+L((8SXXZ0K 	MMHHS#))+. SXXZ	
 	MMHHS#((*- SXXZ	
 	LL	
 	LL	
 	LL!	
 	8$


X
&
 	 	!!**84	
 	'K	
 	J'	"	

 	CKK
(CSXXZPQ	"	

 	MM% SXXZ	!
 2B	
 	h#		
 	#		
 	((23		
 	mmo&		
 	--/*		
 	h#		
 	f%	

 		
 		
 	K	
 		3#5#5e#<=	
 	33==-./Rc*oxOt6 6r   r  c                   z   a  ] tR tRt o R tR tR tR tR tR t	R t
]P                  R	 4       tR
 tR tRtV tR# )ConstantTestsi)
  c                6   \         P                  ! R 4      pVP                  ^ ,          P                  p\         P                  ! VR7      p\         P
                  ! WC4       WBP                  ^ ,          n        \        VRR4      p/ p\        WV4       VR,          # )zx = 123r9  r   r   rl   )r'   r(   r   r_   r   r?  r   r   )r8   r_   r   rL   new_noder   r  s   &&     r   compile_constantConstantTests.compile_constant,
  sp    yy#yy|!!<<e,()%		!tZ0T#wr   c                    V P                  \        4      ;_uu_ 4       pV P                  . RO4       RRR4       V P                  \	        XP
                  4      R4       R#   + '       g   i     L7; i)r   Nz%got an invalid type in Constant: listrz  )rg   rj   r  rZ   r   rj  )r8   rm  s   & r   test_validationConstantTests.test_validation:
  sN    y))R!!), *R\\*@	B *)s   A!!A1	c                    R RR\         R3 FH  pV P                  VR7      ;_uu_ 4        V P                  V4      pV P                  W!4       R R R 4       KJ  	  R #   + '       g   i     K_  ; i)NFTr   )const)Ellipsisr   r  r  )r8   r  r_   s   &  r   test_singletonsConstantTests.test_singletons@
  sV    E437EE**--e4e+ +* 8***s   #AA+c           	     d   R	p\        ^04      p\        ^4       F  pV^3p\        V^04      pK  	  ^{RRRR\        R4      \        R4      W3	pV FH  pV P                  VR7      ;_uu_ 4        V P	                  V4      pV P                  We4       RRR4       KJ  	  R#   + '       g   i     K_  ; i)
r   g     ^@y             ^@unicode   bytesr  rw  r9  Nr-  )rw  r1  r  r   r  rZ   )r8   nested_tuplenested_frozensetr  r  r_   results   &      r   test_valuesConstantTests.test_valuesF
  s    $aS>1XE(!,L(*:A)>?  udX.)K"82 EE**..u5  / +* ***s   -#BB/c                   \         P                  ! R 4      pVP                  ^ ,          P                  ^ ,          p\         P                  ! ^R7      p\         P
                  ! W24       W1P                  ^ ,          P                  ^ &   V P                  \        4      ;_uu_ 4       p\        VRR4       RRR4       V P                  \        XP                  4      R4       R#   + '       g   i     L7; i)x = 1r9  r  r   Nz6expression which can't be assigned to in Store context)r'   r(   r   targetsr   r?  rg   r   r   rZ   r   rj  )r8   r   rq  
new_targetrm  s   &    r   test_assign_to_constant%ConstantTests.test_assign_to_constantU
  s    yy!1%%a(\\*
*-",		!Qz**bD(F+ +R\\*/	0 +*s   $C!!C1	c                ~    \         P                  ! R 4      pV P                  \         P                  ! V4      R4       R# )z'docstring'
x = 1	docstringN)r'   r(   rZ   ra  r   s   & r   rb   ConstantTests.test_get_docstringc
  s,    yy-.**40+>r   c                    \        VR R4      p. p\        P                  ! V4       F?  pVP                  \        P                  9   g   K$  VP                  VP                  4       KA  	  V# )r   r   )r   disget_instructionsopcodehasconstrE  argval)r8   r   coconstsinstrs   &&   r   get_load_constConstantTests.get_load_constg
  sS     T:v.))"-E||s||+ell+ . r   c                    . ROpRP                  V Uu. uF  pRP                  V4      NK  	  up4      pVR,          pVP                  \        R 34       \        P
                  ! V4      pV P                  V P                  V4      V4       \        VP                  V4       FB  w  rR\        P                  ! VR7      p\        P                  ! WeP                  4       Wen        KD  	  V P                  V P                  V4      V4       R # u upi )Nr%   zx={!r}z
x = ...r9  )	NTFi  g       @y              @r  r  rz  )r+   r   extendr  r'   r(   rZ   r  r   r   r   r?  r_   )r8   r  r  r   r   r  r  s   &      r   test_load_constConstantTests.test_load_constq
  s     yyfEfU(//%0fEFx&'yy,,T2	! !F3MF||%0Hh5#L	 4 	,,T2	! Fs   Dc                   \         P                  ! R 4      pVP                  ^ ,          P                  p\         P                  ! ^
R7      p\         P
                  ! W2P                  4       W2n        \         P                  ! RR7      p\         P
                  ! WBP                  4       WBn        V P                  \         P                  ! V4      R4       R# )z1 + 2r9  y              4@Ny      $@      4@)
r'   r(   r   r_   r   r?  rV  rX  rZ   r  )r8   r   binopnew_left	new_rights   &    r   r{  ConstantTests.test_literal_eval
  s    yy!		!""<<b)(JJ/
LLs+	)[[1))%0&9r   c                   \         P                  ! R RR7      P                  pV P                  VP                  R4       V P                  VP
                  R4       \         P                  ! RRR7      P                  pV P                  VP                  R4       V P                  VP
                  R4       \         P                  ! RRR7      P                  pV P                  VP                  R4       V P                  VP
                  R4       \         P                  ! RRR7      P                  pV P                  VP                  R	4       V P                  VP
                  R4       R# )
z"x"r   r  rl   Nzu"x"r&  zr"x"zb"x"   x)r'   r(   r   rZ   r_   r   )r8   r_  s   & r   test_string_kindConstantTests.test_string_kind
  s    IIe&)..#&&IIf6*//#&%IIf6*//#&&IIf6*//$'&r   r    N)r;   r<   r=   r>   r  r  r  r  r  rb  r  r   r?   r  r{  r  r@   rA   rB   s   @r   r  r  )
  sR     B,00? ! !8:' 'r   r  c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R  t"R!t#V t$R"# )#EndPositionTestsi
  c                v    V P                  VP                  V4       V P                  VP                  V4       R # r   )rZ   r   r   )r8   r\   r   r   s   &&&&r   _check_end_posEndPositionTests._check_end_pos
  s.    ,,j900.Ar   c                R    V P                  \        P                  ! W4      V4       R # r   )rZ   r'   get_source_segment)r8   r  r\   contents   &&&&r   _check_contentEndPositionTests._check_content
  s    //A7Kr   c                d    \         P                  ! V4      P                  ^ ,          P                  # )r   )r'   r(   r   r_   r=  s   &&r   _parse_valueEndPositionTests._parse_value
  s#     yy|  #)))r   c                
   R pV P                  V4      pV P                  WP                  R4       V P                  WP                  P                  ^ ,          R4       V P                  WP                  P                  R4       R# )zlambda x, *y: Noner#  rl   r  N)r  r  r   r*  ri   )r8   r4  lams   &  r   r.  EndPositionTests.test_lambda
  s`     "Axx0Axx}}Q/5Axx4r   c                f   \        R 4      P                  4       p\        P                  ! V4      P                  ^ ,          pV P                  V^^4       V P                  WP                  ^ ,          R4       V P                  WP                  P                  ^ ,          R4       V P                  WP                  P                  ^ ,          P                  R4       V P                  WP                  P                  R4       V P                  WP                  P                  P                  R4       R# )z
            def func(x: int,
                     *args: str,
                     z: float = 0,
                     **kwargs: Any) -> bool:
                return True
            zreturn Truezx: intr!  zkwargs: AnyAnyN)
r   r  r'   r(   r   r  r  r*  
annotationr-  r8   r4  fdefs   &  r   test_func_defEndPositionTests.test_func_def
  s        	
 yy|  #D!R(Ayy|];Ayy~~a0(;Ayy~~a0;;UCAyy>Ayy995Ar   c                   R pV P                  V4      pV P                  WP                  R4       V P                  WP                  ^ ,          P                  R4       V P                  WP                  ^,          P                  R4       R# )zfunc(x, y=2, **kw)r>  2kwN)r  r  r>  rK  r_   r8   r4  rp  s   &  r   rr  EndPositionTests.test_call
  si       #Ayy&1A}}Q/55s;A}}Q/55t<r   c                    R pV P                  V4      pV P                  WP                  R4       V P                  V^^4       R# )zx[0]()zx[0]N)r  r  r>  r  r  s   &  r   test_call_noargs!EndPositionTests.test_call_noargs
  s=      #Ayy&1D!Q'r   c                8   \        R 4      P                  4       p\        P                  ! V4      P                  ^ ,          pV P                  V^^4       V P                  WP                  ^,          R4       V P                  WP                  ^ ,          R4       R# )z?
            class C(A, B):
                x: int = 0
        Bz
x: int = 0N)r   r  r'   r(   r   r  r  r  r8   r4  cdefs   &  r   test_class_defEndPositionTests.test_class_def
  sy       UW 	
 yy|  #D!R(Azz!}c2Ayy|\:r   c                    R p\         P                  ! V4      P                  ^ ,          pV P                  WP                  ^ ,          P
                  R4       R# )z$class S(metaclass=abc.ABCMeta): passzabc.ABCMetaN)r'   r(   r   r  rK  r_   r  s   &  r   test_class_kwEndPositionTests.test_class_kw
  s>    2yy|  #A}}Q/55}Er   c                    \        R 4      P                  4       p\        P                  ! V4      P                  ^ ,          pV P                  V^^(4       V P                  VP                  ^^(4       R# )zh
            x = """Some multi-line text.

            It goes on starting from same indent."""
        Nr   r  r'   r(   r   r  r_   r8   r4  r  s   &  r   test_multi_line_str$EndPositionTests.test_multi_line_str
  s_       UW	 	

 1""1%FAr*FLL!R0r   c                    \        R 4      P                  4       p\        P                  ! V4      P                  ^ ,          pV P                  V^^4       V P                  VP                  ^^4       R# )zB
            x = "first part" \
            "second part"
        Nr  r  s   &  r   test_continued_str#EndPositionTests.test_continued_str
  s_       UW 	
 1""1%FAr*FLL!R0r   c                   \        R 4      P                  4       p\        P                  ! V4      pVP                  ^ ,          pVP                  ^,          pVP                  ^,          pVP                  ^,          pVP                  ^,          pV P                  V^^4       V P                  V^	^4       V P                  V^^4       V P                  V^^4       V P                  V^^4       V P                  WP                  R4       V P                  WP                  ^ ,          R4       V P                  WP                  ^ ,          P                  R4       V P                  WP                  R4       V P                  WP                  ^ ,          R4       V P                  WP                  ^ ,          P                  R4       R# )a  
            while True:
                pass

            if one():
                x = None
            elif other():
                y = None
            else:
                z = None

            for x, y in stuff:
                assert True

            try:
                raise RuntimeError
            except TypeError as e:
                pass

            pass
        r  zx = Nonezother()x, yzraise RuntimeErrorrj   N)r   r  r'   r(   r   r  r  r,   rl  rq  handlersrI   )r8   r4  r   
while_loopif_stmtfor_looptry_stmtr   s   &       r   test_suitesEndPositionTests.test_suites  sc      ( UW) 	
* iilXXa[
((1+88A;88A;HHQK	J1-GQ+Hb"-Hb!,Ir1-A7A||A
;A~~a055yAA7A}}Q/1EFA00388+Fr   c                    R pV P                  V4      pVP                  ^,          P                  pV P                  WR4       R# )zx = f"abc {x + y} abc"zx + yN)r  r  r_   r  r8   r4  fstrr  s   &   r   test_fstringEndPositionTests.test_fstring2  s:    $  #A$$Ag.r   c                *   \        R 4      P                  4       pV P                  V4      pVP                  ^,          P                  pV P                  V^^4       V P                  WP                  R4       V P                  WP                  R4       R# )z
            f"""Some multi-line text.
            {
            arg_one
            +
            arg_two
            }
            It goes on..."""
        arg_onearg_twoN)	r   r  r  r  r_   r  r  rV  rX  r,  s   &   r   test_fstring_multi_line(EndPositionTests.test_fstring_multi_line8  s|       UW 	
   #A$$E1a(Azz95A{{I6r   c                    \        R 4      P                  4       p\        P                  ! V4      P                  ^ ,          pV P                  V^^4       V P                  VP                  ^,          ^^4       R# )zT
            from x.y.z import (
                a, b, c as c
            )
        N)r   r  r'   r(   r   r  r   )r8   r4  r  s   &  r   test_import_from_multi_line,EndPositionTests.test_import_from_multi_lineH  sc       UW	 	

 iil"CA&CIIaL!R0r   c                   R pRp\        R4      P                  4       p\        V P                  WV34      w  rEpV P	                  WP
                  R4       V P	                  WP
                  P                  R4       V P	                  W%P                  P                  R4       V P	                  W%P                  P                  R4       V P	                  W6P                  P                  ^ ,          P                  R4       V P	                  W6P                  P                  ^,          P                  R4       V P                  V^^4       R	# )
zf()[1, 2] [0]zx[ a.b: c.d]zN
            x[ a.b: f () ,
               g () : c.d
              ]
        z	f()[1, 2]z1, 2za.bzc.df ()g ()N)r   r  mapr  r  r_   r   r   r   eltsr  )r8   s1s2smi1i2r   s   &      r   test_slicesEndPositionTests.test_slicesR  s       UW	 	
 **RRL9
B+6B7B6B6Ba 0 6 6?Ba 0 6 6?B1%r   c                <   \        R 4      P                  4       pV P                  V4      pV P                  V^^4       V P	                  WP
                  R4       V P	                  WP                  R4       V P	                  WP                  P
                  R4       R# )zF
            (1 * 2 + (3 ) +
                 4
            )
        4z1 * 2 + (3 )3N)r   r  r  r  r  rX  rV  )r8   r4  r  s   &  r   
test_binopEndPositionTests.test_binopc  s       UW	 	

 !!!$E1a(A{{C0Azz>:Azz//5r   c                   \        R 4      P                  4       p\        P                  ! V4      P                  ^ ,          P
                  pV P                  V^^,4       V P                  WP                  ^,          R4       R# )z{
            if (one_condition and
                    (other_condition or yet_another_one)):
                pass
        z"other_condition or yet_another_oneN)	r   r  r'   r(   r   r,   r  r  r  )r8   r4  bops   &  r   r#  EndPositionTests.test_boolopo  sk       UW	 	

 iil"''CB'Azz!}@	Br   c                   R pRpRp\        R4      P                  4       p\        V P                  WW434      w  rVrxV P	                  WR4       V P	                  W&R4       V P	                  W7R4       V P                  V^^4       R# )zx = () ;z	x = 1 , ;zx = (1 , 2 ) ;z?
            x = (
                a, b,
            )
        rX  z1 ,z(1 , 2 )N)r   r  r;  r  r  r  )	r8   r=  r>  s3r?  t1t2t3tms	   &        r   test_tuplesEndPositionTests.test_tuplesz  s       UW	 	
 T..0@ABD)BE*BJ/B1%r   c                    R pV P                  V4      pV P                  WV4       V P                  WP                  ^ ,          R4       R# )zfunc(x. y .z)zx. y .zN)r  r  r*  r  s   &  r   test_attribute_spaces&EndPositionTests.test_attribute_spaces  s?      #AQ'Ayy|Y7r   c                   R p\         P                  ! V4      P                  ^ ,          P                  pV P	                  \        V4      P                  R4       V P                  WR4       RV,           p\         P                  ! V4      P                  ^ ,          P                  P                  pV P	                  \        V4      P                  R4       V P                  W2R4       R# )z( ( ( a + b ) ) )r[  za + bawait N)r'   r(   r   r_   rZ   rI   r;   r  )r8   r4  r\  r>  s   &   r   test_redundant_parenthesis+EndPositionTests.test_redundant_parenthesis  s    IIaLa &&a))73A'*\IIbMq!''--a))73B7+r   c                X   RpV EF  w  r#V P                  V4      ;_uu_ 4        \        P                  ! V4      P                  ^ ,          P                  pV P                  \        V4      P                  V4       V P                  W$V4       RV,           p\        P                  ! V4      P                  ^ ,          P                  P                  pV P                  \        V4      P                  V4       V P                  WTV4       RRR4       EK  	  R#   + '       g   i     EK$  ; i)( ( ( a ) ) ) ( )rX  N))r\  r@  )z( ( ( a ) ) ) ( b )r@  )z( ( ( a ) ) ) [ b ]ry  )z( ( ( a ) ) ) . bru  )	r   r'   r(   r   r_   rZ   rI   r;   r  )r8   rw  r4  r   r\  r>  s   &     r   (test_trailers_with_redundant_parenthesis9EndPositionTests.test_trailers_with_redundant_parenthesis  s    
 DAaIIaL%%a(..  a!1!115##A!,\IIbM&&q)//55  a!1!115##B1- !  s   C$DD)c                   R pRpV P                  V4      pV P                  V4      pV P                  WP                  ^ ,          R4       V P                  WP                  ^,          R4       V P                  WP                  ^,          R4       V P                  W$P                  ^,          R4       V P                  W$P                  ^,          R4       R# )z[{}, {1, }, {1, 2,} ]z{a: b, f (): g () ,}z{}z{1, }z{1, 2,}r9  r:  N)r  r  r<  r  r  )r8   r=  r>  c1c2s   &    r   test_displaysEndPositionTests.test_displays  s    $#r"r"B
D1B
G4B
I6B
F3B		!f5r   c                2   \        R 4      P                  4       pV P                  V4      pV P                  V^^%4       V P	                  WP
                  ^ ,          P                  R4       V P	                  WP                  P
                  ^ ,          P                  R4       V P	                  WP                  P
                  ^ ,          P                  ^ ,          R4       V P	                  WP                  P
                  ^ ,          P                  R4       R# )za
            x = [{x for x, y in stuff
                  if cond.x} for stuff in things]
        thingsstuffzcond.xr#  N)
r   r  r  r  r  
generatorsrr  eltifsrq  )r8   r4  cmps   &  r   test_comprehensions$EndPositionTests.test_comprehensions  s       UW 	
 "CB'A~~a055x@Aww11!4997CAww11!488;XFAww11!4;;VDr   c                :   \        R 4      P                  4       p\        P                  ! V4      P                  ^ ,          pV P                  WP                  ^ ,          P                  R4       V P                  WP                  ^,          P                  R4       R# )zT
            async def f():
                yield x
                await y
        zyield xzawait yN)r   r  r'   r(   r   r  r_   r  s   &  r   test_yield_await!EndPositionTests.test_yield_await  ss       UW	 	

 yy|  #Ayy|119=Ayy|119=r   c                    \        R 4      P                  4       p\        R4      P                  4       pV P                  V4      pV P                  \        P
                  ! WP                  4      V4       R# )zD
            x = (
                a, b,
            ) + ()
        z;
            (
                a, b,
            )
        N)r   r  r  rZ   r'   r  rV  )r8   s_origs_tupler  s   &   r   test_source_segment_multi*EndPositionTests.test_source_segment_multi  sk       UW	 	
    UW	 	
 !!&)//

CWMr   c                    \        R 4      P                  4       pRp\        P                  ! V4      P                  ^ ,          pV P                  \        P                  ! WP                  ^ ,          RR7      V4       R# )uf   
            class C:
                def fun(self) -> None:
                    "ЖЖЖЖЖ"
        u/       def fun(self) -> None:
        "ЖЖЖЖЖ"TpaddedNr   r  r'   r(   r   rZ   r  )r8   rq  s_methodr  s   &   r   test_source_segment_padded+EndPositionTests.test_source_segment_padded  se       UW	 	
*yy %%a(//		!TR!	#r   c                   R p\         P                  ! V4      P                  w  r#rEpV P                  WR4       V P                  WR4       V P                  WR4       V P                  WR4       V P                  WR4       R# )z!v = 1
w = 1
x = 1
y = 1z = 1
zv = 1zw = 1r  zy = 1zz = 1N)r'   r(   r   r  )r8   r4  r\  ro  rl   r  r  s   &      r   test_source_segment_endings,EndPositionTests.test_source_segment_endings  sp    7		!))aAA'*A'*A'*A'*A'*r   c                    \        R 4      P                  4       pRp\        P                  ! V4      P                  ^ ,          pV P                  \        P                  ! WP                  ^ ,          RR7      V4       R# )zb
            class C:
              	  def fun(self) -> None:
              	      pass
        z+  	  def fun(self) -> None:
  	      passTrv  Nrx  )r8   r4  ry  r  s   &   r   test_source_segment_tabs)EndPositionTests.test_source_segment_tabs  sc       UW	 	

& yy|  #//99Q<MxXr   c                N   R p\         P                  ! V4      P                  w  r#pV P                  WR4       V P                  WR4       V P                  WR4       Rp\         P                  ! V4      P                  ^ ,          pV P                  WVP	                  4       4       R# )z3def f():
  pass
def g():  pass
def h():
  pass
zdef f():
  passzdef g():  passzdef h():
  passz"def f():
  a = 1  b = 2
  c = 3
N)r'   r(   r   r  rstrip)r8   r4  r  rA  hs   &    r   test_source_segment_newlines-EndPositionTests.test_source_segment_newlines  s    J))A,##aA"45A"45A"675IIaLa A!((*-r   c                   R p\         P                  ! V4      P                  w  r#rEV=V=V=V=V P                  \         P                  ! W4      4       V P                  \         P                  ! W4      4       V P                  \         P                  ! W4      4       V P                  \         P                  ! W4      4       R# )zv = 1
w = 1
x = 1
y = 1
N)	r'   r(   r   rU   r   rV   r   r   r  )r8   r4  r\  ro  rl   r  s   &     r    test_source_segment_missing_info1EndPositionTests.test_source_segment_missing_info  s    0YYq\&&
aHLL#0067#0067#0067#0067r   r    N)%r;   r<   r=   r>   r  r  r  r.  r  rr  r  r  r  r  r   r)  r.  r3  r6  rB  rG  r#  rR  rU  rY  r]  rb  rk  rn  rs  rz  r}  r  r  r  r@   rA   rB   s   @r   r  r  
  s     BL*
5B =(;F
11*GX/7 1&"
6	B&8,."	6
E>N
#+
Y	.
8 
8r   r  c                   D   a  ] tR tRt o R tR tR tR tR tR t	Rt
V tR	# )
NodeTransformerTestsi  c                    \         P                  ! \        V4      4      p\         P                  ! \        V4      4      pV! 4       p\         P                  ! VP	                  V4      4      pV P                  Wu4       R # r   )r'   r(   r   rr  visitassertASTEqual)r8   transformer_classinitial_codeexpected_codeinitial_astexpected_asttransformer
result_asts   &&&&    r   assertASTTransformation,NodeTransformerTests.assertASTTransformation  sY    ii| 45yy!67')..{/@/@/MN
J5r   c                d    R pRp ! R R\         P                  4      pV P                  W1V4       R# )zdef func(arg) -> SomeType: ...zdef func(arg): ...c                   2   a  ] tR tRt o V 3R lR ltRtV tR# )ENodeTransformerTests.test_node_remove_single.<locals>.SomeTypeRemoveri#  c                4   < V ^8  d   QhRS[ P                  /# r   rL   )r'   r   )r   rC   s   "r   r   RNodeTransformerTests.test_node_remove_single.<locals>.SomeTypeRemover.__annotate__$        sxx r   c                N    V P                  V4       VP                  R 8X  d   R# V# )SomeTypeN)generic_visitr   r  s   &&r   
visit_NamePNodeTransformerTests.test_node_remove_single.<locals>.SomeTypeRemover.visit_Name$  s$    ""4(77j(r   r    N)r;   r<   r=   r>   r  r@   rA   rB   s   @r   SomeTypeRemoverr  #        r   r  Nr'   NodeTransformerr  )r8   r   r   r  s   &   r   test_node_remove_single,NodeTransformerTests.test_node_remove_single  s0    /'	c11 	 	$$_HEr   c                d    R pRp ! R R\         P                  4      pV P                  W1V4       R# )zM
        def func(arg):
            print(arg)
            yield arg
        7
        def func(arg):
            print(arg)
        c                   2   a  ] tR tRt o V 3R lR ltRtV tR# )ENodeTransformerTests.test_node_remove_from_list.<locals>.YieldRemoveri9  c                4   < V ^8  d   QhRS[ P                  /# r  )r'   r   )r   rC   s   "r   r   RNodeTransformerTests.test_node_remove_from_list.<locals>.YieldRemover.__annotate__:  r  r   c                    V P                  V4       \        VP                  \        P                  4      '       d   R # V# r   )r  rH   r_   r'   rc  r  s   &&r   
visit_ExprPNodeTransformerTests.test_node_remove_from_list.<locals>.YieldRemover.visit_Expr:  s-    ""4(djj#))44r   r    N)r;   r<   r=   r>   r  r@   rA   rB   s   @r   YieldRemoverr  9  r  r   r  Nr  )r8   r   r   r  s   &   r   test_node_remove_from_list/NodeTransformerTests.test_node_remove_from_list,  s4    
	3.. 	 	$$\Br   c                d    R pRp ! R R\         P                  4      pV P                  W1V4       R# )z0
        class DSL(Base, kw1=True): ...
        zE
        class DSL(Base, kw1=True, kw2=True, kw3=False): ...
        c                   2   a  ] tR tRt o V 3R lR ltRtV tR# )BNodeTransformerTests.test_node_return_list.<locals>.ExtendKeywordsiJ  c                4   < V ^8  d   QhRS[ P                  /# r  )r'   ru  )r   rC   s   "r   r   ONodeTransformerTests.test_node_return_list.<locals>.ExtendKeywords.__annotate__K  s      #++ r   c                    V P                  V4       VP                  R 8X  dX   V\        P                  ! R\        P                  ! R4      4      \        P                  ! R\        P                  ! R4      4      .# V# )kw1kw2Tkw3F)r  r0  r'   ru  r   r  s   &&r   visit_keywordPNodeTransformerTests.test_node_return_list.<locals>.ExtendKeywords.visit_keywordK  s^    ""4(88u$E3<<+=>E3<<+>? 
 r   r    N)r;   r<   r=   r>   r  r@   rA   rB   s   @r   ExtendKeywordsr  J  s      r   r  Nr  )r8   r   r   r  s   &   r   test_node_return_list*NodeTransformerTests.test_node_return_listB  s4    		S00 		 	$$^8Dr   c                d    R pRp ! R R\         P                  4      pV P                  W1V4       R# )r  z5
        def func(arg):
            log(arg)
        c                   2   a  ] tR tRt o V 3R lR ltRtV tR# )9NodeTransformerTests.test_node_mutate.<locals>.PrintToLogia  c                4   < V ^8  d   QhRS[ P                  /# r  r'   r@  )r   rC   s   "r   r   FNodeTransformerTests.test_node_mutate.<locals>.PrintToLog.__annotate__b  r  r   c                    V P                  V4       \        VP                  \        P                  4      '       d-   VP                  P
                  R 8X  d   RVP                  n        V# )printlog)r  rH   r>  r'   r   r   r  s   &&r   
visit_CallDNodeTransformerTests.test_node_mutate.<locals>.PrintToLog.visit_Callb  sD    ""4(dii22tyy||w7N#(DIILr   r    Nr;   r<   r=   r>   r  r@   rA   rB   s   @r   
PrintToLogr  a  r  r   r  Nr  r8   r   r   r  s   &   r   test_node_mutate%NodeTransformerTests.test_node_mutateW  s4    
	,, 	 	$$Zx@r   c                d    R pRp ! R R\         P                  4      pV P                  W1V4       R# )r  zH
        def func(arg):
            logger.log(arg, debug=True)
        c                   2   a  ] tR tRt o V 3R lR ltRtV tR# ):NodeTransformerTests.test_node_replace.<locals>.PrintToLogit  c                4   < V ^8  d   QhRS[ P                  /# r  r  )r   rC   s   "r   r   GNodeTransformerTests.test_node_replace.<locals>.PrintToLog.__annotate__u  s      sxx r   c           
        V P                  V4       \        VP                  \        P                  4      '       d   VP                  P
                  R 8X  d   \        P                  ! \        P                  ! \        P                  ! R\        P                  ! 4       R7      R\        P                  ! 4       R7      VP                  \        P                  ! R\        P                  ! R4      4      .R7      # V# )r  loggerr)  r  )rc  r  debugT)r>  r*  rK  )r  rH   r>  r'   r   r   r@  ru  rq  r*  ru  r   r  s   &&r   r  ENodeTransformerTests.test_node_replace.<locals>.PrintToLog.visit_Callu  s    ""4(dii22tyy||w7N88 ]]HHX388:>!& #

 "YY"%++gs||D7I"J!K  r   r    Nr  rB   s   @r   r  r  t  s      r   r  Nr  r  s   &   r   test_node_replace&NodeTransformerTests.test_node_replacej  s4    
	,, 	 	$$Zx@r   r    N)r;   r<   r=   r>   r  r  r  r  r  r  r@   rA   rB   s   @r   r  r    s.     6FC,E*A&A Ar   r  c                   V   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tRtV tR# )ASTConstructorTestsi  c                >   \         P                  ! 4       pV P                  VP                  . 4       V P                  VP                  . 4       V P                  \        R 4      ;_uu_ 4        \         P                  ! VR7      pRRR4       V P                  XR4       V P                  VP                  . 4       \         P                  ! RVR7      pV P                  VP                  R4       V P                  VP                  . 4       R#   + '       g   i     L; i)zDFunctionDef\.__init__ missing 1 required positional argument: 'name'r  NrK   r
  r  )r'   r/  rZ   r*  r)  r  r<  r  assertNotHasAttrrP   rK   )r8   r*  rL   s   &  r   test_FunctionDef$ASTConstructorTests.test_FunctionDef  s    }}B'))2.""#5#jl l??-Dl 	dF+,,b1E5E*,,b1l ls   ,DD	c                    \         P                  ! R 4      pV P                  VP                  R 4       V P	                  VP
                  \         P                  4       \         P                  ! R \         P                  ! 4       4      pV P                  VP                  R 4       V P	                  VP
                  \         P                  4       \         P                  ! R \         P                  ! 4       R7      pV P                  VP                  R 4       V P	                  VP
                  \         P                  4       V P                  \        R4      ;_uu_ 4        \         P                  ! 4       pRRR4       R#   + '       g   i     R# ; i)rl   r)  z;Name\.__init__ missing 1 required positional argument: 'id'N)r'   r   rZ   r   r   r  rq  r  Delr  r<  )r8   rK   name2name3s   &   r   test_expr_context%ASTConstructorTests.test_expr_context  s    xx}#&dhh1ciik*3'eii3#''),3'eii1""#5#ac cHHJEc c c cs   E<<F	c                     ! R  R\         P                  4      pV! 4       pV P                  W!4       V P                  VP                  / 4       R# )c                       ] tR tRtRtR# )GASTConstructorTests.test_custom_subclass_with_no_fields.<locals>.NoIniti  r    Nr}   r    r   r   NoInitr    r   r   r  N)r'   rG   r   rZ   rf   )r8   r  objs   &  r   #test_custom_subclass_with_no_fields7ASTConstructorTests.test_custom_subclass_with_no_fields  s=    	SWW 	 hc*r*r   c                    ! R  R\         P                  4      pV! 4       pV P                  \        4      ;_uu_ 4        VP                   RRR4       V! ^R7      pV P                  VP                  ^4       R#   + '       g   i     L7; i)c                       ] tR tRtRtRtR# )BASTConstructorTests.test_fields_but_no_field_types.<locals>.Fieldsi  r    Nr   )r;   r<   r=   r>   rQ   r@   r    r   r   Fieldsr    s    Gr   r  Nr  )r'   rG   rg   rh   r   rZ   )r8   r  r  s   &  r   test_fields_but_no_field_types2ASTConstructorTests.test_fields_but_no_field_types  s^    	SWW 	 h~..EE /qk" /.s   A::B
	c                     ! R  R\         P                  4      pV! 4       pV P                  VP                  R4       V! ^R7      pV P	                  VP                  ^4       R# )c                   J   a  ] tR tRt o RtR]R,          /tRtV 3R ltRt	V t
R# )AASTConstructorTests.test_fields_and_types.<locals>.FieldsAndTypesi  r   Nc                4   < V ^8  d   Qh/ S[ R,          ;R&   # )r   Nr   r!  )r   rC   s   "r   r   NASTConstructorTests.test_fields_and_types.<locals>.FieldsAndTypes.__annotate__  s      Tz  r   r    r  )r;   r<   r=   r>   rQ   r!  _field_typesr   __annotate_func__r@   rA   rB   s   @r   FieldsAndTypesr    s$     Gt,L A  r   r  Nr  )r'   rG   r  r   rZ   )r8   r  r  s   &  r   test_fields_and_types)ASTConstructorTests.test_fields_and_types  sL    	!SWW 	!
 ceeT"q!"r   c                D    ! R  R\         P                  4      pV! ^^R7      pV P                  VP                  ^4       V P                  VP                  ^4       V P                  \        R4      ;_uu_ 4        V! ^R7      pRRR4       R#   + '       g   i     R# ; i)c                       ] tR tRtRtRtR# );ASTConstructorTests.test_custom_attributes.<locals>.MyAttrsi  r    Nr  )r;   r<   r=   r>   r  r@   r    r   r   MyAttrsr    s    $Kr   r  r  z8MyAttrs.__init__ got an unexpected keyword argument 'c'.)r_  N)r'   rG   rZ   r   r  r  r<  )r8   r  r  s   &  r   test_custom_attributes*ASTConstructorTests.test_custom_attributes  s    	%cgg 	% Q""""#5#^` `A,C` ` ` `s   :
BB	c                    ! R  R\         P                  4      pV P                  \        R4      ;_uu_ 4        V! 4       pRRR4       V P	                  \
        4      ;_uu_ 4        XP                   RRR4       V! ^R7      pV P                  VP                  ^4       R#   + '       g   i     Li; i  + '       g   i     LJ; i)c                   "    ] tR tRtRtR]/tRtR# )UASTConstructorTests.test_fields_and_types_no_default.<locals>.FieldsAndTypesNoDefaulti  r   r    Nr  )r;   r<   r=   r>   rQ   r!  r  r@   r    r   r   FieldsAndTypesNoDefaultr    s    G:Lr   r  zOFieldsAndTypesNoDefault\.__init__ missing 1 required positional argument: 'a'\.Nr  )r'   rG   r  r<  rg   rh   r   rZ   )r8   r  r  s   &  r    test_fields_and_types_no_default4ASTConstructorTests.test_fields_and_types_no_default  s    	&cgg 	& ""#5#uw w)+Cw ~..EE /%*"w w /.s   B!%B4!B1	4C	c                    ! R  R\         P                  4      pV P                  \        R4      ;_uu_ 4        V! 4       pRRR4       V P	                  XP
                  R4       V P	                  VP                  R4       V! ^^R7      pV P                  VP
                  ^4       V P                  VP                  ^4       R#   + '       g   i     L; i)c                   N   a  ] tR tRt o RtR]R,          /tRtRtV 3R lt	Rt
V tR# )LASTConstructorTests.test_incomplete_field_types.<locals>.MoreFieldsThanTypesi  r   Nc                N   < V ^8  d   Qh/ S[ R,          ;R&   S[ R,          ;R&   # r   Nr   r  r  )r   rC   s   "r   r   YASTConstructorTests.test_incomplete_field_types.<locals>.MoreFieldsThanTypes.__annotate__  s'      Tz   Tz 	 r   r    r  )r;   r<   r=   r>   rQ   r!  r  r   r  r   r@   rA   rB   s   @r   MoreFieldsThanTypesr    s)      Gt,L A A	  r   r  z;Field 'b' is missing from MoreFieldsThanTypes\._field_typesNr  )r'   rG   r  r<  r  r   r  rZ   )r8   r  r  s   &  r   test_incomplete_field_types/ASTConstructorTests.test_incomplete_field_types  s    	!#'' 	! ""J
 
 &'C	

 	ceeT"ceeT"!A+""
 
s   CC	c                     ! R  R\         P                  4      pV! 4       pV P                  VP                  R4       V P	                  VP
                  . 4       R# )c                   \   a  ] tR tRt o RtR]R,          R]],          /tRt	V 3R lt
RtV tR# )EASTConstructorTests.test_complete_field_types.<locals>._AllFieldTypesi  r   r  Nc                P   < V ^8  d   Qh/ S[ R,          ;R&   S[S[,          ;R&   # r  )r!  r   r   )r   rC   s   "r   r   RASTConstructorTests.test_complete_field_types.<locals>._AllFieldTypes.__annotate__  s&      Tz 	  CyL r   r    r  )r;   r<   r=   r>   rQ   r!  r   r   r  r   r   r@   rA   rB   s   @r   _AllFieldTypesr    s,      GtS$s)<L A	  r   r  N)r'   rG   r  r   rZ   r  )r8   r  r  s   &  r   test_complete_field_types-ASTConstructorTests.test_complete_field_types  sB    	SWW 	 ceeT"#r   r    N)r;   r<   r=   r>   r  r  r  r  r  r  r  r  r  r@   rA   rB   s   @r   r  r    s7     2"+#	#
##&$ $r   r  c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )ModuleStateTestsi  c                    R pRpRp\        WV\        P                  R7      p\        WBV4      pV P                  V\        P
                  4       R# )zx + 1r   r   flagsN)r   r'   r   r   typesCodeType)r8   r   filenamer  r   s   &    r   check_ast_module!ModuleStateTests.check_ast_module  sI     44s7H7HI x40dENN3r   c                \   \         P                  ! \        P                  R R4      ;_uu_ 4        \        P                  R  ^ RIp\        P                  R  ^ RIpV P                  4        RRR4       ??\         P                  ! 4        V P                  4        R#   + '       g   i     L9; i)_astN)r   	swap_itemsysmodulesr,  r)  r   )r8   ast1r  s   &  r   test_reload_module#ModuleStateTests.test_reload_module  ss    s{{FD99F#F#!!# :  :9s   ;BB+	c           	       a \        4       oV3R  lp\        P                  ! \        P                  RR4      ;_uu_ 4        \        P                  R \        P
                  ! \        RV4      ;_uu_ 4        V P                  4        V P                  R\        P                  4       ^ RI	pV P                  VS4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)c                 .   < S\         P                  V &   S# r   )r.  r/  )rK   r*  r  lazy_mods   &*,r   	my_import4ModuleStateTests.test_sys_modules.<locals>.my_import&  s     (CKKOr   r,  N
__import__)r"  r   r-  r.  r/  r  r   r)  assertNotInr,  r  )r8   r6  r,  r5  s   &  @r   test_sys_modules!ModuleStateTests.test_sys_modules!  s     8	 s{{FD99F#""8\9EE%%'  5 dH- F :9 FE :99s%    6C"6AC	=C"CC""C3	c                l    \        R 4      p\        P                  ! V4      pV P                  V^ 4       R# )ap  
            import _ast
            import ast
            import gc
            import sys
            import types

            # Create _ast.AST subclasses instances and call PyAST_Check()
            ast_tree = compile('x+1', '<string>', 'eval',
                               flags=ast.PyCF_ONLY_AST)
            code = compile(ast_tree, 'string', 'eval')
            if not isinstance(code, types.CodeType):
                raise AssertionError

            # Unloading the _ast module must not crash.
            del ast, _ast
            del sys.modules['ast'], sys.modules['_ast']
            gc.collect()
        N)r   r   run_in_subinterprZ   )r8   r   r   s   &  r   test_subinterpreter$ModuleStateTests.test_subinterpreter6  s5       & &&t,a r   r    N)
r;   r<   r=   r>   r)  r1  r:  r>  r@   rA   rB   s   @r   r"  r"    s     4 $.*! !r   r"  c                      a  ] tR tRt o R t]R 4       tR tR tR t	]
P                  ! R4      R 4       t]
P                  R	 4       tR
 tR tR tR tR tR tR tR tR tR tR tRtV tR# )CommandLineTestsiP  c                    \         P                  ! 4       V n        V P                  \        P
                  V P                  4       R # r   )tempfilemktempr(  ru   r   unlinkr7   s   &r   setUpCommandLineTests.setUpQ  s(     )	(($--8r   c                J    \         P                  ! V 4      P                  4       # r   )r   r   r  )r  s   &r   text_normalizeCommandLineTests.text_normalizeU  s    v&,,..r   c                l    \        V P                  4      P                  V P                  V4      4       R # r   )r   r(  r*   rI  )r8   r  s   &&r   
set_sourceCommandLineTests.set_sourceY  s$    T]]&&t':':7'CDr   c           	        \        4       p\        4       p\        P                  ! V4      ;_uu_ 4        \        P                  ! V4      ;_uu_ 4        \        P
                  ! . VOV P                  NR 7       RRR4       RRR4       V P                  VP                  4       R4       VP                  4       P                  4       #   + '       g   i     LV; i  + '       g   i     La; i)r  Nr  )
r   r5   redirect_stdoutredirect_stderrr'   mainr(  rZ   getvaluer  )r8   r%  stderrstdouts   &*  r   
invoke_astCommandLineTests.invoke_ast\  s    &&v..&&v..HH1E14==12 / / 	*B/ &&((	 /. /.s#   C&C	8CCCC)	c                    V P                  V4       V P                  ! V!  pV P                  V4      pV P                  WB4       R # r   )rL  rU  rI  rZ   )r8   r  expectr%  r   s   &&&* r   check_outputCommandLineTests.check_outputg  s:    oou%$$V,%r   r  c           
     r   RpV P                  R4       \        ^\        V4      ^,           4       Fo  p\        P                  ! WR7       FQ  p\        P
                  ! V!   F6  pV P                  VR7      ;_uu_ 4        V P                  ! V!   RRR4       K8  	  KS  	  Kq  	  R#   + '       g   i     KU  ; i)-m=execzv
            print(1, 2, 3)
            def f(x: int) -> int:
                x -= 1
                return x
        )r  r$  N)r\  z--mode=exec)--no-type-commentsr^  z-az--include-attributes)z-i=4z
--indent=4)--feature-version=3.13r`  )-O=-1--optimize=-1)--show-emptyrc  )rL  r1  r   	itertoolscombinationsproductr   rU  )r8   
base_flagsr  choicesr*  s   &    r   test_invocation CommandLineTests.test_invocationm  s    

 	  	 q#j/A-.A$11*B%--w7DD11. 21 8 C / 211s   >B%%B6c                   R F  pV P                  VR7      ;_uu_ 4        \        4       pV P                  \        4      ;_uu_ 4        \        P
                  ! V4      ;_uu_ 4        \        P                  ! VR7       RRR4       RRR4       V P                  VP                  4       R4       RRR4       K  	  R#   + '       g   i     LF; i  + '       g   i     LQ; i  + '       g   i     K  ; i)-hflagr  Nzusage: )rl  z--helpz	--unknown)
r   r   rg   
SystemExitr5   rP  r'   rQ  assertStartsWithrR  )r8   rn  r   s   &  r   test_help_message"CommandLineTests.test_help_message  s    1D4((!&&z22#33F;;d+ < 3 %%foo&7C )( 2 <; 32 )((s;   (C#C'B=?C(C#=CCC C##C4c                    R pRpR F8  pV P                  VR7      ;_uu_ 4        V P                  WV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)&x: bool = 1 # type: ignore[assignment]an  
            Module(
               body=[
                  AnnAssign(
                     target=Name(id='x', ctx=Store()),
                     annotation=Name(id='bool', ctx=Load()),
                     value=Constant(value=1),
                     simple=1)],
               type_ignores=[
                  TypeIgnore(lineno=1, tag='[assignment]')])
        rm  Nr]  r   rY  r8   r  rX  rn  s   &   r   test_exec_mode_flag$CommandLineTests.test_exec_mode_flag  sM    9
 /D4((!!&$7 )( /(((   AAc                    R pRpR F8  pV P                  VR7      ;_uu_ 4        V P                  WV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)r  zS
            Interactive(
               body=[
                  Pass()])
        rm  N)z	-m=singlez--mode=singleru  rv  s   &   r   test_single_mode_flag&CommandLineTests.test_single_mode_flag  sM    
 3D4((!!&$7 )( 3(((ry  c                    R pRpR F8  pV P                  VR7      ;_uu_ 4        V P                  WV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)print(1, 2, 3)a  
            Expression(
               body=Call(
                  func=Name(id='print', ctx=Load()),
                  args=[
                     Constant(value=1),
                     Constant(value=2),
                     Constant(value=3)]))
        rm  N)z-m=evalz--mode=evalru  rv  s   &   r   test_eval_mode_flag$CommandLineTests.test_eval_mode_flag  sM    ! /D4((!!&$7 )( /(((ry  c                    R pRpR F8  pV P                  VR7      ;_uu_ 4        V P                  WV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)z(int, str) -> list[int]aD  
            FunctionType(
               argtypes=[
                  Name(id='int', ctx=Load()),
                  Name(id='str', ctx=Load())],
               returns=Subscript(
                  value=Name(id='list', ctx=Load()),
                  slice=Name(id='int', ctx=Load()),
                  ctx=Load()))
        rm  N)z-m=func_typez--mode=func_typeru  rv  s   &   r   test_func_type_mode_flag)CommandLineTests.test_func_type_mode_flag  sM    *	 9D4((!!&$7 )( 9(((ry  c                2    R pRpV P                  WR4       R# )rt  a  
            Module(
               body=[
                  AnnAssign(
                     target=Name(id='x', ctx=Store()),
                     annotation=Name(id='bool', ctx=Load()),
                     value=Constant(value=1),
                     simple=1)])
        r^  NrY  r8   r  rX  s   &  r   test_no_type_comments_flag+CommandLineTests.test_no_type_comments_flag  s!    9 	&*>?r   c                    R pRpR F8  pV P                  VR7      ;_uu_ 4        V P                  WV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)r  z
            Module(
               body=[
                  Pass(
                     lineno=1,
                     col_offset=0,
                     end_lineno=1,
                     end_col_offset=4)])
        rm  Nr_  ru  rv  s   &   r   test_include_attributes_flag-CommandLineTests.test_include_attributes_flag  sM     3D4((!!&$7 )( 3(((ry  c                    R pRpR F8  pV P                  VR7      ;_uu_ 4        V P                  WV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)r  zE
            Module(
            body=[
            Pass()])
        rm  N)z-i=0z
--indent=0ru  rv  s   &   r   test_indent_flag!CommandLineTests.test_indent_flag  sM    
 +D4((!!&$7 )( +(((ry  c                    R pRpV P                  WR4       V P                  \        4      ;_uu_ 4        V P                  R4       RRR4       R#   + '       g   i     R# ; i)zO
            match x:
                case 1:
                    pass
        ax  
            Module(
               body=[
                  Match(
                     subject=Name(id='x', ctx=Load()),
                     cases=[
                        match_case(
                           pattern=MatchValue(
                              value=Constant(value=1)),
                           body=[
                              Pass()])])])
        z--feature-version=3.10z--feature-version=3.9N)rY  rg   r  rU  r  s   &  r   test_feature_version_flag*CommandLineTests.test_feature_version_flag  sP    
 	&*BC{++OO34 ,+++s   AA!	c                    R pRpR F8  pV P                  VR7      ;_uu_ 4        V P                  WV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)R
            match a:
                case 1+2j:
                    pass
        a  
            Module(
               body=[
                  Match(
                     subject=Name(id='a', ctx=Load()),
                     cases=[
                        match_case(
                           pattern=MatchValue(
                              value=BinOp(
                                 left=Constant(value=1),
                                 op=Add(),
                                 right=Constant(value=2j))),
                           body=[
                              Pass()])])])
        rm  N)ra  rb  z-O=0z--optimize=0ru  rv  s   &   r   test_no_optimize_flag&CommandLineTests.test_no_optimize_flag  sQ    
 GD4((!!&$7 )( G(((ry  c                    R pRpR F8  pV P                  VR7      ;_uu_ 4        V P                  WV4       RRR4       K:  	  R#   + '       g   i     KO  ; i)r  a}  
            Module(
               body=[
                  Match(
                     subject=Name(id='a', ctx=Load()),
                     cases=[
                        match_case(
                           pattern=MatchValue(
                              value=Constant(value=(1+2j))),
                           body=[
                              Pass()])])])
        rm  N)z-O=1z--optimize=1z-O=2z--optimize=2ru  rv  s   &   r   test_optimize_flag#CommandLineTests.test_optimize_flag*  sQ    
 ED4((!!&$7 )( E(((ry  c                2    R pRpV P                  WR4       R# )r~  a  
            Module(
               body=[
                  Expr(
                     value=Call(
                        func=Name(id='print', ctx=Load()),
                        args=[
                           Constant(value=1),
                           Constant(value=2),
                           Constant(value=3)],
                        keywords=[]))],
               type_ignores=[])
        rc  Nr  r  s   &  r   test_show_empty_flag%CommandLineTests.test_show_empty_flagA  s     ! 	&.9r   )r(  N)r;   r<   r=   r>   rF  r  rI  rL  rU  rY  r   r  ri  force_not_colorizedrq  rw  r{  r  r  r  r  r  r  r  r  r  r@   rA   rB   s   @r   rA  rA  P  s     9 / /E	)& u%/ &/0   D !D8$
88 8"@8 
85.848.: :r   rA  c                   D   a  ] tR tRt o R tR tR tR tR tR t	Rt
V tR	# )
ASTOptimizationTestsiT  c                \    \         P                  ! \         P                  ! VR 7      .R7      # )r9  rv  )r'   r   r   )r8   rR   s   &&r   	wrap_exprASTOptimizationTests.wrap_exprU  s    zzt 4566r   c                2    \         P                  ! V.R 7      # )rv  )r'   r   )r8   	statements   &&r   wrap_statement#ASTOptimizationTests.wrap_statementX  s    zz	{++r   c                X   \         P                  ! VRR7      p\         P                  ! V^R7      pV P                  \         P                  ! WB4      \         P                  ! V4       R\         P                  ! V4       24       V P                  \         P                  ! WR4      \         P                  ! V4       R\         P                  ! V4       24       V P                  \         P                  ! WS4      \         P                  ! V4       R\         P                  ! V4       24       R# )r   r   z must equal z must not equal Nr   )r'   r(   rM  r  r  rN  )r8   r   non_optimized_targetoptimized_targetnon_optimized_treeoptimized_trees   &&&&  r   
assert_astASTOptimizationTests.assert_ast[  s     YYtb94!4 	KK*Axx,-.lxx*+,.	
 	KK=xx,-..>xx*+,.	
 	KK:xx()*,xx'(*	
r   c                   R pV P                  \        P                  ! \        P                  ! RR7      \        P                  ! 4       \        P
                  ! \        P                  ! RR7      .R7      R7      4      pV P                  \        P                  ! \        P                  ! \        P                  ! RR7      ^sR7      .R7      4      pV P                  WV4       R	# )
z'%s' % (a,)z%sr9  r   r  )r<  rZ  )r_   r8  )r  N)
r  r'   r[  r   Modr{  r   	JoinedStrFormattedValuer  )r8   r   r  r  s   &   r   test_folding_format(ASTOptimizationTests.test_folding_formatt  s    #~~II\\-779iichh#&6%78: 
  >>MM&&SXX-=#N
 	4DEr   c           	       a a	 V	V 3R  lo	. R^ .3NRR).3NR\        ^ ^ 4      .3NR\        ^ R)4      .3NR\        ^^4      .3NR\        ^R*4      .3NR\        R	R
4      .3NR\        R	R+4      .3NR\        ^ ^4      .3NR\        ^ R,4      .3NR\        R)R	4      .3NR\        R)R-4      .3NR^ .3NRR).3NR\        ^ ^ 4      .3NR\        ^ R)4      .3NR\        ^^4      .3NR\        ^R*4      .3NR\        R	R
4      .3NR\        R	R+4      .3NR\        ^ ^4      .3NR\        ^ R,4      .3NR\        R)R	4      .3NR\        R)R-4      .3NR^ \        ^ ^4      \        R^4      .3NR^ R)\        ^ ^ 4      \        ^ R)4      .3NR^ R)\        ^ ^ 4      \        ^ R)4      .3NR^ R)\        ^ ^ 4      \        ^ R)4      .3NR ^ R)\        ^ ^ 4      \        ^ R)4      .3NR!^ R)\        ^ ^ 4      \        ^ R)4      .3NR"^ R)\        ^ ^ 4      \        ^ R)4      .3NR#^ R)\        ^ ^ 4      \        ^ R)4      .3NR$^ R)\        ^ ^ 4      \        ^ R)4      .3NpV F  w  r#S P                  V4      ;_uu_ 4        R%V R&2p\        P                  ! V^R'7      pVP                  ^ ,          pVP
                  ^ ,          pS	! VP                  4      pS P                  W84       R(R(R(4       K  	  R(#   + '       g   i     K  ; i).c                 d  < . p\        V \        P                  4      '       d   VP                  V P                  4       V# \        V \        P
                  4      '       d$   VP                  S! V P                  4      4       V# \        V \        P                  4      '       d-   V P                   F  pVP                  S! V4      4       K  	  V# \        V \        P                  4      '       d-   V P                   F  pVP                  S! V4      4       K  	  V# SP                  R V  24       V# )zUnexpected node )rH   r'   r   rE  r_   r  r  r  r  r  r  fail)rL   r  keypatget_match_case_valuesr8   s   &   r   r  _ASTOptimizationTests.test_folding_match_case_allowed_expressions.<locals>.get_match_case_values  s    F$--djj) M D#..113DJJ?@ M D#"2"23399CMM"7"<= % M D#"3"344==CMM"7"<= ) M 		,TF34Mr   z-0z-0.1g?z-0jz-0.1jz1 + 2jz1 - 2jz
1.1 + 2.1jg?g @z
1.1 - 2.1jz-0 + 1jz-0 - 1jz-0.1 + 1.1jz-0.1 - 1.1jz{-0: 0}z	{-0.1: 0}z{-0j: 0}z
{-0.1j: 0}z{1 + 2j: 0}z{1 - 2j: 0}z{1.1 + 2.1j: 0}z{1.1 - 2.1j: 0}z{-0 + 1j: 0}z{-0 - 1j: 0}z{-0.1 + 1.1j: 0}z{-0.1 - 1.1j: 0}z{-0: 0, 0 + 1j: 0, 0.1 + 1j: 0}z[-0, -0.1, -0j, -0.1j]z[[[[-0, -0.1, -0j, -0.1j]]]]z[[-0, -0.1], -0j, -0.1j]z[[-0, -0.1], [-0j, -0.1j]]z(-0, -0.1, -0j, -0.1j)z((((-0, -0.1, -0j, -0.1j))))z((-0, -0.1), -0j, -0.1j)z((-0, -0.1), (-0j, -0.1j))zmatch 0:
	 case z: passr   Ngr   g r   g)complexr   r'   r(   r   r   rs  assertListEqual)
r8   rw  
match_exprr  r  r   
match_stmtcaser  r  s
   f        @r   +test_folding_match_case_allowed_expressions@ASTOptimizationTests.test_folding_match_case_allowed_expressions  s   	 "
A3K"
dV"
 WQ]O$"
 wq$'()	"

 1'"
 2'("
 GC-./"
 GC./0"
 A("
 B()"
 WT3/01"
 WT4012"
 "
 4&!"
 '!Q-)"
  GAt,-.!"
" WQ]O,#"
$ WQ^,-%"
& c!2 34'"
( d!3 45)"
* gam_-+"
, gan-.-"
.  '$"4!56/"
0  '$"5!671"
2 /GAqM73PQ?0ST3"
4 &4A4@P'QR5"
6 ,awq!}gaQUFV-WX7"
8 (!T71a='!TBR)ST9"
: *AtWQ]GAtDT+UV;"
< &4A4@P'QR="
> ,awq!}gaQUFV-WX?"
@ (!T71a='!TBR)STA"
B *AtWQ]GAtDT+UVC"
F &+!Jj))*:,f=yyq1!YYq\
!''*.t||<$$Y7 *) &+)))s   'A(KK.c                    \         P                  ! R 4      pRpRpR FH  pT P                  V'       d   TMT\        P                  ! \        P
                  ! WR7      4      4       KJ  	  R# )zV
            match a:
                case 1+2j:
                    pass
            zRMatchValue(value=BinOp(left=Constant(value=1), op=Add(), right=Constant(value=2j))z(MatchValue(value=Constant(value=(1+2j)))r   Nr   )r   r   ri  r'   r  r(   )r8   r  unfoldedfoldedr   s   &    r   -test_match_case_not_folded_in_unoptimized_astBASTOptimizationTests.test_match_case_not_folded_in_unoptimized_ast  sP    oo   h;FMMF&#((399SCb:cd  r   r    N)r;   r<   r=   r>   r  r  r  r  r  r  r@   rA   rB   s   @r   r  r  T  s,     7,
2F&;8z
e 
er   r  __main__z--snapshot-update)IrG  r'   r   r5   r  r  r2   rd  r  r1   r.  rC  r   r&  unittestr   ior   pathlibr   r   rY  ImportErrorr,   r   test.supportr   r   r	   test.support.ast_helperr
   test.support.import_helperr   test.test_ast.utilsr   test.test_ast.snippetsr   r   r   r   r   r   r  dirname__file__r  listdirendswithr  r  r  r)   r!   r-   TestCaser/   rE   r  r  r  r  r  r  r  r?   r"  rA  r  r;   r   argvexitrQ  )r  s   0r   <module>r     sa    
    
   	 	 
          " Q 0 : ( 
 
	&ZZ/F/r;;u3E/F   +-EF G(^**V3nD #3
gX&& glO!! lO^!XD!! XDt
f=h'' f=R{6)) {6|B'H%% B'Ja8x(( a8HqA<):): qAhu$(++ u$p 	N!x(( N! N!bA:x(( A:Hze8,, zez z
388}qSXXa[,??!#MMO	 wu   Gs   J J,$J,	J)(J)