K i!ddlZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ddlmZmZmZmZddlmZddlmZmZmZddlmZ ddlZddlZej<rdd lmZm Z Gd d eZ!Gd d eZ"GddeZ#GddeZ$GddeZ%GddeZ&GddeZ'GddeZ(GddeZ)GddeZ*GddeZ+eejXd Z-e j\edud!Gd"d#eZ/e0d$k(re jbyy#e$rdZYwxYw)%N)futures)Future)app_log)AsyncHTTPTestCase AsyncTestCase ExpectLoggen_test)skipNotCPython) ApplicationRequestHandler HTTPError)gen)ListOptionalceZdZejdZejdZejdZejdZdZ dZ dZ dZ d Z d Zd Zd Zd ZdZdZedZedZedZedZedZedZedZedZdZdZdZdZ dZ!dZ"y) GenBasicTestc#xKt|D]}tjtj|w)z0Returns arg after a number of IOLoop iterations.)rangermomentReturn)self iterationsargis [/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/tornado/test/gen_test.pydelayzGenBasicTest.delays4z" A**  jjos8:c#2Ktj|SwNrrrresults r async_futurezGenBasicTest.async_future&sjj c#2Ktj|wrr)res rasync_exceptionzGenBasicTest.async_exception+sjjr#c#^Ktjtj|dzwNrrrrxs r add_one_asynczGenBasicTest.add_one_async0s#jjjjQs+-cftjd}|jj|y)Ncyrr0rfz%GenBasicTest.test_no_yield..f6s r1r coroutineio_looprun_syncrr2s r test_no_yieldzGenBasicTest.test_no_yield5s,     a r1ctjd}|jt|jj |y)Ncddz yNr)rr0r0r1rr2z-GenBasicTest.test_exception_phase1..f= Er1rr4 assertRaisesZeroDivisionErrorr5r6r7s rtest_exception_phase1z"GenBasicTest.test_exception_phase1<s7     +T\\-B-BAFr1ctjd}|jt|jj |y)Nc3:Ktjddz ywr;rr0r1rr2z-GenBasicTest.test_exception_phase2..fD**  Er=r7s rtest_exception_phase2z"GenBasicTest.test_exception_phase2Cs7     +T\\-B-BAFr1ctjd}|jtj|jj |y)Nc3KdywN*r0r0r1rr2z(GenBasicTest.test_bogus_yield..fLs Hrr4r> BadYieldErrorr5r6r7s rtest_bogus_yieldzGenBasicTest.test_bogus_yieldKs<     #++T\\-B-BAFr1ctjd}|jtj|jj |y)Nc3KdywNr)r0r0r1rr2z.GenBasicTest.test_bogus_yield_tuple..fSs LrJrKr7s rtest_bogus_yield_tuplez#GenBasicTest.test_bogus_yield_tupleRs<     #++T\\-B-BAFr1ctjd}|jj||jj|y)Nc30Ktjywrrr0r1rr2z"GenBasicTest.test_reuse..fZ** r3r7s r test_reusezGenBasicTest.test_reuseYs>     a  a r1cftjd}|jj|y)Nc3Kdywrr0r0r1rr2z!GenBasicTest.test_none..fbs JrJr3r7s r test_nonezGenBasicTest.test_noneas,     a r1cltjfd}jj|y)Nc3~Kjdjdg}j|ddgyw)Nr)rR)r- assertEqualresultsrs rr2z"GenBasicTest.test_multi..fis>!//2D4F4Fq4IJJG   Wq!f -s:=r3r7s` r test_multizGenBasicTest.test_multihs-  .  . a r1cltjfd}jj|y)Nc3Ktjdjd}j|tddyw)Nr)rRfoobarr^)dictr-r_r`s rr2z'GenBasicTest.test_multi_dict..fqsD T%7%7%:@R@RST@UVVG   Wdqa&8 9sA Ar3r7s` rtest_multi_dictzGenBasicTest.test_multi_dictps-  :  : a r1cltjfd}jj|y)Nc3Ktjjddjddg}j|ddgyw)Nr^v1r)v2)r multi_futurerr_ responsesrs rr2z*GenBasicTest.test_multi_delayed..fysR"..At$djjD&9:I   Yt 5sAAr3r7s` rtest_multi_delayedzGenBasicTest.test_multi_delayedxs-  6  6 a r1cltjfd}jj|y)Nc 3Ktjtjddjdd}j |tddyw)Nr^rlr)rmre)rrnrhrr_ros rr2z/GenBasicTest.test_multi_dict_delayed..fsW"..At,$**Q2EFI   Y4(@ AsA!A$r3r7s` rtest_multi_dict_delayedz$GenBasicTest.test_multi_dict_delayeds/  B  B a r1c#Ktj}tdDcgc]}tjc}tj}|j ||z dycc}ww)Nig?)timerrr assertLess)rstartrends rtest_multi_performancez#GenBasicTest.test_multi_performancesN  #(;/aszz//iik e S)0s"A/A*4A/c#Kg}|jt|ti}|jt|tywr) assertTrue isinstancelistrh)rr,ys rtest_multi_emptyzGenBasicTest.test_multi_emptys<H  1d+,H  1d+,sAA c#VK|jd}|j|dywr(r"r_r s r test_futurezGenBasicTest.test_futures)((++ #')c#|K|jd|jdg}|j|ddgyw)Nr)rRrrras rtest_multi_futurezGenBasicTest.test_multi_futures=**1-t/@/@/CDD 1a&):<c#K|jd}|jd||jd|g}|j|gdyw)NrRr)r^)r)rRr^rRr)rr2ras rtest_multi_future_duplicatez(GenBasicTest.test_multi_future_duplicatesO   a **1-q$2C2CA2FJJ ,/sA Ac#Kt|jd|jd}|j|tddyw)Nr)rRre)rhr"r_rs rtest_multi_dict_futurez#GenBasicTest.test_multi_dict_futuresB!2!21!54;L;LQ;OPP $1!"45sA Ac #PKttd5|jt5}t j |j td|j tdgdddddd|jtjd|jt5t j |j td|jdgddd|jt5t j |j td|j tdgtdddy#1swYxYw#1swYxYw#1swYxYw#1swYyxYwwNz!Multiple exceptions in yield listzerror 1zerror 2rR)quiet_exceptions) rrr> RuntimeErrorrMultir&r_str exceptionr"rcms rtest_multi_exceptionsz"GenBasicTest.test_multi_exceptionssf w C D ""<0 Bii,,\)-DE,,\)-DE   R\\*I6  | , ))%%l9&=>@Q@QRS@TU     | , ))((i)@A((i)@A".    !         sgF&FA E43F;AF&=AF>F&AF+ F&4E> 9FF F&FF&F#F&c #Kttd5|jt5}|j td|j tdgdddddd|j t jd|jt5|j td|jdgddd|jt5tj|j td|j tdgtdddy#1swYxYw#1swYxYw#1swYxYw#1swYyxYwwr) rrr>rr&r_rrr"rrnrs rtest_multi_future_exceptionsz)GenBasicTest.test_multi_future_exceptionssR w C D ""<0 B((i)@A((i)@A   R\\*I6  | , X'' Y(?@$BSBSTUBVW W X  | , ""((i)@A((i)@A".         X X  seE>E7E E(AE>*.E&E>5AE2 E>E EE#E>&E/+E>2E;7E>cftjd}|jj|y)Nc*tjrrrr0r1rr2z.GenBasicTest.test_sync_raise_return..fs**, r1r3r7s rtest_sync_raise_returnz#GenBasicTest.test_sync_raise_returns,     a r1cftjd}|jj|y)Nc3VKtjtjwrr*r0r1rr2z/GenBasicTest.test_async_raise_return..fs** **, rr3r7s rtest_async_raise_returnz$GenBasicTest.test_async_raise_returns,     a r1ctjd}|jd|jj |y)Nc,tjdrHrr0r1rr2z4GenBasicTest.test_sync_raise_return_value..f**R. r1rIrr4r_r5r6r7s rtest_sync_raise_return_valuez)GenBasicTest.test_sync_raise_return_values9  !  ! T\\22156r1ctjd}|jd|jj |y)Nc,tjdrPrr0r1rr2z:GenBasicTest.test_sync_raise_return_value_tuple..fs**V$ $r1rQrr7s r"test_sync_raise_return_value_tuplez/GenBasicTest.test_sync_raise_return_value_tuples9  %  % !6!6q!9:r1ctjd}|jd|jj |y)Nc3XKtjtjdwrHr*r0r1rr2z5GenBasicTest.test_async_raise_return_value..f ** **R. (*rIrr7s rtest_async_raise_return_valuez*GenBasicTest.test_async_raise_return_values9  !  ! T\\22156r1ctjd}|jd|jj |y)Nc3XKtjtjdwrPr*r0r1rr2z;GenBasicTest.test_async_raise_return_value_tuple..fs** **V$ $rrQrr7s r#test_async_raise_return_value_tuplez0GenBasicTest.test_async_raise_return_value_tuples9  %  % !6!6q!9:r1N)#__name__ __module__ __qualname__rr4rr"r&r-r8r@rErMrSrXr[rbrirqrtr rzrrrrrrrrrrrrrr0r1rrrsY]]  ]] ]] ]]  !GGGG!!!! ! !**--$$**00666.!!7;7;r1rczeZdZfdZfdZdZdZedZedZ edZ edZ ed Z ed Z ed Zed Zed ZedZedZedZedZedZedZedZedZedZedZdZedZxZS)GenCoroutineTestc0d|_t| y)NF)finishedsupersetUpr __class__s rrzGenCoroutineTest.setUps   r1c>t||jsJyr)rtearDownrrs rrzGenCoroutineTest.tearDown!s }}}r1cd|_d}tj|}|j|j|j|j|j |j |j |j|y)NTc30Ktjywrrr0r1rr2z+GenCoroutineTest.test_attributes..f(** rW)rrr4r_rrassertIs __wrapped__rr2coros rtest_attributesz GenCoroutineTest.test_attributes%sb  }}Q  3 !,,7 d&&*r1c$d|_d}tj|}|jtj||j tj||jtj|y)NTc30Ktjywrrr0r1rr2z6GenCoroutineTest.test_is_coroutine_function..f3rrW)rrr4 assertFalseis_coroutine_functionr|rs rtest_is_coroutine_functionz+GenCoroutineTest.test_is_coroutine_function0si  }}Q 22156 11$78 2246:;r1c#|Ktjd}|}|j|dd|_yw)Nc,tjdrHrr0r1rr2z0GenCoroutineTest.test_sync_gen_return..f=rr1rITrr4r_rrr2r!s rtest_sync_gen_returnz%GenCoroutineTest.test_sync_gen_return;s>  !  !s $ rc#|Ktjd}|}|j|dd|_yw)Nc3XKtjtjdwrHr*r0r1rr2z1GenCoroutineTest.test_async_gen_return..fGrrrITrrs rtest_async_gen_returnz&GenCoroutineTest.test_async_gen_returnEs>  !  !s $ rc#|Ktjd}|}|j|dd|_yw)NcyrHr0r0r1rr2z,GenCoroutineTest.test_sync_return..fRsr1rITrrs rtest_sync_returnz!GenCoroutineTest.test_sync_returnPs>    s $ rc#|Ktjd}|}|j|dd|_yw)Nc30KtjywrHrr0r1rr2z-GenCoroutineTest.test_async_return..f\s** rWrITrrs rtest_async_returnz"GenCoroutineTest.test_async_returnZs>    s $ rc#Ktjfd}|}j|dd_yw)Nc3K ywrH)rTaskr5 add_callbackrsrr2z3GenCoroutineTest.test_async_early_return..fjs srITrrs` rtest_async_early_returnz(GenCoroutineTest.test_async_early_returnesA  6  6 s $ s.f1vrrc2Kd{}|S7wrr0)r!rs rf2z-GenCoroutineTest.test_async_await..f2~s4ZFM s rITrrrr!rs @rtest_async_awaitz!GenCoroutineTest.test_async_awaittsD  !  ! t $ s?Ac#VKd}|}|j|dd|_yw)NcLKddl}|jdd{y7w)NrrI)asynciosleep)rs rr2z3GenCoroutineTest.test_asyncio_sleep_zero..fs% '--" " " #s $"$rIT)r_rrs rtest_asyncio_sleep_zeroz(GenCoroutineTest.test_asyncio_sleep_zeros-  s $ rc#Ktjdfd}tjd}||g}|j|ddgd|_yw)Nc30Ktjywrrr0r1rrzGGenCoroutineTest.test_async_await_mixed_multi_native_future..f1rVrWc0Kd{y7wrHr0rsrrzGGenCoroutineTest.test_async_await_mixed_multi_native_future..f2s$JJ s c3XKtjtjdw)N+r*r0r1rf3zGGenCoroutineTest.test_async_await_mixed_multi_native_future..f3rrrIrTr)rrrrars @r*test_async_await_mixed_multi_native_futurez;GenCoroutineTest.test_async_await_mixed_multi_native_futuresg       !  !rt $ 2r(+ sAA!c#Kd}tjtjd|}|j |dd|_yw)Nc KywrHr0r0r1rrz4GenCoroutineTest.test_async_with_timeout..f1s sr))hoursrIT)r with_timeoutdatetime timedeltar_r)rrr!s rtest_async_with_timeoutz(GenCoroutineTest.test_async_with_timeoutsF ''(:(:(CRTJJ $ sAAc#zKtjd}|}|j|d|_yw)Ncyrr0r0r1rr2z5GenCoroutineTest.test_sync_return_no_value..fs r1Trr4 assertIsNonerrs rtest_sync_return_no_valuez*GenCoroutineTest.test_sync_return_no_values<    s &! 9;c#zKtjd}|}|j|d|_yw)Nc30Ktjywrrr0r1rr2z6GenCoroutineTest.test_async_return_no_value..fs**  rWTrrs rtest_async_return_no_valuez+GenCoroutineTest.test_async_return_no_values<    s &! rc#Ktjd}|}|jt5|dddd|_y#1swYd|_yxYww)Ncddz yr;r0r0r1rr2z+GenCoroutineTest.test_sync_raise..fr<r1Trr4r>r?rrr2futures rtest_sync_raisez GenCoroutineTest.test_sync_raisesV        0 1 L    3AA A AAc#Ktjd}|}|jt5|dddd|_y#1swYd|_yxYww)Nc3:Ktjddz ywr;rr0r1rr2z,GenCoroutineTest.test_async_raise..frCrDTrrs rtest_async_raisez!GenCoroutineTest.test_async_raisesV       0 1 L    rc#Ktjdtjfd}|}|jt5|dddd|_y#1swYd|_yxYww)Ncddz yr;r0r0r1rrz>GenCoroutineTest.test_replace_yieldpoint_exception..f1r<r1c3PK y#t$r twxYwwr)r?KeyErrorrsrrz>GenCoroutineTest.test_replace_yieldpoint_exception..f2s) !d $ !j  !s& &#&T)rr4r>rr)rrrrs @r!test_replace_yieldpoint_exceptionz2GenCoroutineTest.test_replace_yieldpoint_exceptionsp      !  !    x ( L    sA A6A#A6#A3(A6c#Ktjdtjfd}|}|j|dd|_yw)Ncddz yr;r0r0r1rrz>GenCoroutineTest.test_swallow_yieldpoint_exception..f1r<r1c3fK y#t$rtjdwxYwwrH)r?rrrsrrz>GenCoroutineTest.test_swallow_yieldpoint_exception..f2s/ %d $ %jjn$ %s1 1.1rITrrs @r!test_swallow_yieldpoint_exceptionz2GenCoroutineTest.test_swallow_yieldpoint_exceptionsY      %  % t $ sAAc# Kgtjfd}t}|jd|d||d|g|j dj dg|dtj |dtj g|j dj dd|_g|dtj |d|g|j dj dyw) Nc3XKtdD]}j||yw)N)rappend)name yieldablercallss rr2z'GenCoroutineTest.test_moment..f s+1X  T" s'*ab aaaaabbbbb abababababT abbbbbaaaa)rr4r set_resultr_joinrr)rr2 immediaters @r test_momentzGenCoroutineTest.test_moments    H T"i !C"344 6cjj!1S#**#566 6 cjj!1S)#455 6sD Dc#HKtjdd|_yw)N{Gz?T)rrrrs r test_sleepzGenCoroutineTest.test_sleep!siio s "c#KGddttjfd} |d |dd|_y#$r@}|jt |d|j |j Yd}~Sd}~wwxYw#$rG}|jt |d|j |j Yd}~d|_yd}~wwxYww) Nc eZdZy)IGenCoroutineTest.test_py3_leak_exception_context..LeakedExceptionNrrrr0r1rLeakedExceptionr+(s r1r-c|rr0) iterationr-s rinnerz?GenCoroutineTest.test_py3_leak_exception_context..inner+s!), ,r1r)1rR2T) Exceptionrr4r_rr __context__r)rr0r%r-s @rtest_py3_leak_exception_contextz0GenCoroutineTest.test_py3_leak_exception_context&s i   -  - -(N  -(N   -   SVS )   amm , , -  -   SVS )   amm , ,  -sQ(C  A BC  B6B C  BC C6C C CC ctjfdtjfd}jj|dj j d_y)Nc3KGdd}|}tj|_d}tj|t dw)Nc eZdZy)GGenCoroutineTest.test_coroutine_refcounting..inner..FooNr,r0r1rFoor9Csr1r:cyrr0r0r1rdummyzIGenCoroutineTest.test_coroutine_refcounting..inner..dummyIr1z Some error)weakrefref local_refrr4 ValueError)r: local_varr<rs rr0z:GenCoroutineTest.test_coroutine_refcounting..innerAsP  I$[[3DN '#--&( (\* *sAAc3@K y#t$rYywxYwwr)rA)r0srinner2z;GenCoroutineTest.test_coroutine_refcounting..inner2Os$ g   s  r^)timeoutT)rr4r5r6rr@r)rrDr0s` @rtest_coroutine_refcountingz+GenCoroutineTest.test_coroutine_refcounting=sh  +  +     fa0 $..*+ r1cd|_tj}|j|j|j |j dd}t j|}|j|tjdt|jjdzfz}t|}|j||y)NTc30Ktjywrrr0r1rr2z:GenCoroutineTest.test_asyncio_future_debug_info..fbrrWzcreated at %s:%dr^)rrget_event_loop addCleanup set_debug get_debugrr4assertIsInstancer__file____code__co_firstlinenoreprassertIn)r asyncio_loopr2rexpectedactuals rtest_asyncio_future_debug_infoz/GenCoroutineTest.test_asyncio_future_debug_info[s --/   .. 0F0F0HIt$  s}}Q! dGNN3&1::3L3Lq3P(QQd h'r1c#Ktjd}tj||}|j |ddgd|_yw)Nc3XKtjtjdwr(r*r0r1rr2z/GenCoroutineTest.test_asyncio_gather..fqs** **Q- rr)T)rr4rgatherr_r)rr2rets rtest_asyncio_gatherz$GenCoroutineTest.test_asyncio_gathermsR    NN13,, q!f% sAA)rrrrrrrr rrrrrrrrrrrrr rrr%r(r5r rFrVr[ __classcell__)rs@rrrs + <  "  $    &$774,:($  r1rc0eZdZejdZy)GenCoroutineSequenceHandlerc#Ktj|jdtj|jdtj|jdywNr1r23)rrwritefinishrs rgetzGenCoroutineSequenceHandler.get|sFjj 3jj 3jj CA+A-Nrrrrr4rdr0r1rr^r^{s]]r1r^c0eZdZejdZy)%GenCoroutineUnfinishedSequenceHandlerc#Ktj|jdtj|jdtj|jdywr`)rrrbrs rrdz)GenCoroutineUnfinishedSequenceHandler.getsEjj 3jj 3jj 3reNrfr0r1rrhrhs]]r1rhcTeZdZejdZejdZy)UndecoratedCoroutinesHandlerc#tKg|_tj|jjdyw)Nr1)chunksrrrrs rpreparez$UndecoratedCoroutinesHandler.prepares) jj 3s68c#K|jjdtj|jjdtj|j dj |jyw)Nr2rar)rmrrrrbr#rs rrdz UndecoratedCoroutinesHandler.getsW 3jj 3jj 2774;;'(sBBNrrrrr4rnrdr0r1rrkrks0]]   ]]))r1rkc6eZdZejdZdZy)AsyncPrepareErrorHandlerc#DKtjtdw)N)rrr rs rrnz AsyncPrepareErrorHandler.preparesjjns c&|jdy)Nok)rcrs rrdzAsyncPrepareErrorHandler.gets Dr1Nrpr0r1rrrrrs]]r1rrceZdZdZy)NativeCoroutineHandlerclKtjdd{|jdy7w)Nrrv)rrrbrs rrdzNativeCoroutineHandler.gets)mmA 4 s 424N)rrrrdr0r1rrxrxsr1rxc0eZdZdZdZdZdZdZdZy) GenWebTestc^tdtfdtfdtfdtfdt fgS)N/coroutine_sequence/coroutine_unfinished_sequence/undecorated_coroutine/async_prepare_error/native_coroutine)r r^rhrkrrrxrs rget_appzGenWebTest.get_appsE&(CD49*+GH')AB$&<=   r1c^|jd}|j|jdy)Nr}123fetchr_bodyrresponses rtest_coroutine_sequence_handlerz*GenWebTest.test_coroutine_sequence_handlers%::34 /r1c^|jd}|j|jdy)Nr~rrrs r*test_coroutine_unfinished_sequence_handlerz5GenWebTest.test_coroutine_unfinished_sequence_handlers%::>? /r1c^|jd}|j|jdy)Nrrrrs rtest_undecorated_coroutinesz&GenWebTest.test_undecorated_coroutiness%::67 /r1c^|jd}|j|jdy)Nrrt)rr_coders r test_async_prepare_error_handlerz+GenWebTest.test_async_prepare_error_handlers%::45 ,r1c|jd}|j|jd|j|jdy)Nrsok)rr_rrrs rtest_native_coroutine_handlerz(GenWebTest.test_native_coroutine_handlers9::12 , .r1N) rrrrrrrrrr0r1rr{r{s   000-/r1r{c|eZdZedZedZedZedZedZedZ edZ y) WithTimeoutTestc#K|jtj5tjt j dt dddy#1swYyxYww)N皙?seconds)r>r TimeoutErrorrrrrrs r test_timeoutzWithTimeoutTest.test_timeoutsR   s// 0 N""8#5#5c#BFHM M N N Ns A,5A  A, A)%A,c#Kt|jjtjdfdt j tjd}|j|dyw)Nrrc&jdS)Nasdf)r"rsrz?WithTimeoutTest.test_completes_before_timeout..sV5F5Fv5Nr1r)rr5 add_timeoutrrrrr_)rr!rs @rtest_completes_before_timeoutz-WithTimeoutTest.test_completes_before_timeoutsc     s +-N ''(:(:4(H&QQ (sA=Bc#4Kt|jjtjdfd|j t 5tjtjddddy#1swYyxYww)Nrrc6jtSr) set_exceptionr?rsrrz;WithTimeoutTest.test_fails_before_timeout..sF(():)<=r1r) rr5rrrr>r?rr)rrs @rtest_fails_before_timeoutz)WithTimeoutTest.test_fails_before_timeoutsx     s + =   0 1 M""8#5#5d#CVL L M M MsAB-B  B BBc#Kt}|jdtjt j d|}|j |dyw)Nrrr)rr"rrrrr_)rrr!s rtest_already_resolvedz%WithTimeoutTest.test_already_resolvedsK&!''(:(:4(H&QQ (sAAc #dKtjd5}|jtj5tj |j j|jtjdddddddy#1swYxYw#1swYyxYww)Nr)r) rThreadPoolExecutorr>rrrr5rvsubmitrrexecutors rtest_timeout_concurrent_futurez.WithTimeoutTest.test_timeout_concurrent_futures ' ' * h""3#3#34 &&LL%%'S)I       s4B0 B$ABB$ B0B! B$$B-)B0c#Ktjd5}d}|j|}|jt j t jd|dddy#1swYyxYww)Nr)cyrr0r0r1rr<z?WithTimeoutTest.test_completed_concurrent_future..dummyr=r1rr)rrrr!rrrr)rrr<r2s r test_completed_concurrent_futurez0WithTimeoutTest.test_completed_concurrent_futuresl ' ' * Hh &A HHJ""8#5#5d#CQG G H H HsA>AA2) A>2A;7A>c#Ktjd5}tjt j d|j ddddy#1swYyxYww)Nr)rrc,tjdS)Nr')rvrr0r1rrz?WithTimeoutTest.test_normal_concurrent_future..s 4(8r1)rrrrrrrrs rtest_normal_concurrent_futurez-WithTimeoutTest.test_normal_concurrent_futuresZ ' ' * h""""40 89    sA*=A A*A'#A*N) rrrr rrrrrrrr0r1rrrs NN))MM))  H Hr1rcbeZdZedZedZdZedZedZedZ y)WaitIteratorTestc~tj}|j|jd|j t 5tjt t }ddd|j|jd|j|jdy#1swYBxYw)Nzempty generator iterated)rgbad nil current indexbad nil current future) r WaitIteratorr|doner>rArr current_indexcurrent_future)rgs rtest_empty_iteratorz$WaitIteratorTest.test_empty_iterators     "<=   z * 9  vx8A 9 !//+BC !**,DE  9 9s (B33B<c#Kt}t}t}|jd|jd|jdtj|||}d}|j s|j }|dk(rK|j |jd|j|j||j |dn|dk(rK|j |jd|j|j||j |dnO|dk(rJ|j |jd|j|j||j |d|dz }|j s|j|jd|j|jdtj|| }|j s|j }|jd k(r'|j|j|k(xr|dk(d nT|jd k(r'|j|j|k(xr|dk(d n|jd |j|dz }|j s|j|jd|j|jdyw)NrITrr)rRrr)rrrz"WaitIterator dict status incorrectrzgot bad WaitIterator index ) rr"rrrnextr_rrrrr|fail) rrrrrrrdgdrs rtest_already_donez"WaitIteratorTest.test_already_done$s` X X X b b b   RR ( &&(ffhAAv  !4 a..3  B'a  !4 a..3  B'a  !4 a..3  B' FA!&&($ !//+BC !**,DE    +'')wwyB4'%%+8b8!!T)%%+8b8  78H8H7IJK FA'') !//+BC !**,DEsFK DK '9K c6|dk(r|djdnO|dk(r|djtn-|dk(r(|djd|djd |dkr+|jj |j |dz|yy) Nr^rRrrrr)rIr)r"rr?r5rfinish_coroutines)rr/rs rrz"WaitIteratorTest.finish_coroutinesYs > AJ ! !" % !^ AJ $ $%6%8 9 !^ AJ ! !" % AJ ! !" % q= LL % %d&<&.fs.A  '*A  !Av((B0JK((!]K'(KLLFA q% Q   a6$$Q,FG$$Q__aG!V$$Q,FG$$Q__aG#$@1$DEEQ!DMsbDA/A-A+A-AA/+A--A/.D/B=D?BDD B  DB D)rrrr|)rr2rs` @rtest_iterator_async_awaitz*WaitIteratorTest.test_iterator_async_awaitsT 8VXvx: q'*  !2c   &sA+A/c#Ktjtjdtjtj dj yw)Nrrr)rrrrrrrrs r test_no_refzWaitIteratorTest.test_no_refsG    s +S-=-=ciil-K-P-P-R  sA"A$N) rrrr rrrrrrr0r1rrrsp FF2F2Fh V2"'"'H  r1rc4eZdZdZedZdZdZdZy) RunnerGCTestcZtjdk(xrtjdkDS)NPyPy)r^)platformpython_implementationsys version_infors ris_pypy3zRunnerGCTest.is_pypy3s'--/69Uc>N>NQU>UUr1c#Kdgfdtjfd}tjtjd|yw)Ncbtjddjdy)NrRr{)gccollectr") weakref_scopesrcallbackz&RunnerGCTest.test_gc..callbacks& JJqM M!   ) )# .r1c3Kt}tj|d<jj |yw)Nr)rr>r?r5r)futrrrs rtesterz$RunnerGCTest.test_gc..testers8(C&{{3/M!  LL % %h /IsAA皙?r)rr4rrr)rrrrs` @@rtest_gczRunnerGCTest.test_gcsO  /     x11#>IIsAAc|j}ggtjfdtjfd}|j||j t j |jd|jtd|js|jdyy)Nc3K tjdjd)#jdwxYwwNTgMbP?rrrr!sr infinite_coroz9RunnerGCTest.test_gc_infinite_coro..infinite_coros= $))D/)MM$'  d#sA*/AAc3K}||_jtj|t j dywNr) _refcyclerr>r?rr)rrwfuts r do_somethingz8RunnerGCTest.test_gc_infinite_coro..do_somethings8/CCM KK C( )))C. sA ArrR) get_new_iolooprr4r6closerrrassertGreaterEquallenr)rlooprrr!rs @@@rtest_gc_infinite_coroz"RunnerGCTest.test_gc_infinite_coros""$  $  $  !  ! l#   '$q')$ F Q/}}   fRj )r1cddld|j}ggtjfd}|j |t dd5|j tjddd|jd|jtd|js|jdyy#1swYcxYw)NrcK tjdd{|jd/7#|jdwxYwwrrrs rrz@RunnerGCTest.test_gc_infinite_async_await..infinite_corosB $))D/))MM$') d#sA 646A  A c3Kjj}||_jt j |t jdywr)rI create_taskrrr>r?rr)rrrr!rs rrz?RunnerGCTest.test_gc_infinite_async_await..do_somethingsQ('((*66}V7LMCCM KK C( )))C. sA*A-rz$Task was destroyed but it is pendingrRr) rrrr4r6rrrrrrrr)rrrrrr!rs @@@@rtest_gc_infinite_async_awaitz)RunnerGCTest.test_gc_infinite_async_awaits $""$  !  ! l# y"H I  JJL JJL  '$q')$ F Q/}}   fRj )  s %CC(ctjd}|j}|j|}|j |ddgy)Nc3Ktjtjtjg}tj|wr)rmultirrrs r wait_a_momentz5RunnerGCTest.test_multi_moment..wait_a_moments399cjj#**%=>>F**V$ $sA A )rr4rr6r_)rrrr!s rtest_multi_momentzRunnerGCTest.test_multi_momentsL  %  %""$}- $.r1N) rrrrr rrrrr0r1rrrs/VJJ$"*H"*H /r1rctx_varzcontextvars module not presentceZdZdZej dZdZej dZdZ e dZ e dZ e dZ y ) ContextVarsTestclKtj||j|d{y7wrrsetr0r+s r native_rootzContextVarsTest.native_root!s" Ajjms *424c#dKtj|d|j|ywrr r+s rgen_rootzContextVarsTest.gen_root%s" A jjms.0cLKjtjjd{jtjt j j jdfdd{jtjtjjdfdd{jtjy777-w)Nc<jjSrrun thread_innerctxrr,srrz'ContextVarsTest.inner..2sARARTU9Vr1c<jjSrrrsrrz'ContextVarsTest.inner..7s#''$"3"3Q7r1) r_rrd gen_inner contextvars copy_contextr5run_in_executorrrI)rr,rs``@rr0zContextVarsTest.inner+s *nnQ *&&(ll**41VWWW *$$&66 7    * X s59D$DA D$D  AD$4D"5*D$ D$"D$c#K|jtj|d|jtj|ywrr_rrdr+s rrzContextVarsTest.gen_inner;s5 *  *sAAcL|jtj|yrrr+s rrzContextVarsTest.thread_innerAs *r1c#K|jd|jd|jd|jdgyw)Nr)rRr^)rrrs rtest_propagatezContextVarsTest.test_propagateDsF   Q    Q  MM!  MM!    sAAc#hKtjd}dtj|ywr()rr reset)rtokens r test_resetzContextVarsTest.test_resetOs$ A   es02c#\Kdfd}tj|yw)N cVKjtjywrrr+srnative_async_functionzgContextVarsTest.test_propagate_to_first_yield_with_native_async_function..native_async_function[s   W[[]A .s&))rr )rr*r,s` @r8test_propagate_to_first_yield_with_native_async_functionzHContextVarsTest.test_propagate_to_first_yield_with_native_async_functionWs'  /  A#%%s(,N)rrrrrr4rr0rrr r"r&r+r0r1rr r s} ]] +  ]]++ +  &&r1r __main__)2r concurrentrrrrrrvr>unittesttornado.concurrentr tornado.logrtornado.testingrrrr tornado.test.utilr tornado.webr r r tornadorr ImportErrortyping TYPE_CHECKINGrrrrr^rhrkrrrxr{rrr ContextVarrskipIfr rmainr0r1rr;s_  %QQ,>> %x;=x;v_}_D . N  )> ) ~^ "/""/J=m=@T }T ni/=i/X$k$$Y/G$&FG?&m?&H?&D zHMMO["KsD::EE