a zet@sUddlmZmZmZddlZddlZddlZddlZddlTddlm Z ddl Z ddl m Z ddl mZddl Z gdZgdZGdd d ejZeed <Gd d d ZGd ddejZedkredS))check_syntax_errorcheck_syntax_warninguse_old_parserN)*)ChainMap) ann_module2)Z0_0_0Z4_2Z 1_0000_0000Z 0b1001_0100Z 0xffff_ffffZ0o5_7_7z 1_00_00.5z 1_00_00.5e5Z 1_00_00e5_1Z1e1_0z.1_4z.1_4e1Z0b_0Z0x_fZ0o_5Z1_00_00jz 1_00_00.5jZ 1_00_00e5_1jz.1_4jz (1_2.5+3_3j)z(.5_6j))(Z0_Z42_z1.4j_Z0x_0b1_Z0xf_Z0o5_z 0 if 1_Else 1Z0_b0Z0_xfZ0_o5Z0_7Z09_99Z 4_______2z0.1__4z0.1__4jZ 0b1001__0100Z 0xffff__ffffZ0x___Z0o5__77Z1e1__0Z1e1__0jz1_.4z1_.4jz1._4z1._4jz._5z._5jz1.0e+_1z1.0e+_1jz1.4_jz1.4e5_jZ1_e1z1.4_e1z1.4_e1jZ1e_1z1.4e_1z1.4e_1jz (1+1.5_j_)z (1+1.5_j)c@sheZdZddlmZddZddZddZd d Zd d Z d dZ ddZ ddZ ddZ ddZdS) TokenTestsrrcCs(d}||ddd}||dddS)Nzbackslash for line continuationrzbackslash ending comment assertEqualselfxrE/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_grammar.pytest_backslashjszTokenTests.test_backslashc Csf|tdtd|dd|dd|dd|dd|ttdddlm}|dkr|dd|ddk|ddk|ddkd D]2}z t|}Wqty| d |Yq0qn|d krT|d d |d dk|d dk|ddkdD]6}z t|}Wn"tyL| d |Yn0qn| d|dS)Nri 0x)maxsizeil)Z 2147483648Z 0o40000000000Z 0x100000000Z"0b10000000000000000000000000000000z(OverflowError on huge integer literal %rlll)Z9223372036854775808Z0o2000000000000000000000Z0x10000000000000000ZA0b100000000000000000000000000000000000000000000000000000000000000zWeird maxsize value %r) r type assertRaises SyntaxErrorevalsysr assertTrue OverflowErrorfail)rrsrrrrtest_plain_integersts8           zTokenTests.test_plain_integerscCs$d}d}d}d}d}d}d}d}dS)Nrrl?l ~l!]cllrrrrrtest_long_integersszTokenTests.test_long_integerscCs0d}d}d}d}d}d}d}d}d}d}d}dS)NgQ @gs@gjt?g Bgt =gWHBgF@rrrrr test_floatsszTokenTests.test_floatscCs6|dndd|drdndd|ttddS)Nrz 0 if 1Else 0)r rrrrrrr test_float_exponent_tokenizationsz+TokenTests.test_float_exponent_tokenizationc CsPtD] }|t|t|ddqtD]}|tt|q*|ttddS)N_Z_0)VALID_UNDERSCORE_LITERALSr rreplaceINVALID_UNDERSCORE_LITERALSrr NameError)rZlitrrrtest_underscore_literalss z#TokenTests.test_underscore_literalscCs|j}|dd|dd|dd|dd|dd|dd |d d |d d |d d |dd |dd|dd|dd|dd|dd|dd|dddS)NZ0b12z#invalid digit '2' in binary literalZ0b1_2Z0b2rzinvalid binary literalZ0bZ0o18z"invalid digit '8' in octal literalZ0o1_8Z0o8Z0o1_zinvalid octal literalZ0oZ0x1_zinvalid hexadecimal literalrZ1_zinvalid decimal literalZ012z`leading zeros in decimal integer literals are not permitted; use an 0o prefix for octal integersz1.2_Z1e2_z1e+r rcheckrrrtest_bad_numerical_literalss(               z&TokenTests.test_bad_numerical_literalscCs d}d}|t|dko||kd}d}|t|dkoL||koLt|dkd}d}|t|dkoz||kozt|dkd}d}|t|d ko||kd }d }|t|d ko||kd }d }|||d }|||d }|||d }|||dS) Nr)r'r%'""zdoesn't "shrink" does itzdoes "shrink" doesn't itz2 The "quick" brown fox jumps over the 'lazy' dog. )rlenordr rryrrrtest_string_literalss$"..   zTokenTests.test_string_literalscCs$d}||tu|ttddS)N.z.. .)rEllipsisrrrrrrr test_ellipsisszTokenTests.test_ellipsisc CsZd}|D]L}|t}t|ddWdn1s80Y|dt|jqdS)N)zdef foo(z def foo(z def foo( zexeczunexpected EOF)rrcompileZassertInstr exception)rZsamplesr!cmrrrtest_eof_errors  *zTokenTests.test_eof_errorN)__name__ __module__ __qualname__ test.supportrrr"r#r$r'r.r1r;r=rCrrrrr fs  $ (r Zvar_annot_globalc@s$eZdZddZddZddZdS)CNScCs i|_dSN_dctr&rrr__init__ sz CNS.__init__cCs||j|<dSrI)rKlowerritemvaluerrr __setitem__szCNS.__setitem__cCs |j|SrIrJrrOrrr __getitem__szCNS.__getitem__NrDrErFrLrQrSrrrrrH srHc@s eZdZddlmZmZddZddZddZd d Z d d Z d dZ ddZ ddZ ddZddZddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Z d9d:Z!d;d<Z"d=d>Z#d?d@Z$dAdBZ%dCdDZ&dEdFZ'e()dGdHdIdJZ*dKdLZ+dMdNZ,dOdPZ-dQdRZ.dSdTZ/dUdVZ0dWdXZ1dYdZZ2d[d\Z3d]d^Z4d_d`Z5dadbZ6dcddZ7dedfZ8dgdhZ9didjZ:dkdlZ;dmdnZdsdtZ?dudvZ@dwdxZAdydzZBd{d|ZCd}d~ZDddZEddZFdS) GrammarTestsr)rrcCs td}dS)Nz 1, 0 or 1)rrrrrtest_eval_input"szGrammarTests.test_eval_inputcCs@d}dg}dd}ttgdd||d<||dgdS)N*cSsdSNr%rrrrrone+sz/GrammarTests.test_var_annot_basics..onerr%)intlistr )rZvar1Zmy_lstrZrrrtest_var_annot_basics&s z"GrammarTests.test_var_annot_basicscCs^t|dt|dt|dt|dt|dt|dt|dt|dt|d dS) Nz def f: intz x: int: strzdef f(): nonlocal x: int z [x, 0]: int z f(): int z (x,): intz"def f(): (x, y): int = (1, 2) z!def f(): x: int global x z!def f(): global x x: int r r&rrrtest_var_annot_syntax_errors2s        z)GrammarTests.test_var_annot_syntax_errorsc Cs|tddtt<Wdn1s,0Y|tdtt<Wdn1s^0Ydd}||jidd}|dd}|t|Wdn1s0Yd d }z |Wn6ty }z| t |tWYd}~n d}~00Gd d d }||jt t d |tGddd}Wdn1s`0Y|t Gddd|}Wdn1s0YdS)Nr%rcSsd}dt_|S)NZHellor%r ab)strrrfOsz6GrammarTests.test_var_annot_basic_semantics..fcSsdSrIrrrrrf_OKTsz9GrammarTests.test_var_annot_basic_semantics..f_OKcSs t|dSrIprintrrrrfbadWsz9GrammarTests.test_var_annot_basic_semantics..fbadcSs ttdSrI)rgZno_such_globalrrrrf2bad\sz:GrammarTests.test_var_annot_basic_semantics..f2badc@s.eZdZUeed<dZeed<dZddZdS)z6GrammarTests.test_var_annot_basic_semantics..C_C__fooattrr!r cSs ||_dSrIrhrrrrrLisz?GrammarTests.test_var_annot_basic_semantics..C.__init__N) rDrErFr[__annotations__r!r@zrLrrrrCes  ro)rkr!c@seZdZUde_edS)z9GrammarTests.test_var_annot_basic_semantics..CBadrN)rDrErFZno_such_name_definedrlr[rrrrCBadms rpc@s eZdZUeed<ge_edS)z:GrammarTests.test_var_annot_basic_semantics..Cbad2rN)rDrErFr[rmrr:r\rrrrCbad2ps rq) rZeroDivisionErrorZno_nameZdoes_not_existr-r rmUnboundLocalError ExceptionZassertIsrr[r@) rrdrerirjerorprqrrrtest_var_annot_basic_semanticsFs, * & $ & . z+GrammarTests.test_var_annot_basic_semanticscCs8Gdddt}Gddd|d}||jdddS)Nc@seZdZeddZdS)z>GrammarTests.test_var_annot_metaclass_semantics..CMetac[s dtiSNrm)rH)metaclsnamebaseskwdsrrr __prepare__vszJGrammarTests.test_var_annot_metaclass_semantics..CMeta.__prepare__N)rDrErF classmethodr|rrrrCMetausr~c@seZdZUded<dS)z;GrammarTests.test_var_annot_metaclass_semantics..CCANNOTZXXN)rDrErFrmrrrrCCys r) metaclassxxr)rr rm)rr~rrrr"test_var_annot_metaclass_semanticstsz/GrammarTests.test_var_annot_metaclass_semanticsc Cs~|tttjWdn1s*0Y|tjdttt j ttfd|tj jdt d|t jidS)Nr )r%rr:rd{)Z123o)rAttributeErrorrgtestrmr ann_moduler[r@typingTupleMrrr&rrrtest_var_annot_module_semantics}s ( z,GrammarTests.test_var_annot_module_semanticscCsddlm}m}m}|t|Wdn1s:0Y|t|Wdn1sj0Y|t|dWdn1s0YdS)Nr) f_bad_ann g_bad_ann D_bad_annrW)Ztest.ann_module3rrrrr-)rrrrrrrtest_var_annot_in_modules $ $ z%GrammarTests.test_var_annot_in_modulecCs`i}i}td||||ddtd|t|dWdn1sR0YdS)Nz.'docstring' __annotations__[1] = 2 x: int = 5 rmr )r%r)r>r r[rKeyError)rZgnsZlnsrrrtest_var_annot_simple_execs z'GrammarTests.test_var_annot_simple_execcsdti}td|||ddt||ddt|t|ddWdn1sh0YiGfddd}tdi||ddtdS) Nrmz'X: int; Z: str = "Z"; (w): complex = 1jrrnwcs(eZdZddZfddZddZdS)z5GrammarTests.test_var_annot_custom_maps..CNS2cSs i|_dSrIrJr&rrrrLsz>GrammarTests.test_var_annot_custom_maps..CNS2.__init__cs||j|<||<dSrIrJrN nonloc_nsrrrQs zAGrammarTests.test_var_annot_custom_maps..CNS2.__setitem__cSs |j|SrIrJrRrrrrSszAGrammarTests.test_var_annot_custom_maps..CNS2.__getitem__NrTrrrrCNS2s rz x: int = 1)rHr>r r[r@rr)rnsrrrrtest_var_annot_custom_mapss   * z'GrammarTests.test_var_annot_custom_mapscsHtdiGfddd}tdi||ddtdS)Nrmcs,eZdZfddZfddZddZdS)z1GrammarTests.test_var_annot_refleak..CNS2csdi|_dSrwrJr&)cnsrrrLsz:GrammarTests.test_var_annot_refleak..CNS2.__init__cs||j|<||<dSrIrJrNrrrrQs z=GrammarTests.test_var_annot_refleak..CNS2.__setitem__cSs |j|SrIrJrRrrrrSsz=GrammarTests.test_var_annot_refleak..CNS2.__getitem__NrTrrrrrrs  rzX: strr)rHr>r r@)rrrrrtest_var_annot_refleaks  z#GrammarTests.test_var_annot_refleakcCsri}td|||ddd}t|||t|ddgdddtjd }td |||dd dS) Nzx: tuple = 1, 2rr_zdef f(): x: int = yieldrdr%r rW)rarbcrzx: Tuple[int, ...] = a,*b,cr%r rrrW)r>r r\rr)rrZstmtrrrtest_var_annot_rhss   zGrammarTests.test_var_annot_rhsc sX dd}||d|diidd}dd}||jjd||jjd d d }d d }dd}dd}dd}||d|d|dd|dd||d|d|dd|dddddddddd |d|d|dd|ddd|dddddddddd |dd|ddd|dddd|dddddddddd ddd} | | d| d | gpdg| gdpdiodRidpi| fid!di| fid!dipidd"d#} | d| dd| did$didd%d&} | dd| ddd| d'| dgd(R| ddgd)R| did*didd+d,} | | d| dd| d-| dgd.R| did$di| fiddd/dd0d1} | d| dd| ddddd2d3}|dd|ddd|dddddd4d5}||d|dd|d6|d |fid!didd7d8}|d|dd|ddddd9d:}|dd|ddd|dddd|d6|did*didd;d<}||d|dd|ddd|dgd=R|fiddd/dd>d?}|d|dd|ddd|dddd|d6|ddgd@R|dgd.Rid*diddAdB}|dd|ddd|dddd|ddddd|d6|ddgd@R|dgd(RidCdiztdidEdiWnty.Yn 0|dFdGdH}|dIdJdIdKdLdM}|dddIdN|dddIdOdP|dddIdOdQdIdNdRdS}|dddIdIdOdT|dddIdOdIdU|ttdV|ttdW|ttdXdYdZ}||dgddgRddd[d\ddd[f||dgd(dRd6if|ttd]||fid^d_d`dd^d_d`f||fdad_idbd^idd^d_d`ft |dct |ddt dedfdZ}||j dgt it dhdidZ}||j dDt it dhdjdZ}||j dDt idt dhdldZ}||j dDt itdhdmdZ}||j dDtit dhdndZ}||j dDt iddodpdZ}||j dqdiddodrdZ}||j dqdidddsdtdZ}||j dddsdddudvdZ}||j dddsddddddwdxdZ}||j dddddwdddydzddddddd{d|d}d~dZ}||j ddddddd{d|d}dddydzdddt dddd{d|d ddZ}||j dddt dddd{d|d Gddd}Gddd|}||jj ddi||jj ddiddt deddZ}||j dgt id p,ddZ}}ddZ}fddddZ}ddgdddZ}ddZ}gdjjddZ}dfddZ}dfddZ }ddfddZ }t defddZ }ddZ}ddZ}ddZ}ddZ}ddZ}ddZ}ddZ}ddZ}ddZ}ddZ}ddZ}ddZ}ddZ}ddZ}ddZ}dS)NcSsdSrIrrrrrf1z%GrammarTests.test_funcdef..f1rcSsdSrIrZ one_argumentrrrf2rz%GrammarTests.test_funcdef..f2cSsdSrIrtwoZ argumentsrrrf3rz%GrammarTests.test_funcdef..f3rrcSsdSrIr)Zone_argrrra1rz%GrammarTests.test_funcdef..a1cSsdSrIr)rargsrrra2rz%GrammarTests.test_funcdef..a2cWsdSrIrrestrrrv0rz%GrammarTests.test_funcdef..v0cWsdSrIrrarrrrv1rz%GrammarTests.test_funcdef..v1cWsdSrIrrarbrrrrv2rz%GrammarTests.test_funcdef..v2r%r rrrWrrcSsdSrIrrarrrd01rz&GrammarTests.test_funcdef..d01r%racSsdSrIrr`rrrd11rz&GrammarTests.test_funcdef..d11rbcSsdSrIrrarbrrrrd21rz&GrammarTests.test_funcdef..d21r%r rr rrrcSsdSrIrr`rrrd02rz&GrammarTests.test_funcdef..d02r_r r`cSsdSrIrrrrrd12rz&GrammarTests.test_funcdef..d12cSsdSrIrrarbrdrrrd22rz&GrammarTests.test_funcdef..d22cWsdSrIrrrrrd01vrz'GrammarTests.test_funcdef..d01v)r%r rrcWsdSrIrrrrrd11v&rz'GrammarTests.test_funcdef..d11vcWsdSrIrrarbrrrrrd21v*rz'GrammarTests.test_funcdef..d21vcWsdSrIrrrrrd02v0rz'GrammarTests.test_funcdef..d02vrcWsdSrIrrrrrd12v7rz'GrammarTests.test_funcdef..d12vrrrWcWsdSrIr)rarbrrrrrrd22v?rz'GrammarTests.test_funcdef..d22vrrsfooz/Bytes should not work as keyword argument namescSs|SrIrkeyrrrpos0key1Prz+GrammarTests.test_funcdef..pos0key1dr)k2cSs ||||fSrIr)p1p2k1rrrrpos2key2Rrz+GrammarTests.test_funcdef..pos2key2)r)rr)rrc[s|||||fSrIr)rrrrkwargrrr pos2key2dictVrz/GrammarTests.test_funcdef..pos2key2dict)rtokwarg1tokwarg2)rrrzdef f(*): passzdef f(*,): passzdef f(*, **kwds): passc_s||fSrIr)rkwargsrrrrd_sz$GrammarTests.test_funcdef..frr:)r%rrzf(1, x=2, *(3,4), x=5)Z scrambledZfried)eggsspamrrz f(*g(1=2))z f(**g(1=2)))returncSsdSrIrrhrrrrdorrrhcSsdSrIrrhrrrrdqrcSsdSrIrrhrrrrdsrr5cSsdSrIrrhrrrrdurcWsdSrIrrhrrrrdwrc[sdSrIrrhrrrrdyrr:cSsdSrIrrrrrrd{rr:cSsdSrIrrrrrrd}r)rbrcSsdSrIrrrrrrdr)rrbcSsdSrIrrrrrrdr)rbrrugcWsdSrIr)rarbrrrurdrrrrrdr ij )rbrrurhrkrc _sdSrIr rarbrrrurdrrrrrrrrrds) rbrrurdrrrrrc _sdSrIrrrrrrdsc@seZdZddddZdS)z'GrammarTests.test_funcdef..Spamr%) _Spam__kwcSsdSrIr)rrrrrrdsz)GrammarTests.test_funcdef..Spam.fN)rDrErFrdrrrrSpamsrc@s eZdZdS)z&GrammarTests.test_funcdef..HamNrDrErFrrrrHamrrrcSs|SrIrrhrrrnullrz'GrammarTests.test_funcdef..nullcSsdSrIrrhrrrrdsFcSsdSrIrrhrrrrdscSsdSrIrrhrrrrdscs|SrIrrd)rrrrz+GrammarTests.test_funcdef..cSsdSrIrrhrrrrds.cSsdSrIrrhrrrrdscSsdSrIrrhrrrrdscSsdSrIrrhrrrrdscsSrIrrclosurerrrdrcsSrIrrhrrrrdrrcsSrIrrrrrrdrcsSrIrrrrrrdrcSsdSrIrrrrrrdrcWsdSrIrrrrrrdrc[sdSrIrr{rrrrdrcWsdSrIrrarrrrrdrc[sdSrIrrar{rrrrdrcWsdSrIrrbrrrrrdrcSsdSrIrrbrrrrdrc_sdSrIrrr{rrrrdrcWsdSrIrrarbrrrrrdrcSsdSrIrr`rrrrdrc_sdSrIrrarr{rrrrdrc_sdSrIrrbrr{rrrrdrc[sdSrIrrbr{rrrrdrc_sdSrIrrarbrr{rrrrdrc[sdSrIrrarbr{rrrrdr)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)r5)rrW)rrW)rrW)r%)r __code__ co_varnamesr@ TypeErrorr rrrrr\rmr[floatrd__call__)rrrrrrrrrrrrrrrrrrrrrrrrrdrrrr)rrr test_funcdefs         *                                                     zGrammarTests.test_funcdefcCsVdd}||ddd}dd}||gdd'ddfd dfd d}||dd(d d}||dd d ||dd ddt|dt|ddddd}||dd d||dd ddddd}dd}dd} dd} dd} dd} dd} dd}d d}d!d}d"d}d#d}d$d}d%d}d&d}dS))NcSsdSNrrrrrrrrz+GrammarTests.test_lambdef..rcSsttSrI)rarrrrrrrcSsdddDS)NcSsg|] }d|kqSrr.0rrrr rz?GrammarTests.test_lambdef....)rrrrrrrrr)rr%rr%cSs|SrIrrnrrrrrcSs|SrIrrrrrrrcSs|SrIrrhrrrrrr cSs |||SrIr)rr:rnrrrrrrWrrzlambda x: x = 2zlambda (None,): NonercSs |||SrIr)rr:rrrrrrr cSsdSrrrrrrrrcWsdSrrrrrrrrc[sdSrrrrrrrrcWsdSrrrrrrrrc[sdSrrrrrrrrcWsdSrrrrrrrrcSsdSrrrrrrrrc_sdSrrrrrrrrcWsdSrrrrrrrrcSsdSrrr`rrrrrc_sdSrrrrrrrrc_sdSrrrrrrrrc[sdSrrrrrrrrc_sdSrrrrrrrrc[sdSrrrrrrrr)r%)r r r)rl1l2l3l4l5l6l10Zl11Zl12Zl13Zl14Zl15Zl16Zl17Zl18Zl19Zl20Zl21Zl22Zl23Zl24rrr test_lambdefs<   zGrammarTests.test_lambdefcCsd}~dd}|dS)Nr%cSs d}~dSrYrrhrrrfoosz*GrammarTests.test_simple_stmt..foor)rrrrrrtest_simple_stmtszGrammarTests.test_simple_stmtc CsRd}d}d}}}d\}}}d}\}}}\}}}}t|dt|ddS)Nr%r)r%r )rrz x + 1 = 1z a + 1 = b + 2r ) rrr:rnabcrarbrxyzrrrtest_expr_stmts   zGrammarTests.test_expr_stmtc Csd}gd}|D]}d|}|D]}||}|j|dD|t|t|Wdn1sh0YWdn1s0Y|dd}|j|dD|tdt|Wdn1s0YWdq"1s0Yq"qdS)N)rgr>)z{} fooz {} {{1:foo}}z if 1: {} foozif 1: {} {{1:foo}}zif 1: {} foozif 1: {} {{1:foo}}z call to '{}')sourcerz(foo.)zinvalid syntax)formatsubTestZassertRaisesRegexrr>r+)rkeywordsZcaseskeywordZ custom_msgcaserrrr(test_former_statements_refer_to_builtinss  D z5GrammarTests.test_former_statements_refer_to_builtinscCsgd}|\}}}|||f}~~~~~d\}}}~~~d\}}}} } } } ~~~~ ~ ~ d\}}}} } } } ~~~~ ~ ~ td} | dd=tddd dS) NrrZabcdefgabcdr%r z-del a, (b[0].c, (d.e, f.g[1:2])), [h.i.j], () r>)r\r?)rrrr:rnrrarbrrrurdrr&rrr test_del_stmts       zGrammarTests.test_del_stmtcCsdSrIrr&rrrtest_pass_stmt5szGrammarTests.test_pass_stmtcCsqqdSrIrr&rrrtest_break_stmt<szGrammarTests.test_break_stmtcCsd}|rd}qqd}|s.test_inner)r%rr)rr0rr&rtest_break_continue_loopZs z%GrammarTests.test_break_continue_loopcCsFdd}dd}dd}||}|}||ddt|d dS) NcSsdSrIrrrrrg1vrz$GrammarTests.test_return..g1cSsdSrYrrrrrg2wrz$GrammarTests.test_return..g2cSsddg}dg|RS)Nr rr%rr rrrg3xsz$GrammarTests.test_return..g3rz unparenthesized star expr returnzclass foo:return 1r)rr2r3r4rr:rrr test_returntszGrammarTests.test_returncCs~d}|dkr*|d7}zWq*qYq*0q||dd}|dkrf|d7}z Wqfq:Wqfq:Yqf0q:||dd}|dkr|d7}zddWqqvYq0qv||ddD](}||dzWqqYq0q||ddD]6}||dzWq&qWq&qYq&0q||ddD]6}||dzddWqnnYqn0q6||ddSNrr r%rr%r rr/rrrtest_break_in_finallysV          z"GrammarTests.test_break_in_finallycCsXd}|dkr,|d7}zWqq,Yq0q,q||dd}|dkrh|d7}z Wq.g1r%cSszWdSYdS0dS)Nrr rrrrrr3s z/GrammarTests.test_return_in_finally..g2rcSs"zddWdSYdS0dS)Nr%rrrrrrrr4s z/GrammarTests.test_return_in_finally..g3rr )rr2r3r4rrrtest_return_in_finallys z#GrammarTests.test_return_in_finallycCsTdd}||dd||dddd}||dd||dddS) NcSsTdD]D}d}|dkr|d7}z||W|r.qSq |rDYq0q qd||fS)Nr7rrrendrrr/Zcount2rrrr2sz;GrammarTests.test_break_in_finally_after_return..g1FrT)r<r%rc SsPdD]@}dD]6}z||W|r$qSq |r@Yq0q qd||fS)Nr7)rrr<rr=rrrr3s z;GrammarTests.test_break_in_finally_after_return..g2r rr2r3rrr"test_break_in_finally_after_returns   z/GrammarTests.test_break_in_finally_after_returncCsTdd}||dd||dddd}||dd ||dd dS) NcSs@d}|dkr8|d7}z|W|r"qSq|r4Yq0qd|fS)Nrrr%r<rrr/rrrr2sz>GrammarTests.test_continue_in_finally_after_return..g1Fr%T)r<rcSs8dD]*}z|W|rqSq|r,Yq0qd|fS)Nr7r<rr@rrrr3,sz>GrammarTests.test_continue_in_finally_after_return..g2r)r<r%r r>rrr%test_continue_in_finally_after_returns  z2GrammarTests.test_continue_in_finally_after_returncCsdd}dd}dd}dd}dd}dd}t|dt|d d d}d d}t|d t|d dd}dd}dd}dd}dd}|t|dgt|dt|dt|dt|dt|dt|dt|dt|dt|ddS)Ncss dVdSrYrrrrrr9rz"GrammarTests.test_yield..gcssdEdHdSNrrrrrrr:rcss dV}dSrYrrhrrrr<rcssdEdH}dSrBrrhrrrr=rcss dVdSN)r%r%rrrrrr?rcss dV}dSrCrrhrrrr@rzdef g(): yield from (), 1zdef g(): x = yield from (), 1cssddVfdSrYrrrrrrErcssddEdHfdSNr%rrrrrrrFrzdef g(): 1, yield 1zdef g(): 1, yield from ()csstdVdSrYrrrrrrJrcsstdVddSrYrrrrrrKrcsstdEdHdSrBrrrrrrLrcsstdEdHddS)Nrr%rrrrrrMrcssd}dddg|RVdS)NrrWrr%r rrrrrrrOr)r%r rrrWrzdef g(): f(yield 1)zdef g(): f(yield 1, 1)zdef g(): f(yield from ())zdef g(): f(yield from (), 1)yieldz yield fromzclass foo:yield 1zclass foo:yield from ()zdef g(a:(yield)): pass)rr r\rrrrr test_yield7s6            zGrammarTests.test_yieldcCs~dd}dd}|j}|dd|dd|dd|dd |d d |d d |d d|dd|dd|dddS)NcssdddVfDdS)NcSsg|]}|qSrrr rrrr `rHGrammarTests.test_yield_in_comprehensions..g..r%rrrrrr`rz4GrammarTests.test_yield_in_comprehensions..gcssdddEdHfDdS)NcSsg|]}|qSrrr rrrr arrIrrrrrrrarz def g(): [(yield x) for x in ()]z!'yield' inside list comprehensionz)def g(): [x for x in () if not (yield x)]z-def g(): [y for x in () for y in [(yield x)]]z def g(): {(yield x) for x in ()}z 'yield' inside set comprehensionz#def g(): {(yield x): x for x in ()}z!'yield' inside dict comprehensionz#def g(): {x: (yield x) for x in ()}z def g(): ((yield x) for x in ())z#'yield' inside generator expressionz%def g(): [(yield from x) for x in ()]z class C: [(yield x) for x in ()]z[(yield x) for x in ()]r )rrr0rrrtest_yield_in_comprehensions^sBz)GrammarTests.test_yield_in_comprehensionscCs@z tdWntyYn0ztWnty:Yn0dS)Nz just testing) RuntimeErrorKeyboardInterruptr&rrr test_raiseys zGrammarTests.test_raisecCsdddl}ddl}ddl}ddlm}ddlm}ddlm}m}ddlm}m}ddlm}m}dS)Nr)time)pathargv)rrNrOrP)rrrNrOrPrrr test_imports  zGrammarTests.test_importcCsdSrIrr&rrr test_globalszGrammarTests.test_globalcsddfdd}dS)NrcsdSrIrrrrrrdsz%GrammarTests.test_nonlocal..fr)rrdrrr test_nonlocalszGrammarTests.test_nonlocalc CsdsJdsJddds Jds0Jddz ds:JWn.tyj}z|dWYd}~n d}~00zdszJdWn.ty}z|dWYd}~n d}~00dS) Nr%cSs|SrIrrhrrrrrz*GrammarTests.test_assert..cSs|dSrYrrhrrrrrTz6'assert True' should not have raised an AssertionErrorzthis should always passz;'assert True, msg' should not have raised an AssertionError)AssertionErrorr rrurrr test_asserts    zGrammarTests.test_assertTz Won't work if __debug__ is Falsec CszdsJdWn6tyF}z||jddWYd}~nd}~00|dz ds\JWn6ty}z|t|jdWYd}~nd}~00|d|ddt(tdt t d d d Wdn1s0YdS) Nrr-z%AssertionError not raised by assert 0Fz+AssertionError not raised by 'assert False'zassert(x, "msg")zassertion is always trueerrorzassert x, "msg"r'r>) rTr rr r7rwarningscatch_warnings simplefilter SyntaxWarningr?rUrrr testAssert2s (  (   zGrammarTests.testAssert2cCsdSrIrr&rrrtest_ifs zGrammarTests.test_ifcCsd}d}||ddS)Nrr r rrrr test_whileszGrammarTests.test_whilecCsdD]}qdD] \}}}qGddd}d}|dD] }||}q4|dkrT|dg}d D]\}||q\||gddS) Nrrc@s$eZdZddZddZddZdS)z&GrammarTests.test_for..SquarescSs||_g|_dSrI)maxsofar)rr_rrrrLsz/GrammarTests.test_for..Squares.__init__cSs t|jSrI)r7r`r&rrr__len__rz.GrammarTests.test_for..Squares.__len__cSsRd|kr|jksntt|j}||krH|j|||d}q&|j|S)Nrr%)r_ IndexErrorr7r`append)rrnrrrrSs   z2GrammarTests.test_for..Squares.__getitem__N)rDrErFrLrarSrrrrSquaressrerrizfor over growing sequence)rrr)r rcr )rrrrrerdrresultrrrtest_fors     zGrammarTests.test_forc Csz ddWntyYn0z ddWn>ty>Yn.ty`}z WYd}~nd}~0Yn0z ddWntttfyYn0z ddWn*tttfy}z WYd}~n d}~00zWn0|t(tdddtdddWdn1s 0YdS)Nr%rz/try: pass except Exception as a.b: pass?r>z0try: pass except Exception as a[b]: pass)rrEOFErrorrrrr?)rr-rrrtest_trys"  " *  zGrammarTests.test_trycCsdSrIrr&rrr test_suites zGrammarTests.test_suitecCsdsdrdsdsdrdS)Nr%Frr&rrr test_test'szGrammarTests.test_testcCsddk}ddkrddkrddkr ddkr(ddkr0ddkr8||ur@||urHddvrPddvrXddkrdkrdkrdkrdkrdkrdvr|vr|ur|urnndSrDrrrrrtest_comparison2szGrammarTests.test_comparisoncsdfdd }|d|d|d|d|dd tLtd ttd d d tdd d tdd d tdd d Wdn1s0YdS)N"is" with a literalcs||dSrIr)rr-r&rrr0Dsz6GrammarTests.test_comparison_is_literal..checkzx is 1z x is "thing"z1 is xz x is y is 1z x is not 1z"is not" with a literalrWz x is Noner'r>z x is Falsez x is Truezx is ...)rnrXrYrZr[r?r/rr&rtest_comparison_is_literalCs      z'GrammarTests.test_comparison_is_literalcslfdd}d|d|d|d|d|d|d |d |d |d |d |d|d|d|d|d|d|d|d|dd|d|d|d|d|d|d|d|d|d |d!d"|d#|d$|d%|d&|d'|d(|d)|d*d+|d,d-|d.|d/d0|d1|d2d3|d4|d5d6|d7d8|d9d:|d;|d<|d=d>|d?|d@|dA|dB|dCtdtdDttdEdFdGtdHdFdGtdIdFdGtdJdFdGtdKdFdGtdLdFdGWdn1s^0YdS)MNcs|dSrIro)rr-rrrr0Usz2GrammarTests.test_warn_missed_comma..checkz-is not callable; perhaps you missed a comma\?z[(1, 2) (3, 4)]z[(x, y) (3, 4)]z[[1, 2] (3, 4)]z[{1, 2} (3, 4)]z[{1: 2} (3, 4)]z[[i for i in range(5)] (3, 4)]z[{i for i in range(5)} (3, 4)]z[(i for i in range(5)) (3, 4)]z![{i: i for i in range(5)} (3, 4)]z[f"{x}" (3, 4)]z[f"x={x}" (3, 4)]z["abc" (3, 4)]z[b"abc" (3, 4)]z [123 (3, 4)]z [12.3 (3, 4)]z[12.3j (3, 4)]z [None (3, 4)]z [True (3, 4)]z [... (3, 4)]z2is not subscriptable; perhaps you missed a comma\?z[{1, 2} [i, j]]z[{i for i in range(5)} [i, j]]z[(i for i in range(5)) [i, j]]z[(lambda x, y: x) [i, j]]z [123 [i, j]]z [12.3 [i, j]]z[12.3j [i, j]]z [None [i, j]]z [True [i, j]]z [... [i, j]]zKindices must be integers or slices, not tuple; perhaps you missed a comma\?z[(1, 2) [i, j]]z[(x, y) [i, j]]z[[1, 2] [i, j]]z[[i for i in range(5)] [i, j]]z[f"{x}" [i, j]]z[f"x={x}" [i, j]]z["abc" [i, j]]z[b"abc" [i, j]]z.indices must be integers or slices, not tuple;z[[1, 2] [3, 4]]z-indices must be integers or slices, not list;z[[1, 2] [[3, 4]]]z [[1, 2] [[i for i in range(5)]]]z,indices must be integers or slices, not set;z[[1, 2] [{3, 4}]]z [[1, 2] [{i for i in range(5)}]]z-indices must be integers or slices, not dict;z[[1, 2] [{3: 4}]]z#[[1, 2] [{i: i for i in range(5)}]]z2indices must be integers or slices, not generator;z [[1, 2] [(i for i in range(5))]]z1indices must be integers or slices, not function;z[[1, 2] [(lambda x, y: x)]]z,indices must be integers or slices, not str;z[[1, 2] [f"{x}"]]z[[1, 2] [f"x={x}"]]z[[1, 2] ["abc"]]z'indices must be integers or slices, notz[[1, 2] [b"abc"]]z[[1, 2] [12.3]]z[[1, 2] [12.3j]]z[[1, 2] [None]]z[[1, 2] [...]]rWz[(lambda x, y: x) (3, 4)]r'r>z [[1, 2] [i]]z [[1, 2] [0]]z[[1, 2] [True]]z[[1, 2] [1:2]]z[{(1, 2): 3} [i, j]]rpr/rrrrtest_warn_missed_commaTs       z#GrammarTests.test_warn_missed_commacCsd}d}d}dS)Nr%rrrrrrtest_binary_mask_opssz!GrammarTests.test_binary_mask_opscCsd}d}d}dS)Nr rr%rrrrrtest_shift_opsszGrammarTests.test_shift_opscCsd}d}d}d}dS)Nr%r r rrrrrtest_additive_opsszGrammarTests.test_additive_opscCsd}d}d}d}dS)Nr%?rgrrrrrtest_multiplicative_opssz$GrammarTests.test_multiplicative_opscCsd}d}d}d}d}dS)Nr%r rwrrrrrtest_unary_opss zGrammarTests.test_unary_opsc Csddl}ddl}|jd}|}|jd}d}|d}|d}|dd}|dd}|dd}|dd}|dd}|dd}|dd}i}d |d <d |d <d |d <d|d<t|}|jddd|t|ddS)NrrNZ01234r rWr%r rrr_rrcSst|j|fSrI)rrDrhrrrrrz-GrammarTests.test_selectors..rz[1, (1,), (1, 2), (1, 2, 3)])rrNrOmodulesr\sortr r@) rrrNrrrar!rLrrrtest_selectorss,        zGrammarTests.test_selectorscCsd}dpdpd}dpdpdddf}g}dg}dp6dp6dg}dpDdpDdddg}g}i}ddi}ddi}dpjddppdi}ddd}ddd}dddddd d }dh}ddh}hd }hd }|}d }d}dS)Nr%r rrZr)rZrrrWr)rZrthreeZfourZfiveZsix>rrZr>r rrrrrrrrr test_atomss,   zGrammarTests.test_atomscsGddd}Gddd}Gddd|}Gddd|}Gd d d |||}Gd d d }d dGddd}dp~Gddd}} Gddd} fddGddd} ddgdGddd} Gddd} gd jjGd!d"d"}dS)#Nc@s eZdZdS)z%GrammarTests.test_classdef..BNrrrrrBrrc@s eZdZdS)z&GrammarTests.test_classdef..B2NrrrrrB2rrc@s eZdZdS)z&GrammarTests.test_classdef..C1NrrrrrC1rrc@s eZdZdS)z&GrammarTests.test_classdef..C2NrrrrrC2 rrc@s eZdZdS)z%GrammarTests.test_classdef..DNrrrrrD rrc@s$eZdZddZddZddZdS)z%GrammarTests.test_classdef..CcSsdSrIrr&rrrmeth1 rz+GrammarTests.test_classdef..C.meth1cSsdSrIr)rargrrrmeth2 rz+GrammarTests.test_classdef..C.meth2cSsdSrIr)rrrrrrmeth3rz+GrammarTests.test_classdef..C.meth3N)rDrErFrrrrrrrro srocSs|SrIrrhrrrclass_decoratorrz3GrammarTests.test_classdef..class_decoratorc@s eZdZdS)z%GrammarTests.test_classdef..GNrrrrrGsrFc@s eZdZdS)z%GrammarTests.test_classdef..HNrrrrrHsrc@s eZdZdS)z%GrammarTests.test_classdef..INrrrrrIsrcs|SrIr)rrrrrrz,GrammarTests.test_classdef..c@s eZdZdS)z%GrammarTests.test_classdef..JNrrrrrJsr.r%c@s eZdZdS)z%GrammarTests.test_classdef..KNrrrrrKsrc@s eZdZdS)z%GrammarTests.test_classdef..LNrrrrrr srrc@s eZdZdS)z%GrammarTests.test_classdef..MNrrrrrr"sr)r)rrrrrrrorrrrrrrrrrr test_classdefs*    zGrammarTests.test_classdefcCs*gd}|dd|DdddddS)NrcSsi|]}||dqSrrr rrrr *rz/GrammarTests.test_dictcomps..r rrr )rnumsrrrtest_dictcomps%szGrammarTests.test_dictcompsc sZgd}gdgd}dd|Dgddd|Dgdd d|Dgd fd d|Dgd fd d|DgdddtdDdgddggdgdgdgdd}||gdfdd}|tdtdgd}gdgdfdd|D}|gd dS)!Nr)AppleBananaCoconut)z Applez Banana z Coco nut cSsg|] }|qSr)strip)r r!rrrr 2rz/GrammarTests.test_listcomps..)rrz Coco nutcSsg|] }d|qSrrr rrrr 3r)rrrrcSsg|]}|dkr|qSrrr rrrr 4rrcsg|]}D] }||fq qSrrr rr!strsrrr 5r))r%rr%rr%r)r rr rr r)rrrrrr)rrrrrr)rWrrWrrWrcs(g|] }ddDD] }||fqqS)cSsg|]}d|vr|qS)rdr)r rdrrrr ;rz:GrammarTests.test_listcomps...rrrrrr ;r) rrrrrrrrrrcSsg|]}dd|qS)csfddtdDS)Ncsg|] }|qSrrrrrrr ?rzLGrammarTests.test_listcomps.....r%rangerrrrr?rz8GrammarTests.test_listcomps...r)r rrrrr ?rrWr%)r%r r)r%rr)r%r@cSsdd|DS)NcSs,g|]$}|dkrd|ko"dknqS)r rrrr rrrr CrzEGrammarTests.test_listcomps..test_in_func..r)lrrr test_in_funcBsz1GrammarTests.test_listcomps..test_in_func)FFFcs,dddDddgddgdd ggdS) NcSs"g|]}dd||dfDqS)cSsg|]}|qSrrr r:rrrr HrzUGrammarTests.test_listcomps..test_nested_front...r%rr rrrr HrzJGrammarTests.test_listcomps..test_nested_front..)r%rrWr%r rrrWrr rr&rrtest_nested_frontGsz6GrammarTests.test_listcomps..test_nested_frontz"[i, s for i in nums for s in strs]z[x if y]))r%Boeing)r Ford)r Macdonalds))rAirliner)rEngine) Cheeseburger))r%r)r%r)r r)rrcsDg|]<\}}D].\}}D] \}}||kr||kr||fqqqSrr)r ZsnoZsnameZpnoZpnameZsp_snoZsp_pno)partssuppartrrr `s   ))rr)rr)rr)rr)r rr)rrZspcsrrZ suppliersrr)rrrrrtest_listcomps,s8    zGrammarTests.test_listcompscsddtdD}|t|ddtdDzt||dWntyXYn0dz(fddD}t||d WntyYn0|td dd Dd dd D|td ddDdddDddtdDddddDD}|t|tddtdD|tddtdDtddtdD|tddtdDtddtdD|tddddtdDDtddtdD|tddddddtdDDDtddtdD|tddd dd!dtdDDDtd"dtdD|td#dd$dd%dtdDDDtd&dtdD|td'dd(dd)dtdDDDd*t|d+t|d,dS)-Ncss |]}ddtdDVqdS)cSsg|]}|qSrrr rrrr mrz7GrammarTests.test_genexps...rNrr rrr mrz,GrammarTests.test_genexps..r%cSsg|]}|qSrrr rrrr nrz-GrammarTests.test_genexps..rz&should produce StopIteration exceptionc3s|] }VqdSrIr)r rrrrrwrzshould produce TypeErrorcss |]}dD]}||fVq qdS)r&Nrr rr:rrrr}rr&cSsg|]}dD] }||fq qS)r&rrrrrr }rcss |]}dD]}||fVq qdS)xyNrrrrrr~rabcSsg|]}dD] }||fq qS)rrrrrrr ~rcSsg|]}|qSrrr rrrr rcss|] }|VqdSrIrr rrrrrcss|] }|VqdSrIrrrrrrrcSsg|]}|qSrrr rrrr rcss|]}|dVqdSr Nrr rrrrrcSsg|] }|dqSrrr rrrr rcss|]}|dr||VqdSrrr rrrrrcSsg|]}|dr||qSrrr rrrr rcss|] }|VqdSrIrr rrrrrcss|] }|VqdSrIrrrrrrrcSsg|]}|qSrrr rrrr rcss|] }|VqdSrIrr rrrrrcss|] }|VqdSrIrrrrrrrcss|] }|VqdSrIrr rnrrrrrcSsg|]}|qSrrr rrrr rcss|] }|VqdSrIrr rrrrrcSsg|]}|qSrrrrrrr rcss|] }|VqdSrIrrrrrrrcSsg|]}|qSrrr rrrr rcss|] }|VqdSTNrr rrrrrcss|] }|VqdSrIrrrrrrrcss|] }|VqdSrrrrrrrrcSsg|]}|qSrrr rrrr rcss|] }|VqdSrrr rrrrrcss|]}dr|VqdS)FNrrrrrrrcss|] }|VqdSrrrrrrrrrzfoo(x for x in range(10), 100)zfoo(100, x for x in range(10))) rr nextr StopIterationrr\sumr)rrrbrrr test_genexpsks8  $$"00:DDD2 zGrammarTests.test_genexpscsdddtD}d|tt|dddfddtD}dd|dd tdDt||d d tdDgd |td dtdDgd |d d dDgd|tdddDgddS)Nrcss|] }|VqdSrIrrrrrrrz;GrammarTests.test_comprehension_specials..rWFc3s(|] }rtD]}||fVqqdSrIrr rrtrrrrrTcSs"g|]}tdD] }||fqqSrWrrrrrr rz.cSs g|]}|dr|dr|qSrrr rrrr r)r%rWrcss"|]}|dr|dr|VqdS)r rNrr rrrrrcSsg|] \}|qSrrr rrrr r))rr)rrEcss|] \}|VqdSrIrr rrrrr))r)r)r)rrr)rr r7r\rGrrrtest_comprehension_specialss "z(GrammarTests.test_comprehension_specialsc CsGdddt}|Wdn1s,0Y|}Wdn1sR0Y|\}}Wdn1s|0Y|6|Wdn1s0YWdn1s0Y|6}|}Wdn1s0YWdn1s0Y|8}|Wdn1sF0YWdn1sf0Ytsgd}|D]@}|j|dt|ddWdn1s0YqdS)Nc@seZdZddZddZdS)z1GrammarTests.test_with_statement..managercSsdSNr_rr&rrr __enter__sz;GrammarTests.test_with_statement..manager.__enter__cWsdSrIr)rrrrr__exit__sz:GrammarTests.test_with_statement..manager.__exit__N)rDrErFrrrrrrmanagersr)zif 1: with ( manager() ): pass zif 1: with ( manager() as x ): pass zif 1: with ( manager() as (x, y), manager() as z, ): pass zif 1: with ( manager(), manager() ): pass zif 1: with ( manager() as x, manager() as y ): pass zif 1: with ( manager() as x, manager() ): pass zif 1: with ( manager() as x, manager() as y, manager() as z, ): pass zif 1: with ( manager() as x, manager() as y, manager(), ): pass )r$zr>)objectrr!r?)rrrr:Z test_casesr$rrrtest_with_statements$ <>@:z GrammarTests.test_with_statementcCsdd}|ddddddfDdg|d dd dd dfDdg|d n|ddd |drx|ddnd d |drd odnd d |drd odnd d |d odnd d|drdp|ddndd|d p|ddn|ddd |dpd n|ddd |dnd d|dr>dnd d |dndd|d ndd |dndd|dndd|drddkndddS)NcSs t||S)z@helper to check that evaluation of expressions is done correctlyrf)r-retrrr _checkevalsz2GrammarTests.test_if_else_expr.._checkevalcSsg|]}|r|qSrrr rrrr rz2GrammarTests.test_if_else_expr..cSsdS)NTrrrrrrrz0GrammarTests.test_if_else_expr..cSsdSNFrrrrrrrTcSsg|]}|dr|dqS)Frr rrrr rcSs |rdSdS)NFTrrhrrrrrcSs |rdSdS)NTFrrhrrrrrr%rWzcheck 1rzcheck 2rzcheck 3r rzcheck 4zcheck 5zcheck 6Frrrg@r )rrrrrtest_if_else_exprs$$$"zGrammarTests.test_if_else_exprcCsr|dd|dd|ddd}d}|d||uu|d|u|u|d|uof|undS)Nrr rF)r rZ assertFalser9rrrtest_paren_evaluations   z"GrammarTests.test_paren_evaluationcCs>Gddd}|}|||d|d}||jddS)Nc@seZdZddZddZdS)z'GrammarTests.test_matrix_mul..McSsdS)Nrrrrrrr __matmul__sz2GrammarTests.test_matrix_mul..M.__matmul__cSs ||_|SrI)otherrrrr __imatmul__ sz3GrammarTests.test_matrix_mul..M.__imatmul__N)rDrErFrrrrrrrsrrrX)r r)rrmrrrtest_matrix_muls zGrammarTests.test_matrix_mulcCsxdd}||jd|t|jjtj@dd}|dd}||j||jd|t|jjtj@dS) Ncsdd}tIdHdS)NcSsdSrIrrrrrr*sz8GrammarTests.test_async_await..test..sum)Zsomeobj)rrrrr)sz+GrammarTests.test_async_await..testrcSst|dd|S)N_markedT)setattr)funcrrr decorator2s z0GrammarTests.test_async_await..decoratorcsdS)Nrrrrrtest26sz,GrammarTests.test_async_await..test2r) r rDrboolrco_flagsinspectZ CO_COROUTINEr)rrrrrrrtest_async_await(s  zGrammarTests.test_async_awaitcsfGdddtGdddfdd}||dWdn1sX0YdS)Nc@s eZdZdS)z)GrammarTests.test_async_for..DoneNrrrrrDone>rrc@seZdZddZddZdS)z*GrammarTests.test_async_for..AItercSs|SrIrr&rrr __aiter__Asz4GrammarTests.test_async_for..AIter.__aiter__cstdSrI)StopAsyncIterationr&rrr __anext__Csz4GrammarTests.test_async_for..AIter.__anext__N)rDrErFrrrrrrAIter@srcsN2z 3dHW}q62z3dHW\}}q62z 3dHW}q66dSrIrrrrrrrFsz(GrammarTests.test_async_for..foortrsendrrrrrtest_async_for=s  zGrammarTests.test_async_forcsfGdddtGdddfdd}||dWdn1sX0YdS)Nc@s eZdZdS)z*GrammarTests.test_async_with..DoneNrrrrrrUrrc@seZdZddZddZdS)z-GrammarTests.test_async_with..managercsdSrrr&rrr __aenter__Xsz8GrammarTests.test_async_with..manager.__aenter__csdSrr)rexcrrr __aexit__Zsz7GrammarTests.test_async_with..manager.__aexit__N)rDrErFrrrrrrrWsrc s*4IdHWdIdHq:1IdHs00Y4IdH}WdIdHqt1IdHsj0Y4IdH\}}WdIdHq1IdHs0Y4IdHR4IdHWdIdHq1IdHs0YWdIdHq*1IdHs 0Y4IdHV}4IdH}WdIdHqx1IdHsn0YWdIdHq1IdHs0Y4IdHV}4IdHWdIdHq1IdHs0YWdIdHq"1IdHs0YdSrIrrrrrrr]s*** X \ \z)GrammarTests.test_async_with..foorrrrrtest_async_withTs  zGrammarTests.test_async_withN)GrDrErFrGrrrVr]r^rvrrrrrrrrrrrr%r(r)r*r.r1r5r9r:r;r?rArHrJrMrQrRrSrVunittestZ skipUnlessr\r]r^rgrjrkrlrmrqrsrtrurvrxrzrrrrrrrrrrrrrrrrrrrUs  .     w' 45'     R#!?#T rU__main__)rGrrrrrrrXZtest.ann_modulerr collectionsrrrr*r,ZTestCaser r[rmrHrUrDmainrrrrs>   7# g