+
    Bi                       R 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t^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ R	IHt R
 tR tRIR ltR t ! R R4      t ! R R4      t ! R R4      t R t! ! R R4      t"]PF                  ! ]$! ]R4      ;'       d
    ]$! ]R4      R4       ! R R] ]"]PJ                  4      4       t&]PF                  ! ]$! ]R4      ;'       d
    ]$! ]R4      R4      ]! ! R R] ]PJ                  4      4       4       t']PF                  ! ]$! ]R4      R4      ]! ! R R] ]PJ                  4      4       4       t(]PF                  ! ]$! ]R4      R4      ]! ! R  R!] ]PJ                  4      4       4       t)]PF                  ! ]$! ]R4      R4       ! R" R#] ]PJ                  4      4       t*]PF                  ! ]$! ]R4      R4       ! R$ R%] ]PJ                  4      4       t+ ! R& R'] ]"]PJ                  4      t,]! ! R( R)] ]PJ                  4      4       t-]PF                  ! ]$! ]R4      R4       ! R* R+]PJ                  4      4       t. ! R, R-4      t/ ! R. R/]PJ                  ]/4      t0]PF                  ! ]$! ]R04      R4       ! R1 R2]PJ                  ]/4      4       t1 ! R3 R44      t2 ! R5 R6]2]PJ                  4      t3]PF                  ! ]$! ]R4      ;'       d
    ]$! ]R74      R4       ! R8 R9]2]PJ                  4      4       t4 ! R: R;]PJ                  4      t5 ! R< R=4      t6 ! R> R?]6]PJ                  4      t7 ! R@ RA]6]PJ                  4      t8 ! RB RC]PJ                  4      t9 ! RD RE]PJ                  4      t: ! RF RG]PJ                  4      t;]<RH8X  d   ]Pz                  ! 4        R# R# )JzTests for tasks.py.N)mock)GenericAlias)futures)tasks)utils)support)assert_python_ok)ignore_warningsc                  D    \         P                  P                  R 4       R # N)asyncioevents_set_event_loop_policy     3/usr/lib/python3.14/test/test_asyncio/test_tasks.pytearDownModuler      s    NN))$/r   c                     "   R # 5ir   r   r   r   r   coroutine_functionr      s        c                     V'       d   R V,          pM	RV,          pVe.   VR,          pRV : RV: RV: RV^ ,          : RV^,          : 2
# RV : RV: RV: R2# )	z%sz%s, definedzcoro=<z() z at z> created at :>r   )qualnamestatesrcsource_traceback	generatorframes   &&&&& r   format_coroutiner    "   s[    u%# $UCq58= 	> $
 *25#>>r   c                t    ^ p V P                   pVf   MTp V^,          pK  \        V 4      V P                  V3# )zH
Return information about the innermost exception context in the chain.
)__context__typeargs)excdepthcontexts   &  r   get_innermost_contextr(   /   s@     E
//?
Isxx''r   c                   ,   a  ] tR t^?t o R tR tRtV tR# )Dummyc                    R # )z<Dummy>r   selfs   &r   __repr__Dummy.__repr__A   s    r   c                    R # r   r   )r-   r$   s   &*r   __call__Dummy.__call__D       r   r   N)__name__
__module____qualname____firstlineno__r.   r1   __static_attributes____classdictcell____classdict__s   @r   r*   r*   ?   s      r   r*   c                   8   a  ] tR t^Ht o R tR tR tR tRtV t	R# )CoroLikeObjectc                    \        ^*4      h*   )StopIteration)r-   vs   &&r   sendCoroLikeObject.sendI   s    Br   c                    R # r   r   )r-   r%   s   &*r   throwCoroLikeObject.throwL   r3   r   c                    R # r   r   r,   s   &r   closeCoroLikeObject.closeO   r3   r   c                    V # r   r   r,   s   &r   	__await__CoroLikeObject.__await__R   s    r   r   N)
r4   r5   r6   r7   rC   rF   rI   rL   r8   r9   r:   s   @r   r=   r=   H   s       r   r=   c                     a a ] tR t^Vt oRtRtRtRR ltR tV 3R 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+ t0R, t1R- t2R. t3R/ t4R0 t5R1 t6R2 t7R3 t8R4 t9R5 t:R6 t;R7 t<R8 t=R9 t>R: t?R; t@R< tAR= tBR> tCR? tDR@ tERA tFRB tGRC tHRD tIRE tJRF tKRG tLRH tMRI tNRJ tORK tPRL tQRM tRRN tSRO tT]U! ]VRP7      RQ 4       tW]U! ]VRP7      RR 4       tXRS tYRT tZRU t[RV t\RW t]RX t^RY t_RZ t`R[ taR\ tbR] tcR^ tdR_ teR` tfRa tgRb thRc tiRd tjRe tkRf tlRg tmRh tnRi to]pP                  ! Rj4      Rk 4       trRl tsRm ttRn tuRo tv]pP                  ! Rj4      Rp 4       twRq txRr tyRs tzRt t{Ru t|Rv t}Rw t~Rx tRy tRz tR{ tR| tR} tR~ tR tR tRtVtV ;t# )BaseTaskTestsNc                >    V P                   P                  W!W4VR 7      # ))loopnamer'   eager_start)	__class__Task)r-   rQ   cororR   r'   rS   s   &&&&&&r   new_taskBaseTaskTests.new_task\   s    ~~""4\g"hhr   c                :    V P                   P                  VR 7      # rQ   )rT   Futurer-   rQ   s   &&r   
new_futureBaseTaskTests.new_future_   s    ~~$$$$//r   c                   <a  \         SS `  4        S P                  4       S n        S P                  P	                  S P
                  4       V 3R  lS P                  n        R# )c                  :   < S P                  S P                  4      # r   )r^   rQ   r,   s   r   <lambda>%BaseTaskTests.setUp.<locals>.<lambda>f   s    $//$))*Dr   N)supersetUpnew_test_looprQ   set_task_factoryrW   create_futurer-   rT   s   fr   re   BaseTaskTests.setUpb   s>    &&(			""4==1"D		r   c                    V P                   P                  \        ,          pV P                  VP                  \        34       V P                  V\        4       R # r   )rT   rU   strassertEqual__args__assertIsInstancer   r-   tasks   & r   test_generic_alias BaseTaskTests.test_generic_aliash   s<    ~~""3'/dL1r   c                   R  pV P                  V P                  V! 4       4      pV P                  VR4       V P                  VP                  R4       VP                  R4       V P                  VP                  R4       V P                  \        P                  4      ;_uu_ 4       pV P                  P                  V4       RRR4       V P                  RXP                  P                  ^ ,          4       R#   + '       g   i     L?; i)c                     "   R # 5ir   r   r   r   r   rV   ;BaseTaskTests.test_task_cancel_message_getter.<locals>.coron        r   _cancel_messageN
my message)rW   rQ   assertHasAttrrm   rx   cancelassertRaisesr   CancelledErrorrun_until_complete	exceptionr$   r-   rV   tcms   &   r   test_task_cancel_message_getter-BaseTaskTests.test_task_cancel_message_getterm   s    	MM$))TV,1/0**D1	**L9w5566"II((+ 7 	r||'8'8';< 76s   'C::D
	c                   R  pV P                  V P                  V! 4       4      pVP                  R4       RVn        V P	                  VP                  R4       V P                  \        P                  4      ;_uu_ 4       pV P                  P                  V4       RRR4       V P	                  RXP                  P                  ^ ,          4       R#   + '       g   i     L?; i)c                     "   R # 5ir   r   r   r   r   rV   ;BaseTaskTests.test_task_cancel_message_setter.<locals>.coro}   rw   r   ry   zmy new messageN)rW   rQ   r{   rx   rm   r|   r   r}   r~   r   r$   r   s   &   r   test_task_cancel_message_setter-BaseTaskTests.test_task_cancel_message_setter|   s    	MM$))TV,	,**,<=w5566"II((+ 7 	)2<<+<+<Q+?@ 76s    CC#	c                   a  ! R  R4      oV3R lpV P                   P                  \        P                  ! \	        ^d4       Uu. uF#  q P                  V P                   V! 4       4      NK%  	  up!  4       R# u upi )c                   &   a  ] tR t^t o R tRtV tR# )1BaseTaskTests.test_task_del_collect.<locals>.Evilc                0    \         P                  ! 4        R # r   )gccollectr,   s   &r   __del__9BaseTaskTests.test_task_del_collect.<locals>.Evil.__del__   s    

r   r   Nr4   r5   r6   r7   r   r8   r9   r:   s   @r   Evilr      s      r   r   c                     <"   S ! 4       # 5ir   r   )r   s   r   run0BaseTaskTests.test_task_del_collect.<locals>.run   s     6Ms   N)rQ   r~   r   gatherrangerW   )r-   r   _r   s   &  @r   test_task_del_collect#BaseTaskTests.test_task_del_collect   sa    	 		 			$$NN9>s9CAdii/ 	s   )A8c                Z   \         P                  ! 4       pV P                  V4      pR  p V P                  \        R4      ;_uu_ 4        V P
                  P                  V! V4      4       RRR4       VP                  4        R#   + '       g   i     L"; i  TP                  4        i ; i)c                 &   "   V G R j  xL
  R #  L5ir   r   futs   &r   r   1BaseTaskTests.test_other_loop_future.<locals>.run   s     IIs   zTask .* got Future .* attachedN)r   new_event_loopr^   assertRaisesRegexRuntimeErrorrQ   r~   rI   )r-   
other_loopr   r   s   &   r   test_other_loop_future$BaseTaskTests.test_other_loop_future   s    ++-
ooj)		''(IK K		,,SX6K 	K K s#   B 	"B+B B	B B*c                  a V3R  lp\         P                  ! V! 4       V P                  R7      oV P                  \        R4      ;_uu_ 4        V P                  P                  S4       RRR4       R#   + '       g   i     R# ; i)c                  (   <"   S G R j  xL
  R #  L5ir   r   )rq   s   r   test6BaseTaskTests.test_task_awaits_on_itself.<locals>.test   s     JJ   r[   zTask cannot await on itselfN)r   ensure_futurerQ   r   r   r~   )r-   r   rq   s   & @r   test_task_awaits_on_itself(BaseTaskTests.test_task_awaits_on_itself   sg    	 $$TV$))<##L$AC CII((.C C C Cs   A33B	c                   R  pV P                  V P                  V! 4       4      pV P                  P                  V4       V P                  VP	                  4       4       V P                  VP                  4       R4       V P                  VP                  V P                  4       V P                  VP                  4       V P                  4       \        P                  ! 4       pV P                  V4       V P                  W1! 4       4      pV P                  VP                  V4       VP                  V4       VP                  4        R# )c                     "   R # 5iokr   r   r   r   notmuch.BaseTaskTests.test_task_class.<locals>.notmuch        r   r   N)rW   rQ   r~   
assertTruedonerm   resultassertIs_loopget_loopr   r   set_event_looprI   )r-   r   r   rQ   s   &   r   test_task_classBaseTaskTests.test_task_class   s    	MM$))WY/		$$Q'!T*aggtyy)ajjlDII.%%'D!MM$	*aggt$"

r   c                D  a R  o\         P                  ! S! 4       V P                  R7      pV P                  VP                  V P                  4       V P                  P                  V4       V P                  VP                  4       4       V P                  VP                  4       R4       S! 4       pV P                  VP                  4       V P                  \        R4      ;_uu_ 4        \         P                  ! V4       RRR4       V3R lpV P                  P                  V! 4       4      pV P                  VP                  V P                  4       V P                  P                  V4       V P                  VP                  4       4       V P                  VP                  4       R4       \         P                  ! V P                  4       V P                  \         P                  R4       \         P                  ! S! 4       4      pV P                  VP                  V P                  4       V P                  P                  V4       V P                  VP                  4       4       V P                  VP                  4       R4       R#   + '       g   i     EL; i)c                     "   R # 5ir   r   r   r   r   r   ;BaseTaskTests.test_ensure_future_coroutine.<locals>.notmuch   r   r   r[   r   no current event loopNc                  B   <"   \         P                  ! S ! 4       4      # 5ir   )r   r   )r   s   r   r   8BaseTaskTests.test_ensure_future_coroutine.<locals>.test   s     ((33   )r   r   rQ   r   r   r~   r   r   rm   r   
addCleanuprI   r   r   r   )r-   r   ar   r   s   &   @r   test_ensure_future_coroutine*BaseTaskTests.test_ensure_future_coroutine   s   	!!')$))<aggtyy)		$$Q'!T*I ##L2IJJ!!!$ K	4II((0aggtyy)		$$Q'!T* 	tyy)..5!!'),aggtyy)		$$Q'!T*% KJJs   ,JJ	c                   V P                  V P                  4      pVP                  R 4       \        P                  ! V4      pV P                  P                  V4       V P                  VP                  4       4       V P                  VP                  4       R 4       V P                  W!4       \        P                  ! 4       pV P                  V4       V P                  \        4      ;_uu_ 4        \        P                  ! WR7      pRRR4       VP                  4        \        P                  ! WP                  R7      pV P                  W!4       R#   + '       g   i     LT; i)kor[   N)r^   rQ   
set_resultr   r   r~   r   r   rm   r   r   r   r   r|   
ValueErrorrI   )r-   f_origfrQ   s   &   r   test_ensure_future_future'BaseTaskTests.test_ensure_future_future   s    +$!!&)		$$Q'!T*a %%'D!z**%%f8A + 	

!!&yy9a  +*s   1EE%	c                   R  pV P                  V P                  V! 4       4      p\        P                  ! V4      pV P                  P	                  V4       V P                  VP                  4       4       V P                  VP                  4       R4       V P                  W24       \        P                  ! 4       pV P                  V4       V P                  \        4      ;_uu_ 4        \        P                  ! W$R7      pRRR4       VP                  4        \        P                  ! W P                  R7      pV P                  W24       R#   + '       g   i     LT; i)c                     "   R # 5ir   r   r   r   r   r   6BaseTaskTests.test_ensure_future_task.<locals>.notmuch   r   r   r   r[   N)rW   rQ   r   r   r~   r   r   rm   r   r   r   r   r|   r   rI   )r-   r   t_origr   rQ   s   &    r   test_ensure_future_task%BaseTaskTests.test_ensure_future_task   s    	tyy')4!!&)		$$Q'!T*a %%'D!z**%%f8A + 	

!!&yy9a  +*s   )EE	c                    ! R  R4      pR p\         P                  ! 4       pV P                  V4       \         P                  ! V! V! 4       4      VR7      pVP	                  V4       V P                  VP                  4       R4       R# )c                   ,   a  ] tR tRt o R tR tRtV tR# )6BaseTaskTests.test_ensure_future_awaitable.<locals>.Awi
  c                    Wn         R # r   rV   r-   rV   s   &&r   __init__?BaseTaskTests.test_ensure_future_awaitable.<locals>.Aw.__init__  s     	r   c                6    V P                   P                  4       # r   )rV   rL   r,   s   &r   rL   @BaseTaskTests.test_ensure_future_awaitable.<locals>.Aw.__await__  s    yy**,,r   r   N)r4   r5   r6   r7   r   rL   r8   r9   r:   s   @r   Awr   
  s     !- -r   r   c                     "   R # 5ir   r   r   r   r   rV   8BaseTaskTests.test_ensure_future_awaitable.<locals>.coro  r   r   r[   r   N)r   r   r   r   r~   rm   r   )r-   r   rV   rQ   r   s   &    r   test_ensure_future_awaitable*BaseTaskTests.test_ensure_future_awaitable	  sk    	- 	-	 %%'D!##BtvJT:$t,r   c                    ! R  R4      p\         P                  ! 4       pV P                  V4       \         P                  ! V! 4       VR7      pVP	                  V4       V P                  VP                  4       4       V P                  VP                  4       R4       V P                  VP                  4       \        P                  4       VP                  4        R# )c                   &   a  ] tR tRt o R tRtV tR# );BaseTaskTests.test_ensure_future_task_awaitable.<locals>.Awi  c                N    \         P                  ! ^ RR7      P                  4       # )    r   r   )r   sleeprL   r,   s   &r   rL   EBaseTaskTests.test_ensure_future_task_awaitable.<locals>.Aw.__await__  s    }}Qt4>>@@r   r   N)r4   r5   r6   r7   rL   r8   r9   r:   s   @r   r   r     s     A Ar   r   r[   r   N)r   r   r   r   r~   r   r   rm   r   ro   get_corotypesCoroutineTyperI   )r-   r   rQ   rq   s   &   r   !test_ensure_future_task_awaitable/BaseTaskTests.test_ensure_future_task_awaitable  s    	A 	A %%'D!$$RT5%		$-dmmou/B/BC

r   c                    V P                  \        4      ;_uu_ 4        \        P                  ! R 4       RRR4       R#   + '       g   i     R# ; i)r   N)r|   	TypeErrorr   r   r,   s   &r   test_ensure_future_neither(BaseTaskTests.test_ensure_future_neither'  s0    y))!!$' *)))s	   ?A	c                (   \         P                  ! 4       pV P                  V P                  4      pV P	                  \
        R 4      ;_uu_ 4        \         P                  ! W!R7       RRR4       VP                  4        R#   + '       g   i     L"; i)zRThe future belongs to a different loop than the one specified as the loop argumentr[   N)r   r   r^   rQ   r   r   r   rI   )r-   rQ   r   s   &  r   test_ensure_future_error_msg*BaseTaskTests.test_ensure_future_error_msg+  sg    %%'OODII&##J 18 9 9 !!!/9 	

	9 9s   BB	c                |   a aaa R oV3R loVV 3R loVVV 3R lpS P                   P                  V! 4       4       R # )Nc                  2   <"   S ! 4       G R j  xL
  R #  L5ir   r   )bars   r   foo)BaseTaskTests.test_get_stack.<locals>.foo7  s     %KKs   c                  X  <"   SP                  ^R7      p  SP                  V ^ ,          P                  P                  R4       Rp \        P
                  ! 4       pSP                  ^VR7       VP                  ^ 4       VP                  4       pSP                  VR4       R#   Rp i ; i5i)   )limitr   N)r  filezfoo\(\) running)
	get_stackrm   f_codeco_nameioStringIOprint_stackseekreadassertRegex)r   r  tbTr-   s      r   r   )BaseTaskTests.test_get_stack.<locals>.bar:  s     !$A  1!4!4e< ;;=DMMM-IIaLBR!34 s   B*-B# AB*#B''B*c                  v   <"   \         P                  ! S! 4       SP                  R 7      o S G Rj  xL
  R#  L5ir[   N)r   r   rQ   )r  r   r-   s   r   runner,BaseTaskTests.test_get_stack.<locals>.runnerI  s%     %%ce$))<AGGs   -979rQ   r~   )r-   r  r  r   r   s   f @@@r   test_get_stackBaseTaskTests.test_get_stack4  s-    		5	
 			$$VX.r   c                   V P                   P                  R 4       R pV P                  VP                  R4       V P	                  VP
                  R4       V P                  VP                  \        4       \        P                  ! V4      w  r#V: RV: 2pV! 4       pRpV P                  VP                  R4       V P                  VP
                  V4       V P                  V P                   V4      pVP                  \        4       4       \        VRVVP                  RR7      pV P                  \        V4      R	V,          4       VP                  4        V P                  \        V4      R
V,          4       V P!                  \"        P$                  V P                   P&                  V4       \        VRVVP                  4      pV P                  \        V4      RV,          4       V P                  V P                   V! 4       4      pV P                   P'                  V4       \        VRVVP                  4      pV P                  \        V4      RV,          4       R# )Fc                     "   R # 5iabcr   r   r   r   r   -BaseTaskTests.test_task_repr.<locals>.notmuchS       r   r   z#\w+.test_task_repr.<locals>.notmuchr   z-BaseTaskTests.test_task_repr.<locals>.notmuchrunningT)r   z0<Task pending name='TestTask' %s cb=[<Dummy>()]>z3<Task cancelling name='TestTask' %s cb=[<Dummy>()]>r   z#<Task cancelled name='TestTask' %s>z/<Task finished name='TestTask' %s result='abc'>N)rQ   	set_debugrm   r4   r  r6   r5   
test_utilsget_function_sourcerW   add_done_callbackr*   r    _source_tracebackreprr{   r|   r   r}   r~   )	r-   r   filenamelinenor   gencoro_qualnamer   rV   s	   &        r   test_task_reprBaseTaskTests.test_task_reprP  s   		E"	 	))95--?	A++X6%99'B!6* iGy1))=9 MM$))S)	EG$y# ! 3 3tEaKdR	T 	

aNQUU	W 	'00))66	;vs ! 3 35a>E	G MM$))WY/		$$Q'vs ! 3 35aJTQ	Sr   c                   R  pV P                  V P                  V! 4       R4      pV P                  V P                  V! 4       R4      pV P                  \        V4      \        V4      4       \        P
                  ! R\        V4      4      pV P                  V4       \        P
                  ! R\        V4      4      pV P                  V4       V P                  \        VP                  ^4      4      \        VP                  ^4      4      4       V P                  P                  V4       V P                  P                  V4       R# )c                     "   ^{# 5i{   r   r   r   r   r   ;BaseTaskTests.test_task_repr_autogenerated.<locals>.notmuch       r   Nz ^<Task pending name='Task-(\d+)')rW   rQ   assertNotEqualr#  rematchassertIsNotNone
assertLessintgroupr~   )r-   r   t1t2match1match2s   &     r   test_task_repr_autogenerated*BaseTaskTests.test_task_repr_autogenerated  s    	 ]]499gi6]]499gi6DHd2h/=tBxHV$=tBxHV$ 	FLLO,c&,,q/.BC		$$R(		$$R(r   c                *   R  pV P                  V P                  V! 4       RR7      pV P                  VP                  4       R4       VP	                  R4       V P                  VP                  4       R4       V P                  P                  V4       R# )c                     "   ^{# 5ir,  r   r   r   r   r   8BaseTaskTests.test_task_set_name_pylong.<locals>.notmuch  r/  r   ih:rR   	987654321i[	123456789N)rW   rQ   rm   get_nameset_namer~   r-   r   r   s   &  r   test_task_set_name_pylong'BaseTaskTests.test_task_set_name_pylong  sm    	 MM$))WYYM?{3	

9{3		$$Q'r   c                    R  pV P                  V P                  V! 4       4      pVP                  ^04       V P                  VP	                  4       R4       V P                  P                  V4       R# )c                     "   ^{# 5ir,  r   r   r   r   r   :BaseTaskTests.test_task_repr_name_not_str.<locals>.notmuch  r/  r   z{6}N)rW   rQ   rD  rm   rC  r~   rE  s   &  r   test_task_repr_name_not_str)BaseTaskTests.test_task_repr_name_not_str  sT    	 MM$))WY/	

A3u-		$$Q'r   c           	        V P                   P                  R 4       R pV P                  V P                   4      pV P                  V P                   V! V4      4      p\        P
                  ! V P                   4       V P                  \        V4      R\        P                  ! \        V4      4      ,          4       VP                  R4       V P                   P                  V4       R# )Fc                 "   "   V G R j  xL
 #  L5ir   r   r   s   &r   wait_for7BaseTaskTests.test_task_repr_wait_for.<locals>.wait_for  s     99   z<Task .* wait_for=%s>N)rQ   r  r^   rW   r  run_brieflyr  r#  r1  escaper   r~   )r-   rO  r   rq   s   &   r   test_task_repr_wait_for%BaseTaskTests.test_task_repr_wait_for  s    		E"	 oodii(}}TYY6tyy)d0299T#Y3GG	I 	t		$$T*r   c                   aa VV3R  lpR oR oV! 4       pV P                  V P                  P                  V4      R4       R# )c                  `   <"   S! 4       G R j  xL
 p S! 4       G R j  xL
 pW,           #  L L5ir   r   )r   binner1inner2s     r   outer-BaseTaskTests.test_task_basics.<locals>.outer  s'     hAhA3J s   .*.,..c                     "   ^*# 5ir?   r   r   r   r   rY  .BaseTaskTests.test_task_basics.<locals>.inner1       r   c                     "   R # 5i)i  r   r   r   r   rZ  .BaseTaskTests.test_task_basics.<locals>.inner2  r   r   i  N)rm   rQ   r~   )r-   r[  r   rY  rZ  s   &  @@r   test_task_basicsBaseTaskTests.test_task_basics  s:    	
		 G55a8$?r   c                
  a aa \         P                  ! 4       oS P                  S4       R  oVVV 3R lp S P                  SV! 4       4      pSP	                  V4       SP                  4        R#   SP                  4        i ; i)c                     "   \         h5ir   r   r   r   r   raise_errorFBaseTaskTests.test_exception_chaining_after_await.<locals>.raise_error  s        	c                    <"    \        ^4      h  \         d   p SP                  SS! 4       4      p TG Rj  xL 
   Rp ? R#   \         dh   p SP                  \	        T 4      \
        4       T P                  pSP                  \	        T4      TP                  3\         R34        Rp ?  Rp ? R# Rp ? ii ; iRp ? ii ; i5i)   N)rk  )KeyError	ExceptionrW   rm   r#   r   r"   r$   )r%   rq   chainedrQ   rg  r-   s      r   r   >BaseTaskTests.test_exception_chaining_after_await.<locals>.run  s     
*qk! *}}T;=9*JJ  *$$T#Y
;!ooG$$d7mW\\%B!4(* **	*sW   C B>B9A;ACB6AB1'B9+C1B66B99B>>CN)r   r   r   rW   r~   rI   )r-   r   rq   rQ   rg  s   f  @@r   #test_exception_chaining_after_await1BaseTaskTests.test_exception_chaining_after_await  sc     %%'D!		*	==su-D##D)JJLDJJLs   (A0 0Bc                6  a aaa R o\         P                  ! 4       oS P                  S4       R oVVVV 3R lp S P                  SV! 4       4      pSP	                  V4       SP                  4        S P                  SR4       R #   SP                  4        i ; i)Nc                    "   V h5ir   r   )r%   s   &r   process_excYBaseTaskTests.test_exception_chaining_after_await_with_context_cycle.<locals>.process_exc  s
     Ir   c                     <"    \        R 4      h  \         da   p SP                  SS! T 4      4      p TG Rj  xL 
   Rp ? R#   \         d$   p Y P                  J oRT n         Rp ?  Rp ? R# Rp ? ii ; iRp ? ii ; i5i)r   N)rl  rm  rW   BaseExceptionr"   )r%   rq   	has_cyclerQ   rt  r-   s     r   r   QBaseTaskTests.test_exception_chaining_after_await_with_context_cycle.<locals>.run  si     	+sm# +}}T;s+;<+JJ$ +!$!7I&*COO+	+sV   A> A;A6A<AA>A3A.$A6(A>.A33A66A;;A>F)r   r   r   rW   r~   rI   rm   )r-   r   rq   rx  rQ   rt  s   f  @@@r   6test_exception_chaining_after_await_with_context_cycleDBaseTaskTests.test_exception_chaining_after_await_with_context_cycle  s     	%%'D!		+ 	+	==su-D##D)JJLE* JJLs   (B Bc                   \         P                  ! 4       pR  p V P                  W! 4       4      pV P                  VP	                  4       4       V P                  R\        V4      4       V P                  VP                  4       4       V P                  VP	                  4       4       V P                  R\        V4      4       V P                  VP                  4       4       V P                  \         P                  4      ;_uu_ 4        VP                  V4       RRR4       VP                  4        R#   + '       g   i     L"; i  TP                  4        i ; i)c                  N   "   \         P                  ! ^
4      G Rj  xL
  R#  L5i
   Nr   r   r   r   r   rq   +BaseTaskTests.test_cancelling.<locals>.task	       --###   %#% cancelling N)r   r   rW   assertFalse
cancellingassertNotInr#  r   r{   assertInr|   r}   r~   rI   r-   rQ   rq   r   s   &   r   test_cancellingBaseTaskTests.test_cancelling  s    %%'	$	dDF+AQ\\^,^T!W5OOAHHJ'OOALLN+MM.$q'2
 OOAHHJ'""7#9#9::''* ; JJL ;: JJLs$   C/E 	D5E 5E	 E Ec                l  a  \         P                  ! 4       pV 3R  lp S P                  W! 4       4      pVP                  \         P                  ! R4      4       S P                  VP                  4       4       S P                  R\        V4      4       S P                  VP                  4       ^4       S P                  VP                  4       4       VP                  \         P                  ! R4      4       S P                  R\        V4      4       S P                  VP                  4       ^ 4       S P                  VP                  4       4       S P                  VP                  4       4       S P                  VP                  4       ^4       S P                  VP                  4       4       S P                  \         P                  4      ;_uu_ 4        VP                  V4       RRR4       S P                  VP                  4       4       S P                  VP!                  4       4       VP#                  4        S P                  VP                  4       4       S P                  VP!                  4       4       VP%                  4        R#   + '       g   i     L; i  TP%                  4        i ; i)c                    <"    \         P                  ! ^
4      G Rj  xL
  R#  L  \         P                   dB    S P                  4       P	                  4        \         P                  ! ^
4      G Rj  xL 
   R# i ; i5ir~  )r   r   r}   current_taskuncancelr,   s   r   rq   /BaseTaskTests.test_uncancel_basic.<locals>.task!  sX     (mmB''')) (!!#,,.mmB'''(s>   B ' %' B ' AA=3A64A=9B <A==B {Gz?r  N)r   r   rW   r~   r   r   r{   r  r#  rm   r  r  	cancelledr  r|   r}   r   r  rI   r  s   f   r   test_uncancel_basic!BaseTaskTests.test_uncancel_basic  s   %%'	(	dDF+A##GMM$$78 OOAHHJ'MM.$q'2Q\\^Q/Q[[]+##GMM$$78 ^T!W5Q\\^Q/Q[[]+ OOAHHJ'Q\\^Q/Q[[]+""7#9#9::''* ;OOAKKM*OOAFFH% JJLOOAKKM*OOAFFH%JJL ;: JJLs%   F8J! J(BJ! J	J! !J3c                  a  \         P                  ! 4       pR  V 3R llp S P                  W! RRR7      4      pVP                  V4      w  rEpS P	                  V4       S P                  V4       S P	                  V4       S P                  VP                  4       ^ 4       S P                  W! ^ RR7      4      pVP                  V4      w  rEpS P                  V4       S P	                  V4       S P	                  V4       S P                  VP                  4       ^ 4       VP                  4        R#   TP                  4        i ; i)c                0    V ^8  d   QhR\         R\         /# )   r   timeout)float)formats   "r   __annotate__CBaseTaskTests.test_uncancel_structured_blocks.<locals>.__annotate__X  s     >	L >	Le >	Le >	Lr   c                   <aa"   S	P                  4       oSP                  4       pR oR pR pVV3R lpVP                  W4      p  \        P                  ! V 4      G Rj  xL
  RpVP                  4        S'       dL   SP                  4       ^ 8X  d7   \        \        P                  ! 4       4      \        P                  J d   \        hRp\        P                  ! ^ 4      G Rj  xL
  SY43#  L  TP                  4        S'       dN   SP                  4       ^ 8X  d8   \        \        P                  ! 4       4      \        P                  J d   \        hi i i ; i  \         d    S	P                  S4        Li ; i L5i)Fc                  ,   < R oS P                  4        R# TNr{   )rq   	timed_outs   r   
on_timeoutdBaseTaskTests.test_uncancel_structured_blocks.<locals>.make_request_with_timeout.<locals>.on_timeout`  s     	r   NT)r  r   
call_laterr   r   r{   r  r#   sysr   r}   TimeoutErrorr   )
r   r  rQ   structured_block_finishedouter_code_reachedr  timeout_handlerq   r  r-   s
   $$     @@r   make_request_with_timeoutPBaseTaskTests.test_uncancel_structured_blocks.<locals>.make_request_with_timeoutX  sE    $$&D==?DI(-%!&
 "__WAN++(+!--...04-"))+! MMOq0 1W5K5KK> +*
 "&--"""7KK[ / #))+! MMOq0 1W5K5KK> +*? L 1 "D   +	*+
 #s[   ?E=C/ C- C/ &A#E 	E=$E;%E=-C/ /A'EE E85E=7E88E=      $@皙?)r   r  N)	r   r   rW   r~   r   r  rm   r  rI   )r-   rQ   r  r7  r  r  r  r8  s   f       r   test_uncancel_structured_blocks-BaseTaskTests.test_uncancel_structured_blocksH  s     %%'>	L >	L@	t%>TSV%WXB''+ EI2D OOI&67OO./ R]]_a0 t%>QPT%UVB''+ EI2D Y'OO56OO./R]]_a0JJLDJJLs   D D3 3Ec                  a V3R  lp\         P                  ! 4       p\         P                  ! VR7      oV P                  W!! 4       4      pVP	                  \         P
                  ! ^ 4      4       SP                  R4        VP                  4        V P                  VP                  4       ^4       V P                  VP                  4       VP                  4        V P                  VP                  4       ^ 4       V P                  VP                  4       VP	                  V4      pV P                  V^*4       VP                  4        R#   TP	                  T4      pT P                  T^*4       TP                  4        i ; i)c                  (   <"   S G R j  xL
  ^*#  L5ir   r   r   s   r   rV   <BaseTaskTests.test_uncancel_resets_must_cancel.<locals>.coro  s     II r   r[   N)r   r   r\   rW   r~   r   r   r{   rm   r  r   _must_cancelr  r  rI   )r-   rV   rQ   rq   resr   s   &    @r    test_uncancel_resets_must_cancel.BaseTaskTests.test_uncancel_resets_must_cancel  s   	 %%'nn$'}}T46*a 01t	KKMT__.2OOD--.MMOT__.2T../))$/CS"%JJL ))$/CS"%JJLs   BE 5Fc                   a  V 3R  lpS P                  V4      pR pS P                  W#! 4       4      pVP                  VP                  4       S P	                  \
        P                  4      ;_uu_ 4        VP                  V4       RRR4       S P                  VP                  4       4       S P                  VP                  4       4       S P                  VP                  4       4       R#   + '       g   i     Lo; i)c               3   D   <"   R x p SP                  RV 4       ^ x  R # 5iNr  assertAlmostEqualwhenr-   s    r   r&  &BaseTaskTests.test_cancel.<locals>.gen        D""4.G    c                  N   "   \         P                  ! R 4      G Rj  xL
  ^#  L5i)r  Nr  r   r   r   rq   'BaseTaskTests.test_cancel.<locals>.task  s     --%%% &r  N)rf   rW   	call_soonr{   r|   r   r}   r~   r   r   r  r  )r-   r&  rQ   rq   r   s   f    r   test_cancelBaseTaskTests.test_cancel  s    	
 !!#&	 MM$'qxx w5566##A& 7!&$	 76s   4C--C=	c           
       a aa	a
 . ROpV EF
  w  opS P                  SR7      ;_uu_ 4        \        P                  ! 4       o	S P                  S	4       R o
VV	V V
3R lpS P	                  S	V! 4       4      pS P                  \        P                  4      ;_uu_ 4       pS	P                  V4       R R R 4       XP                  pS P                  VP                  V4       \        V4      pS P                  V\        P                  V^ 34       R R R 4       EK  	  R #   + '       g   i     Lu; i  + '       g   i     EK6  ; i)Ncancel_argsc                  N   "   \         P                  ! ^
4      G Rj  xL
  R#  L5ir~  r  r   r   r   r   HBaseTaskTests.test_cancel_with_message_then_future_result.<locals>.sleep       !--+++r  c                    <"   SP                  SS! 4       4      p \        P                  ! ^ 4      G Rj  xL
  V P                  ! S!   \        P                  ! V .4      G Rj  xL
 w  rV P                  4        R#  LG L5ir   N)rW   r   r   r{   waitr   rq   r   pendingr  rQ   r-   r   s      r   rV   GBaseTaskTests.test_cancel_with_message_then_future_result.<locals>.coro  s\     ==uw7D!--***KK-*1,,v*>$>MDKKM +$>!   1B A<.B #A>$B >B )r   r   )r   r   )ry   r  )   r  subTestr   r   r   rW   r|   r}   r~   r   rm   r$   r(   r-   casesexpected_argsrV   rq   r   r%   actualr  rQ   r   s   f       @@@r   +test_cancel_with_message_then_future_result9BaseTaskTests.test_cancel_with_message_then_future_result  s    
 +0&K+66--/##D)," " }}T462&&w'='=>>"++D1 ?ll  =9.s3  ++]A>@+ 76 +0  ?> 766%   A1D/D/AD/D,'D//Ec           
       a aa	a
 . ROpV EF
  w  opS P                  SR7      ;_uu_ 4        \        P                  ! 4       o	S P                  S	4       R o
VV	V V
3R lpS P	                  S	V! 4       4      pS P                  \        P                  4      ;_uu_ 4       pS	P                  V4       R R R 4       XP                  pS P                  VP                  V4       \        V4      pS P                  V\        P                  V^ 34       R R R 4       EK  	  R #   + '       g   i     Lu; i  + '       g   i     EK6  ; i)Nr  c                  N   "   \         P                  ! ^
4      G Rj  xL
  R#  L5ir~  r  r   r   r   r   KBaseTaskTests.test_cancel_with_message_then_future_exception.<locals>.sleep  r  r  c                    <"   SP                  SS! 4       4      p \        P                  ! ^ 4      G Rj  xL
  V P                  ! S!   \        P                  ! V .4      G Rj  xL
 w  rV P                  4        R#  LG L5ir  rW   r   r   r{   r  r   r  s      r   rV   JBaseTaskTests.test_cancel_with_message_then_future_exception.<locals>.coro  s]     ==uw7D!--***KK-*1,,v*>$>MDNN$ +$>r  r  r  r  s   f       @@@r   .test_cancel_with_message_then_future_exception<BaseTaskTests.test_cancel_with_message_then_future_exception   s    
 +0&K+66--/##D),% % }}T462&&w'='=>>"++D1 ?ll  =9.s3  ++]A>@+ 76 +0  ?> 766r  c                  a aaa \         P                  ! 4       oS P                  S4       SP                  4       oV3R  loVVV V3R lpS P	                  SV! 4       4      pS P                  \        4      ;_uu_ 4       pSP                  V4       RRR4       XP                  pS P                  VP                  R4       \        V4      pS P                  V\         P                  R^34       R#   + '       g   i     Lh; i)c                  r   <"   S P                  R 4       \        P                  ! ^
4      G R j  xL
  R #  L5ir   )r   r   r   r   s   r   r   @BaseTaskTests.test_cancellation_exception_context.<locals>.sleep'  s$     NN4 --###s   +757c                     <"   SP                  SS! 4       4      p SG R j  xL
  SP                  V P                  R4        V G R j  xL
  R #  L- L  \        P                   d   p\        R4      ThR p?ii ; i5i)Nmsgr  )rW   r  r{   r   r}   r   )
inner_taskexr   rQ   r-   r   s     r   rV   ?BaseTaskTests.test_cancellation_exception_context.<locals>.coro+  sm     tUW5JIINN:,,e46     !)) 6 -256sE   A;A A;A AA A;A A8'A33A88A;N)r  )r  )r   r   r   rh   rW   r|   r   r~   r   rm   r$   r(   r}   )	r-   rV   rq   r   r%   r  r   rQ   r   s	   f     @@@r   #test_cancellation_exception_context1BaseTaskTests.test_cancellation_exception_context"  s    %%'D!  "	$	6 	6 }}T46*z**b##D) +ll>2&s+##Xq1	3 +*s   >C00D 	c                  a aa \         P                  ! 4       oS P                  S4       R  oVV V3R lpS P                  SV! 4       4      pS P	                  \         P
                  4      ;_uu_ 4       pSP                  V4       RRR4       XP                  pS P                  VP                  R4       \        V4      pS P                  V\         P
                  R^ 34       R#   + '       g   i     Lh; i)c                  N   "   \         P                  ! ^
4      G Rj  xL
  R#  L5ir~  r  r   r   r   r   JBaseTaskTests.test_cancel_with_message_before_starting_task.<locals>.sleepB  r  r  c                     <"   SP                  SS! 4       4      p V P                  R 4       \        P                  ! V .4      G Rj  xL
 w  rV P	                  4        R#  L5i)ry   N)rW   r{   r   r  r   )rq   r   r  rQ   r-   r   s      r   rV   IBaseTaskTests.test_cancel_with_message_before_starting_task.<locals>.coroE  sH     ==uw/DKK%"),,v"66MDNN 7s   AA!AA!Nr  )r   r   r   rW   r|   r}   r~   r   rm   r$   r(   )r-   rV   rq   r   r%   r  rQ   r   s   f     @@r   -test_cancel_with_message_before_starting_task;BaseTaskTests.test_cancel_with_message_before_starting_task>  s    %%'D!	$	 }}T46*w5566"##D) 7ll?3&s+##_a8	: 76s   3C%%C5	c                   R  pV P                  V P                  V! 4       4      p\        P                  ! V P                  4       VP	                  4        V P                  \        P                  V P                  P                  V4       V P                  VP                  4       4       V P                  VP                  4       4       V P                  VP	                  4       4       R# )c                     "   \         P                  ! ^ 4      G Rj  xL
  \         P                  ! ^ 4      G Rj  xL
  ^#  L$ L5ir  r  r   r   r   rq   -BaseTaskTests.test_cancel_yield.<locals>.taskW  s4     --"""--""" #"   AAAAAAN)rW   rQ   r  rR  r{   r|   r   r}   r~   r   r   r  r  )r-   rq   r   s   &  r   test_cancel_yieldBaseTaskTests.test_cancel_yieldV  s    	
 MM$))TV,tyy)	
""DII$@$@!	E!&$r   c                $  a V P                  V P                  4      oV3R  lpV P                  V P                  V! 4       4      p\        P                  ! V P                  4       SP                  4        V P                  \        P                  4      ;_uu_ 4        V P                  P                  V4       RRR4       V P                  SP                  4       4       V P                  VP                  4       4       R#   + '       g   i     LP; i)c                  (   <"   S G R j  xL
  ^#  L5ir   r   r   s   r   rq   4BaseTaskTests.test_cancel_inner_future.<locals>.taskh       GG r   N)r^   rQ   rW   r  rR  r{   r|   r   r}   r~   r   r  r-   rq   r   r   s   &  @r   test_cancel_inner_future&BaseTaskTests.test_cancel_inner_futuree  s    OODII&	 MM$))TV,tyy)	
w5566II((+ 7&& 76s   C??D	c                  a V P                  V P                  4      oV3R  lpV P                  V P                  V! 4       4      p\        P                  ! V P                  4       SP                  4        VP                  4        V P                  \        P                  4      ;_uu_ 4        V P                  P                  V4       RRR4       V P                  VP                  4       4       V P                  SP                  4       4       V P                  VP                  4       4       R#   + '       g   i     Lo; i)c                  (   <"   S G R j  xL
  ^#  L5ir   r   r  s   r   rq   BBaseTaskTests.test_cancel_both_task_and_inner_future.<locals>.taskw  r  r   N)r^   rQ   rW   r  rR  r{   r|   r   r}   r~   r   r   r  r  s   &  @r   &test_cancel_both_task_and_inner_future4BaseTaskTests.test_cancel_both_task_and_inner_futuret  s    OODII&	 MM$))TV,tyy)	
	
w5566II((+ 7 	!&& 76s   +D..D>	c                  aa V P                  V P                  4      oV P                  V P                  4      oVV3R  lpV P                  V P                  V! 4       4      p\        P                  ! V P                  4       V P                  VP                  S4       SP                  R4       \        P                  ! V P                  4       V P                  VP                  S4       VP                  4        V P                  SP                  4       4       V P                  P                  V4      pV P                  V^*4       V P                  VP                  4       4       R# )c                  z   <"   S G R j  xL
   SG R j  xL
  R #  L L  \         P                   d     ^*# i ; i5ir   r   r}   )fut1fut2s   r   rq   5BaseTaskTests.test_cancel_task_catching.<locals>.task  s8     JJ

 )) s0   ;;  ; 8;8;Nr^   rQ   rW   r  rR  r   _fut_waiterr   r{   r   r  r~   rm   r  )r-   rq   r   r  r  r  s   &   @@r   test_cancel_task_catching'BaseTaskTests.test_cancel_task_catching  s    tyy)tyy)	 MM$))TV,tyy)ammT*tyy)ammT*	
()ii**1-b!'r   c                  aaa V P                  V P                  4      oV P                  V P                  4      oV P                  V P                  4      oVVV3R  lpV P                  V P                  V! 4       4      p\        P                  ! V P                  4       V P                  VP                  S4       SP                  R4       \        P                  ! V P                  4       V P                  VP                  S4       VP                  4        V P                  SP                  4       4       \        P                  ! V P                  4       V P                  VP                  S4       SP                  ^*4       V P                  P                  V4      pV P                  V^*4       V P                  SP                  4       4       V P                  VP                  4       4       R# )c                     <"   SG R j  xL
   SG R j  xL
  SG R j  xL
 p V #  L L  \         P                   d     L'i ; i L%5ir   r  )r  r  r  fut3s    r   rq   5BaseTaskTests.test_cancel_task_ignoring.<locals>.task  sJ     JJ

 *CJ )) sC   A%A) ') AAA) AA AANr  )r-   rq   r   r  r  r  r  s   &   @@@r   test_cancel_task_ignoring'BaseTaskTests.test_cancel_task_ignoring  sC   tyy)tyy)tyy)	 MM$))TV,tyy)ammT*tyy)ammT*	
()tyy)ammT*ii**1-b!)*'r   c                  a a \         P                  ! 4       pS P                  V4       V V3R  lpS P                  W! 4       4      oS P	                  SP                  4       4       S P                  \         P                  VP                  S4       S P                  SP                  4       4       S P                  SP                  4       4       S P	                  SP                  4       S P	                  SP                  4       4       R# )c                     <"   SP                  4        S P                  SP                  4       \        P                  ! ^d4      G Rj  xL
  ^#  L5id   N)r{   r   r  r   r   r-   r   s   r   rq   4BaseTaskTests.test_cancel_current_task.<locals>.task  s9     HHJOOANN+--$$$ %s   AAA	ANr   r   r   rW   r  r  r|   r}   r~   r   r   r  r{   r  s   f  @r   test_cancel_current_task&BaseTaskTests.test_cancel_current_task  s    %%'D!	 MM$''""D$;$;Q	@!&($r   c                  a a \         P                  ! 4       pS P                  V4       V V3R lpS P                  W! 4       4      oS P	                  SP                  4       4       S P                  \         P                  VP                  S4       S P                  SP                  4       4       S P                  SP                  4       4       S P	                  SP                  4       S P	                  SP                  4       4       R# )z+coroutine end right after task is cancelledc                  f   <"   SP                  4        S P                  SP                  4       ^# 5i)   )r{   r   r  r   s   r   rq   .BaseTaskTests.test_cancel_at_end.<locals>.task  s"     HHJOOANN+s   .1Nr"  r  s   f  @r   test_cancel_at_end BaseTaskTests.test_cancel_at_end  s    %%'D!	
 MM$''""D$;$;Q	@!&($r   c                @  a aaaaa \         P                  ! 4       oS P                  V3R  l4       R;ooS P                  S4      oV3R loVVVV V3R lpS P	                  SV! 4       4      oS P                  \         P                  4      ;_uu_ 4        SP                  S4       RRR4       S P                  SP                  4       4       S P                  SP                  4       4       S P                  SP                  4       4       R#   + '       g   i     Lo; i)c                  $   < S P                  4       # r   )rI   r[   s   r   rb   8BaseTaskTests.test_cancel_awaited_task.<locals>.<lambda>  s    

r   Nc                  (   <"   S G R j  xL
  R #  L5ir   r   r   s   r   nested6BaseTaskTests.test_cancel_awaited_task.<locals>.nested       IIr   c                     <"   SP                  S S! 4       4      o\        P                  ! ^ 4      G Rj  xL
  SP                  4        SG Rj  xL
  R#  L  L5ir  rW   r   r   r{   )rQ   r/  nested_taskr-   rq   s   r   rV   4BaseTaskTests.test_cancel_awaited_task.<locals>.coro  sL      --fh7K--""" KKM  # !   1AAAAAA)
r   r   r   r^   rW   r|   r}   r~   r   r  )r-   rV   r   rQ   r/  r4  rq   s   f @@@@@r   test_cancel_awaited_task&BaseTaskTests.test_cancel_awaited_task  s     %%',-!!{ood#	
	 
	 }}T46*w5566##D) 7 	()--/0( 76s   DD	c                8    W!9  d   \        R V: RV R24      hR# )ztext z not found in:
>>>z<<<Nr   )r-   textsubstrs   &&&r   assert_text_contains"BaseTaskTests.assert_text_contains  s(    vj0CD6MNN r   c                  a aa \         P                  ! 4       oS P                  S4       R  oVVV 3R lpS P                  SV! 4       4      p SP	                  V4       S P                  R4       R#   \         P                   d>    \        P                  ! 4       pS P                  TR4       S P                  TR4        R# i ; i)c                  N   "   \         P                  ! ^
4      G Rj  xL
  R#  L5ir~  r  r   r   r   r/  EBaseTaskTests.test_cancel_traceback_for_future_result.<locals>.nested       --###r  c                     <"   SP                  SS! 4       4      p \        P                  ! ^ 4      G Rj  xL
  V P                  4        V G Rj  xL
  R#  L  L5ir  r3  )rq   rQ   r/  r-   s    r   rV   CBaseTaskTests.test_cancel_traceback_for_future_result.<locals>.coro  sB     ==vx0D--"""KKMJJ #r6  CancelledError did not occurawait asyncio.sleep(10)zawait task  # search targetN
r   r   r   rW   r~   failr}   	traceback
format_excr=  r-   rV   rq   r  rQ   r/  s   f   @@r   'test_cancel_traceback_for_future_result5BaseTaskTests.test_cancel_traceback_for_future_result  s     %%'D!	$	 }}T46*	6##D) II45 %% 	I%%'B%%b*CD%%b*GH		I   A1 1ACCc                  a aa \         P                  ! 4       oS P                  S4       R  oVVV 3R lpS P                  SV! 4       4      p SP	                  V4       S P                  R4       R#   \         P                   d>    \        P                  ! 4       pS P                  TR4       S P                  TR4        R# i ; i)c                  N   "   \         P                  ! ^
4      G Rj  xL
  R#  L5ir~  r  r   r   r   r/  HBaseTaskTests.test_cancel_traceback_for_future_exception.<locals>.nested-  rB  r  c                    <"   SP                  SS! 4       4      p \        P                  ! ^ 4      G Rj  xL
  V P                  4        \        P                  ! V .4      G Rj  xL
 w  rV P                  4        R#  LG L5ir  r  )rq   r   r  rQ   r/  r-   s      r   rV   FBaseTaskTests.test_cancel_traceback_for_future_exception.<locals>.coro1  sZ     ==vx0D--"""KKM"),,v"66MDNN #6r  rE  rF  z!task.exception()  # search targetNrG  rK  s   f   @@r   *test_cancel_traceback_for_future_exception8BaseTaskTests.test_cancel_traceback_for_future_exception'  s     %%'D!	$	 }}T46*		6##D) II45 %% 	5%%'B%%b*CD%%b35		5rN  c                p  a aa V 3R  lpS P                  V4      o^ oVV3R lpS P                  SV! 4       4      pS P                  \        4      ;_uu_ 4       pSP	                  V4       RRR4       S P                  \        XP                  4      R4       S P                  VP                  4       4       S P                  S^4       S P                  RSP                  4       4       VP                  4        S P                  \        P                  SP                  V4       R#   + '       g   i     L; i)c               3      <"   R x p SP                  RV 4       Rx p SP                  RV 4       Rx p SP                  RV 4       Rx  R # 5i)Nr  皙?333333?r  r  s    r   r&  :BaseTaskTests.test_stop_while_run_in_complete.<locals>.genF  sN     D""3-9D""3-9D""3-I   A	Ac                     <"   S^
8  dC   \         P                  ! R4      G Rj  xL
  S^,          oS^8X  g   K7  S P                  4        KI  R#  L*5i)r  r  N)r   r   stop)rQ   xs   r   rq   ;BaseTaskTests.test_stop_while_run_in_complete.<locals>.taskS  s@     b&mmC(((Q6IIK	 (s   !AAAANz+Event loop stopped before Future completed.rY  )rf   rW   r|   r   r~   rm   rl   r   r  r   r  timer{   r   r}   )r-   r&  rq   r   r   rQ   r^  s   f    @@r   test_stop_while_run_in_complete-BaseTaskTests.test_stop_while_run_in_completeD  s    	 !!#&	  MM$'|,,##A& -R\\*F	H"AsDIIK0	
'00$2I2I1M -,s   D%%D5	c                   R  pV P                  V P                  V! 4       4      pV P                  \        R4      ;_uu_ 4        RVn        RRR4       V P                  P                  V4       R#   + '       g   i     L-; i)c                     "   R # 5ir   r   r   r   r   rV   .BaseTaskTests.test_log_traceback.<locals>.coroh  rw   r   zcan only be set to FalseTN)rW   rQ   r   r   _log_tracebackr~   r-   rV   rq   s   &  r   test_log_traceback BaseTaskTests.test_log_tracebackg  s]    	 }}TYY/##J0JKK"&D L		$$T* LKs   A00B 	c                >  a aa V 3R  lpS P                  V4      pS P                  V\        P                  ! R4      4      oS P                  V\        P                  ! R4      4      oVVV 3R lpVP	                  S P                  W#! 4       4      4      pS P                  V^*4       S P                  RVP                  4       4       VP	                  S P                  W#! 4       4      4      pS P                  RVP                  4       4       S P                  V^*4       R# )c               3   p   <"   R x p SP                  RV 4       ^ x p SP                  RV 4       Rx  R # 5iNr  333333?r  r  s    r   r&  $BaseTaskTests.test_wait.<locals>.genr  7     D""3-7D""4.J   36r  rm  c                     <"   \         P                  ! SS.4      G R j  xL
 w  rSP                  V \        SS.4      4       SP                  V\        4       4       ^*#  L?5ir   r   r  rm   setr   r  r   rX  r-   s     r   r   $BaseTaskTests.test_wait.<locals>.foo~  sO     "),,1v"66MDT31v;/Wce, 7s   A!AA A!Nrf   rW   r   r   r~   rm   r  r`  r-   r&  rQ   r   r  r   rX  s   f    @@r   	test_waitBaseTaskTests.test_waitp  s    	 !!#&MM$c 23MM$d 34	 %%dmmD#%&@Ab!tTYY[1 %%dmmD#%&@AtTYY[1b!r   c                   R  pV P                   P                  V! R4      4      pV P                  V P                   \        P                  ! W"V P                   P                  V! R4      4      .4      4      pV P                   P                  V4      w  rEV P                  V4       V P                  \        R V 4       4      RR04       R# )c                    "   V # 5ir   r   ss   &r   rV   :BaseTaskTests.test_wait_duplicate_coroutines.<locals>.coro  
     Hr   r   spamc              3   @   "   T F  qP                  4       x  K  	  R # 5ir   r   .0r   s   & r   	<genexpr>?BaseTaskTests.test_wait_duplicate_coroutines.<locals>.<genexpr>  s     6AXXZZ   N)	rQ   create_taskrW   r   r  r~   r  rm   rs  )r-   rV   crq   r   r  s   &     r   test_wait_duplicate_coroutines,BaseTaskTests.test_wait_duplicate_coroutines  s    	II!!$v,/}}IILL!		 5 5d6l CDEG 		44T:!6668HIr   c                h   V P                  \        V P                  P                  \        P
                  ! \        4       4      4       \        P                  ! R 4      p\        P
                  ! V.RR7      pV P                  \        V P                  P                  V4       VP                  4        R# )r  return_whenNr   )	r|   r   rQ   r~   r   r  rs  r   rI   )r-   
sleep_coro	wait_coros   &  r   test_wait_errorsBaseTaskTests.test_wait_errors  s}    		44LL	!
 ]]4(
LL*2>	*))66		C 	r   c                  a  V 3R  lpS P                  V4      pS P                  V\        P                  ! R4      4      pS P                  V\        P                  ! R4      4      pS P                  V\        P                  ! WC.\        P
                  R7      4      pVP                  V4      w  rgS P                  V0V4       S P                  V0V4       S P                  VP                  4       4       S P                  VP                  4       4       S P                  VP                  4       4       S P                  RVP                  4       4       VP                  ^
4       VP                  \        P                  ! W4.4      4       R# )c               3   p   <"   R x p SP                  RV 4       ^ x p SP                  RV 4       Rx  R # 5i)Nr  r  r  r  s    r   r&  4BaseTaskTests.test_wait_first_completed.<locals>.gen  s7     D""4.7D""3-Irp  r  r  r  N)rf   rW   r   r   r  FIRST_COMPLETEDr~   rm   r  r   r   assertIsNoner   r  r`  advance_time)r-   r&  rQ   r   rX  rq   r   r  s   f       r   test_wait_first_completed'BaseTaskTests.test_wait_first_completed  s%   	 !!#&MM$d 34MM$c 23}}LL!W-D-DEG //5!d#!g&"!!((*%sDIIK0 	"aV 45r   c                p   R  pR pV P                  V P                  V! 4       4      pV P                  V P                  V! 4       4      pV P                  V P                  \        P                  ! WC.\        P                  R7      4      pV P                  P                  V4      w  rgV P                  W40V4       V P                  VP                  4       4       V P                  VP                  4       4       V P                  VP                  4       4       V P                  VP                  4       4       R# )c                  N   "   \         P                  ! ^ 4      G Rj  xL
  R#  L5ir  r  r   r   r   coro12BaseTaskTests.test_wait_really_done.<locals>.coro1  s     --"""r  c                     "   \         P                  ! ^ 4      G Rj  xL
  \         P                  ! ^ 4      G Rj  xL
  R#  L$ L5ir  r  r   r   r   coro22BaseTaskTests.test_wait_really_done.<locals>.coro2  s1     --"""--""" #"r  r  N)rW   rQ   r   r  r  r~   rm   r   r   r  r   )r-   r  r  r   rX  rq   r   r  s   &       r   test_wait_really_done#BaseTaskTests.test_wait_really_done  s    	#	# MM$))UW-MM$))UW-}}IILL!W-D-DEG 		44T:!&!!((*%!!((*%r   c                B  a  V 3R  lpS P                  V4      pS P                  V\        P                  ! R4      4      pR pS P                  W$! 4       4      pS P                  V\        P                  ! WS.\        P
                  R7      4      pVP                  V4      w  rxS P                  V0V4       S P                  V0V4       S P                  ^ VP                  4       4       VP                  ^
4       VP                  \        P                  ! W5.4      4       R# )c               3   D   <"   R x p SP                  RV 4       ^ x  R # 5ir  r  r  s    r   r&  4BaseTaskTests.test_wait_first_exception.<locals>.gen  r  r  r  c                      "   \        R 4      h5i)err)ZeroDivisionErrorr   r   r   r%   4BaseTaskTests.test_wait_first_exception.<locals>.exc  s     #E**   r  Nrf   rW   r   r   r  FIRST_EXCEPTIONr~   rm   r  r`  r  	r-   r&  rQ   r   r%   rX  rq   r   r  s	   f        r   test_wait_first_exception'BaseTaskTests.test_wait_first_exception  s    	
 !!#& MM$d 34	+ MM$&}}LL!W-D-DEG //5!d#!g&q$))+. 	"aV 45r   c                "  a  V 3R  lpS P                  V4      pS P                  V\        P                  ! R4      4      pR pS P                  W$! 4       4      p\        P                  ! WS.\        P
                  R7      pVP                  V4      w  rxS P                  V0V4       S P                  V0V4       S P                  RVP                  4       4       VP                  ^
4       VP                  \        P                  ! W5.4      4       R# )c               3   p   <"   R x p SP                  RV 4       ^ x p SP                  RV 4       Rx  R # 5i)Nr  r  r  r  s    r   r&  <BaseTaskTests.test_wait_first_exception_in_wait.<locals>.gen  7     D""4.7D""4.Jrp  r  c                  `   "   \         P                  ! R 4      G Rj  xL
  \        R4      h L5i)r  Nr  r   r   r  r   r   r   r%   <BaseTaskTests.test_wait_first_exception_in_wait.<locals>.exc  s'     --%%%#E** &   .,.r  r  Nr  r  s	   f        r   !test_wait_first_exception_in_wait/BaseTaskTests.test_wait_first_exception_in_wait  s    	 !!#& MM$d 34	+ MM$&||QF0G0GH//5!d#!g&tTYY[1 	"aV 45r   c                  a aa V 3R  lpS P                  V4      pS P                  V\        P                  ! R4      4      oR pS P                  W#! 4       4      oVVV 3R lpVP	                  S P                  W$! 4       4      4       S P                  RVP                  4       4       VP	                  S P                  W$! 4       4      4       S P                  RVP                  4       4       R# )c               3   p   <"   R x p SP                  RV 4       ^ x p SP                  RV 4       Rx  R # 5irl  r  r  s    r   r&  3BaseTaskTests.test_wait_with_exception.<locals>.gen  ro  rp  r  c                  `   "   \         P                  ! R 4      G Rj  xL
  \        R4      h L5i)rm  Nreallyr  r   r   r   sleeper7BaseTaskTests.test_wait_with_exception.<locals>.sleeper%  s'     --%%%#H-- &r  c                    <"   \         P                  ! SS.4      G R j  xL
 w  rSP                  \        V 4      ^4       SP                  V\	        4       4       \	        R V  4       4      pSP                  \        V4      ^4       R #  Lj5i)Nc              3   L   "   T F  qP                  4       f   K  Vx  K  	  R # 5ir   )r   r  s   & r   r  FBaseTaskTests.test_wait_with_exception.<locals>.foo.<locals>.<genexpr>/  s     FDqKKMDs   $
$)r   r  rm   lenrs  )r   r  errorsr   rX  r-   s      r   r   3BaseTaskTests.test_wait_with_exception.<locals>.foo+  sl     "),,1v"66MDSY*Wce,FDFFFS[!,	 7s   BB
A+Brm  N)rf   rW   r   r   r~   r  r`  )r-   r&  rQ   r  r   r   rX  s   f    @@r   test_wait_with_exception&BaseTaskTests.test_wait_with_exception  s    	 !!#&MM$c 23	. MM$	*	- 	dCE :;tTYY[1dCE :;tTYY[1r   c                  a aa V 3R  lpS P                  V4      pS P                  V\        P                  ! R4      4      oS P                  V\        P                  ! R4      4      oVVV 3R lpVP	                  S P                  W#! 4       4      4       S P                  RVP                  4       4       VP                  ^
4       VP	                  \        P                  ! SS.4      4       R# )c               3      <"   R x p SP                  RV 4       ^ x p SP                  RV 4       ^ x p SP                  RV 4       Rx  R # 5i)Nr  rm  )\(?r  r  s    r   r&  1BaseTaskTests.test_wait_with_timeout.<locals>.gen:  sN     D""3-7D""4.7D""4.Jr[  r  rm  c                     <"   \         P                  ! SS.R R7      G Rj  xL
 w  rSP                  V \        S.4      4       SP                  V\        S.4      4       R#  L@5i)r  r  Nrr  rt  s     r   r   1BaseTaskTests.test_wait_with_timeout.<locals>.fooH  sQ     "),,1vt"DDMDT3s8,Wc1#h/ Es   A$A"AA$r  N)	rf   rW   r   r   r~   r  r`  r  r  )r-   r&  rQ   r   r   rX  s   f   @@r   test_wait_with_timeout$BaseTaskTests.test_wait_with_timeout8  s    	 !!#&MM$c 23MM$d 34	0
 	dCE :;tTYY[1 	"aV 45r   c                @  a  V 3R  lpS P                  V4      pS P                  V\        P                  ! R4      4      pS P                  V\        P                  ! R4      4      pVP	                  \        P
                  ! WC.RR7      4      w  rVS P                  V\        V.4      4       S P                  V\        V.4      4       S P                  RVP                  4       4       VP                  ^
4       VP	                  \        P
                  ! W4.4      4       R# )c               3      <"   R x p SP                  RV 4       ^ x p SP                  RV 4       ^ x p SP                  RV 4       Rx  R # 5irl  r  r  s    r   r&  8BaseTaskTests.test_wait_concurrent_complete.<locals>.genV  sN     D""3-7D""4.7D""3-Ir[  r  rm  r  N)rf   rW   r   r   r~   r  rm   rs  r  r`  r  )r-   r&  rQ   r   rX  r   r  s   f      r   test_wait_concurrent_complete+BaseTaskTests.test_wait_concurrent_completeT  s    	 !!#&MM$c 23MM$d 34//LL!-/ 	sA3x(#qc(+sDIIK0 	"aV 45r   c                  a aa V 3R  lpS P                  V4      pS P                  V\        P                  ! R4      4      oS P                  V\        P                  ! R4      4      oVVV 3R lpVP	                  S P                  W#! 4       4      4      pS P                  V^*4       S P                  RVP                  4       4       R# )c               3   p   <"   R x p SP                  RV 4       ^ x p SP                  RV 4       Rx  R # 5irl  r  r  s    r   r&  ;BaseTaskTests.test_wait_with_iterator_of_tasks.<locals>.genq  ro  rp  r  rm  c                     <"   \         P                  ! \        SS.4      4      G R j  xL
 w  rSP                  V \	        SS.4      4       SP                  V\	        4       4       ^*#  L?5ir   )r   r  iterrm   rs  rt  s     r   r   ;BaseTaskTests.test_wait_with_iterator_of_tasks.<locals>.foo}  sS     "),,tQF|"<<MDT31v;/Wce, =s   %A*A(A A*Nrv  rw  s   f    @@r    test_wait_with_iterator_of_tasks.BaseTaskTests.test_wait_with_iterator_of_taskso  s    	 !!#&MM$c 23MM$d 34	 %%dmmD#%&@Ab!tTYY[1r   c                n   a aa R  oS P                  4       oVVV 3R lpSP                  V! 4       4       R# )c                    "   V # 5ir   r   )r   s   &r   func/BaseTaskTests.test_wait_generator.<locals>.func  r  r   c                    <"   VVV3R  l\        ^
4       4       p \        P                  ! V \        P                  R7      G Rj  xL
 w  rSP	                  \        V4      ^
4       SP	                  \        V4      ^ 4       R#  L>5i)c              3   T   <"   T F  pSP                  SS! V4      4      x  K  	  R # 5ir   )rW   )r  ir  rQ   r-   s   & r   r  BBaseTaskTests.test_wait_generator.<locals>.main.<locals>.<genexpr>  s#     E9aT]]4a119s   %(r  N)r   r   r  ALL_COMPLETEDrm   r  )r   r   r  r  rQ   r-   s      r   main/BaseTaskTests.test_wait_generator.<locals>.main  s]     E59EE"),,u'BWBW"XXMDSY+S\1- Ys   ABB?BNrf   r~   )r-   r  r  rQ   s   f @@r   test_wait_generator!BaseTaskTests.test_wait_generator  s/    	 !!#	. 	'r   c                x  a
aa R  pV
VV3R lpR pR pW43 EF  pV P                  VP                  R7      ;_uu_ 4        V P                  V4      oRSn        \	        4       o
RoV! RR4      pV! RR	4      pV! R
R4      pSP                  V P                  SV! WxV.4      4      4      p	V P                  R
SP                  4       4       V P                  RV	R,          9   4       V P                  R	V	R,          9   4       V P                  V	^,          R4       RRR4       EK  	  R#   + '       g   i     EK!  ; i)c               3   .   "   ^ x  ^ x  Rx  ^ x  R# 5i)r   r  Nr   r   r   r   r&  ,BaseTaskTests.test_as_completed.<locals>.gen  s     GGJG   c                    <"   \         P                  ! V 4      G R j  xL
  SP                  V4       S'       g"   RS9   d   RS9   d   RoSP                  R4       V#  L@5i)Nr   rX  TgQ?)r   r   addr  )dtr^  	completedrQ   time_shifteds   &&r   r  0BaseTaskTests.test_as_completed.<locals>.sleeper  sR     --###MM!C9$4	9I#!!$'H $s   A AA $A c                    "   . p\         P                  ! V 4       F  pTP                  VG R j  xL
 4       K  	  V#  L5ir   r   as_completedappend
awaitablesvaluesr   s   &  r   try_iterator5BaseTaskTests.test_as_completed.<locals>.try_iterator  s7     F))*5Ag& 6M &s   ,?=
?c                    "   . p\         P                  ! V 4        R j  xL
  pTP                  VG R j  xL
 4       K%   L  LD#T# 5ir   r  r  s   &  r   try_async_iterator;BaseTaskTests.test_as_completed.<locals>.try_async_iterator  sD     F"//
; ' 'aAg&'% <Ms5   AAA AAA

A AAAmethodg      ?Fr  r   rX  rm  r  :Nr  NN)r  r4   rf   slow_callback_durationrs  r~   rW   r  r`  r   rm   )r-   r&  r  r  r  r   r   rX  r  r  r  rQ   r  s   &         @@@r   test_as_completedBaseTaskTests.test_as_completed  s
   				  3CS\\22))#..1+E	$D#&D#&D#&--dmmD#qQi..QR&&tTYY[9s2w/s2w/  Q-! 32 4222s    CD''D9c           
     j   R  pR p\         P                  ! \        P                  ! 4       4      ;_uu_ 4       p\	        V! ^ 4      V! ^4      V! ^4      V! ^4      34      pVP                  V! V4      4      pWE,
          V8w  d   V P                  R4      hV! R4      pVP                  V! R4      4      pV! R4      pVP                  V! R4      4      p	\	        WgW34      pVP                  V! V4      4      pWE,          Wy08w  d   V P                  R4      h RRR4       R#   + '       g   i     R# ; i)	c                    "   \        4       p\        P                  ! V 4        R j  xL
  pVP                  V4       K   LDT# 5ir   )rs  r   r  r  )r  awaitables_outout_aws   &  r   r  PBaseTaskTests.test_as_completed_same_tasks_in_as_out.<locals>.try_async_iterator  sB      UN ' 4 4Z @ + +f""6*+ @!!s%   !AAA AA AAc                    "   V # 5ir   r   r  s   &r   rV   BBaseTaskTests.test_as_completed_same_tasks_in_as_out.<locals>.coro  r  r   z5Got original coroutines out of as_completed iterator.r   rX  r  dz>Only tasks should be yielded from as_completed iterator as-is.N)
contextlibclosingr   r   	frozensetr~   failureExceptionr  )
r-   r  rV   rQ   awaitables_inr
  
coro_obj_atask_b
coro_obj_ctask_ds
   &         r   &test_as_completed_same_tasks_in_as_out4BaseTaskTests.test_as_completed_same_tasks_in_as_out  s9   	"	  6 6 899T &a$q'47DG4M "44"=1N ->++ -L M M cJ%%d3i0FcJ%%d3i0F%Z8M "44"=1N -&1AA++ -5 6 6 B1 :999s   CD!!D2	c           
       aaa R  pVVV3R lpVVV3R lpW#3 EF  pV P                  VP                  R7      ;_uu_ 4        V P                  V4      oSP                  \        P
                  ! RR4      4      oSP                  \        P
                  ! RR4      4      oSP                  V P                  SV! 4       4      4      pV P                  \        V4      ^V4       V P                  V^ ,          R
4       V P                  V^,          ^ ,          ^4       V P                  V^,          ^,          \        P                  4       V P                  RSP                  4       4       SP                  ^
4       SP                  \        P                  ! SS.4      4       R	R	R	4       EK  	  R	#   + '       g   i     EK  ; i)c               3   .   "   R x  ^ x  ^ x  Rx  R # 5i)Nr  r   r   r   r   r&  9BaseTaskTests.test_as_completed_with_timeout.<locals>.gen  s     GGIr  c                  4  <"   . p \         P                  ! SS.R R7       F:  pV '       d   SP                  R4        VG Rj  xL
 pV P                  ^V34       K<  	  V #  L  \         P                   d   pT P                  ^T34        Rp?Kp  Rp?ii ; i5i)Q?r  {Gz?N)r   r  r  r  r  r  r   rB   r%   r   rX  rQ   s       r   r  BBaseTaskTests.test_as_completed_with_timeout.<locals>.try_iterator  s     F))1a&$?%%d+,AMM1a&) @ M	  ++ ,MM1c(++,s@   9BA"A A"B A""B7B
BBBc                  6  <"   . p  \         P                  ! SS.R R7        Rj  xL
  pVG Rj  xL
 pV P                  ^V34       SP                  R4       K:   L5 L,D8 T #   \         P                   d   pT P                  ^T34        Rp?T # Rp?ii ; i5i)r   r  Nr!  )r   r  r  r  r  r"  s       r   r  HBaseTaskTests.test_as_completed_with_timeout.<locals>.try_async_iterator  s     F(&33QFDI , ,!AMM1a&)%%d+,  J M '' (q#h''M(s^   BA# AAAA# A*A# AA# A#  B#B8BBBBr  r  r   rm  rX  r   N)r  r   )r  r4   rf   r  r   r   r~   rW   rm   r  ro   r  r  r`  r  r  )	r-   r&  r  r  r   r  r   rX  rQ   s	   &     @@@r   test_as_completed_with_timeout,BaseTaskTests.test_as_completed_with_timeout  sL   	
			  3CS\\22))#.$$W]]3%<=$$W]]4%=>--dmmD#%.HI  S1c2  Q2  QA.%%c!fQi1E1EF&&tTYY[9 !!"%''aV(<= 32 4222s   EF00Gc           
     |  a a R  pVV 3R lpVV 3R lpW#3 F  pS P                  VP                  R7      ;_uu_ 4        \        P                  ! RR4      oS P	                  V4      pVP                  S P                  WT! 4       4      4       VP                  4        RRR4       K  	  R#   + '       g   i     K  ; i)c               3   &   "   R x  ^ x  Rx  R # 5i)Nr  r   r   r   r   r&  @BaseTaskTests.test_as_completed_with_unused_timeout.<locals>.gen#  s     GJ   c                     <"   \         P                  ! S.^R7       F  p V G Rj  xL
 pSP                  VR4       K!  	  R#  L5ir  r  Nr   r   r  rm   r   rB   r   r-   s     r   r  IBaseTaskTests.test_as_completed_with_unused_timeout.<locals>.try_iterator(  s9     ))1#q9G  C( :s   "AAAc                     <"   \         P                  ! S.^R7        Rj  xL
  p V G Rj  xL
 pSP                  VR4       K(   L# LD&R# 5ir-  r.  r/  s     r   r  OBaseTaskTests.test_as_completed_with_unused_timeout.<locals>.try_async_iterator-  sI     "//Q? ) )aG  C() @s5   AA	AA	AAAA	A	Ar  r  r   N)r  r4   r   r   rf   r~   rW   rI   )r-   r&  r  r  r   rQ   r   s   f     @r   %test_as_completed_with_unused_timeout3BaseTaskTests.test_as_completed_with_unused_timeout!  s    	
	)
	)
  3CS\\22MM$,))#.''dCE(BC

	 32 4222s   AB**B;c                  a  V 3R  lpV 3R lpR p\         P                  ! \        P                  ! 4       4      ;_uu_ 4       pW3 Fu  pS P	                  VP
                  R7      ;_uu_ 4        VP                  V! V! ^ 4      V! ^4      V! ^4      V! ^4      34      4      pS P                  VR4       RRR4       Kw  	  RRR4       R#   + '       g   i     K  ; i  + '       g   i     R# ; i)c                 .  <"   ^ p\         P                  ! V 4      p. pV F.  pTP                  VG Rj  xL
 4       V^,          pV^8X  g   K.   M	  SP                  \	        V4      ^4       V F  pTP                  VG Rj  xL
 4       K  	  V#  L] L5ir  r   r  r  rm   r  r  
iterationsiterator	collectedr   r-   s   &    r   r  EBaseTaskTests.test_as_completed_resume_iterator.<locals>.try_iterator=  s     J++J7HI  q)a
?	 
 S^Q/   q)  ") ")s'   0BB
B4BB
BBc                 N  <"   ^ p\         P                  ! V 4      p. pV  Rj  xL
  pTP                  VG Rj  xL
 4       V^,          pV^8X  g   K5   SP                  \	        T4      ^4       T  Rj  xL
  pTP                  TG Rj  xL
 4       K%   Ls L_DvLH L& LD)T# 5ir  r7  r8  s   &    r   r  KBaseTaskTests.test_as_completed_resume_iterator.<locals>.try_async_iteratorM  s     J++J7HI#  a  q)a
?S^Q/ $ * *a  q)!( $*!( $sq   B%BBBB%B
B%B%3B"7B8B";B%B 

B%BB%B%B" B%"B%c                    "   V # 5ir   r   r  s   &r   rV   =BaseTaskTests.test_as_completed_resume_iterator.<locals>.coro]  r  r   r  N)r   r  r  rk  )r  r  r   r   r  r4   r~   assertCountEqual)r-   r  r  rV   rQ   r   resultss   f      r   !test_as_completed_resume_iterator/BaseTaskTests.test_as_completed_resume_iterator9  s    	 	 	  6 6 899T#7\\\66"55T!Wd1gtAwQ@AG ))'<@	 76 8 :9666 :99s%   +C-AC	3C	C	CC.	c                   a aa R  pS P                  V4      o\        P                  ! RR4      p\        P                  ! RR4      pW#0oVVV 3R lpSP                  V! 4       4       R# )c               3   &   "   ^ x  Rx  ^ x  R# 5i)r   皙?Nr   r   r   r   r&  9BaseTaskTests.test_as_completed_reverse_wait.<locals>.genm  s     GJGr+  rG  r   r  rX  c                    <"   \        \        P                  ! S4      4      p SP                  \	        V 4      ^4       V ^,          G Rj  xL
 pSP                  VR4       SP                  RSP                  4       4       SP                  R4       V ^ ,          G Rj  xL
 pSP                  VR4       SP                  RSP                  4       4       R#  L L:5i)r  Nr   rG  rX  r  )listr   r  rm   r  r  r`  r  )futsr^  yfsrQ   r-   s      r   r   :BaseTaskTests.test_as_completed_reverse_wait.<locals>.testx  s     ,,R01DSY*1gAQ$""45d#1gAQ$""45  s%   AC
CACC9CCN)rf   r   r   r~   )r-   r&  r   rX  r   rM  rQ   s   f    @@r   test_as_completed_reverse_wait,BaseTaskTests.test_as_completed_reverse_waith  sX    
	
 !!#&MM$$MM$$V
	6 	'r   c                z  a aa	 V 3R  lpR pR pW#3 F  o	S P                  S	P                  R7      ;_uu_ 4        \        P                  ! RR4      p\        P                  ! RR4      pWE0oVV	V 3R lpS P	                  V4      pVP                  V! 4       4       RRR4       K  	  R#   + '       g   i     K  ; i)	c               3   p   <"   R x p SP                  RV 4       ^ x p SP                  RV 4       Rx  R # 5i)NrG  r  r  s    r   r&  7BaseTaskTests.test_as_completed_concurrent.<locals>.gen  r  rp  c                 H   "   \        \        P                  ! V 4      4      # 5ir   )rJ  r   r  )rM  s   &r   r  @BaseTaskTests.test_as_completed_concurrent.<locals>.try_iterator  s     ,,R011s    "c                 l   "   \         P                  ! V 4       Uu. u R j  xL
 qNK   LDup# u upi 5ir   r   r  )rM  r   s   & r   r  FBaseTaskTests.test_as_completed_concurrent.<locals>.try_async_iterator  s'     %,%9%9"%=>>A>>>s$   4/+)
+/+/4r  rG  r   rX  c                  H  <"   S! S4      G R j  xL
 p SP                  \        V 4      ^4       \        P                  ! V  Uu. uF  p\        P                  ! V4      NK  	  up4      G R j  xL
 w  r#SP                  \        R V 4       4      RR04       R #  Lu upi  L35i)Nc              3   @   "   T F  qP                  4       x  K  	  R # 5ir   r   r  s   & r   r  KBaseTaskTests.test_as_completed_concurrent.<locals>.test.<locals>.<genexpr>  s     (BTTr  r   rX  )rm   r  r   r  r   rs  )rK  r   r   r  rM  r  r-   s       r   r   8BaseTaskTests.test_as_completed_concurrent.<locals>.test  s     !'+D$$SY2*1,,?CDt..s3tD+ %MD $$S(BT(B%BS#JO , E%s-   B"B3B"B"
B",B --B"B"N)r  r4   r   r   rf   r~   )
r-   r&  r  r  r   rX  r   rQ   rM  r  s
   f       @@r   test_as_completed_concurrent*BaseTaskTests.test_as_completed_concurrent  s    		2	? #6FV__55MM$,MM$,VP ))#.''/ 65 7555s   A!B))B:c                  a R  oV3R lpV3R lpW3 F  pV P                  VP                  R7      ;_uu_ 4        V P                  V P                  V! 4       4      pV P                  P	                  V4       VP                  4       pV P                  \        V4      RR04       V P                  \        V4      ^4       RRR4       K  	  R#   + '       g   i     K  ; i)c                    "   V # 5ir   r   r|  s   &r   rV   BBaseTaskTests.test_as_completed_duplicate_coroutines.<locals>.coro  r  r   c                     <"   . p S! R 4      p\         P                  ! WS! R4      .4       F  pT P                  VG Rj  xL
 4       K  	  V #  L5ihamr  Nr  r   r  r   rV   s      r   r  JBaseTaskTests.test_as_completed_duplicate_coroutines.<locals>.try_iterator  sK     FUA))1f*>?Ag& @M &s   <AA
 Ac                     <"   . p S! R 4      p\         P                  ! WS! R4      .4        Rj  xL
  pT P                  VG Rj  xL
 4       K%   L  LD#T # 5irc  r  re  s      r   r  PBaseTaskTests.test_as_completed_duplicate_coroutines.<locals>.try_async_iterator  sX     FUA"//tF|0DE ' 'aAg&'% FMs7   )AAAAAA

AAAAr  rd  r  N)	r  r4   rW   rQ   r~   r   rm   rs  r  )r-   r  r  r  r   r   rV   s   &     @r   &test_as_completed_duplicate_coroutines4BaseTaskTests.test_as_completed_duplicate_coroutines  s    			 #6FV__55mmDIIvx8		,,S1  Vufo>  Va0 65 7555s   BCCc                
   R  pV! 4       pV P                  VP                  4       V P                  \        R4      ;_uu_ 4        \        P
                  ! V.4      p\        V4       RRR4       R#   + '       g   i     R# ; i)c                     "   ^*# 5ir?   r   r   r   r   rV   DBaseTaskTests.test_as_completed_coroutine_without_loop.<locals>.coro  r_  r   r   N)r   rI   r   r   r   r  rJ  )r-   rV   r   rK  s   &   r   (test_as_completed_coroutine_without_loop6BaseTaskTests.test_as_completed_coroutine_without_loop  s]    	 F ##L2IJJ'',DJ KJJJs   #A11B	c                j   a a S P                  4       pR  oVV 3R lpVP                  V! 4       4       R# )c                     "   ^*# 5ir?   r   r   r   r   rV   HBaseTaskTests.test_as_completed_coroutine_use_running_loop.<locals>.coro  r_  r   c                     <"   \        \        P                  ! S! 4       .4      4      p SP                  \	        V 4      ^4       SP                  V ^ ,          G Rj  xL
 ^*4       R#  L5ir  N)rJ  r   r  rm   r  )rK  rV   r-   s    r   r   HBaseTaskTests.test_as_completed_coroutine_use_running_loop.<locals>.test  sK     ,,dfX67DSY*47]B/]s   AA)A'A)Nr  )r-   rQ   r   rV   s   f  @r   ,test_as_completed_coroutine_use_running_loop:BaseTaskTests.test_as_completed_coroutine_use_running_loop  s-    !!#		0
 	'r   c                L  a  V 3R  lpS P                  V4      pR pS P                  W#! RR4      4      pVP                  V4       S P                  VP	                  4       4       S P                  VP                  4       R4       S P                  RVP                  4       4       R# )c               3   p   <"   R x p SP                  RV 4       Rx p SP                  RV 4       Rx  R # 5i)NrG  r  r  r  s    r   r&  %BaseTaskTests.test_sleep.<locals>.gen  s7     D""4.:D""3-Jrp  c                    "   \         P                  ! V ^,          4      G Rj  xL
  \         P                  ! V ^,          V4      G Rj  xL
 pV#  L, L5i)r  Nr  )r  argr  s   && r   r  )BaseTaskTests.test_sleep.<locals>.sleeper  s?     --1%%%bdC00CJ &0s!   !AA%A	A
AAr  yeahN)	rf   rW   r~   r   r   rm   r   r  r`  r-   r&  rQ   r  r   s   f    r   
test_sleepBaseTaskTests.test_sleep  s    	 !!#&	
 MM$V 45"!V,sDIIK0r   c                    R  pV P                  V4      pR pV P                  W#! 4       4      pV P                  \        4      ;_uu_ 4        VP	                  V4       RRR4       R#   + '       g   i     R# ; i)c               3      "   R x  R # 5ir   r   r   r   r   r&  7BaseTaskTests.test_sleep_when_delay_is_nan.<locals>.gen       ri  c                  `   "   \         P                  ! \        R 4      4      G Rj  xL
  R#  L5i)nanN)r   r   r  r   r   r   r  ;BaseTaskTests.test_sleep_when_delay_is_nan.<locals>.sleeper  s     --e---s   #.,.N)rf   rW   r|   r   r~   r  s   &    r   test_sleep_when_delay_is_nan*BaseTaskTests.test_sleep_when_delay_is_nan  s`    	 !!#&	. MM$	*z**##A& +***s   A''A8	c                  a aa V 3R  lpS P                  V4      pS P                  V\        P                  ! RR4      4      pRoVP                  oVV3R lpWBn        \
        P                  ! V4       S P                  SP                  4       VP                  4        \
        P                  ! V4       S P                  SP                  4       R# )c               3   D   <"   R x p SP                  RV 4       ^ x  R # 5ir  r  r  s    r   r&  ,BaseTaskTests.test_sleep_cancel.<locals>.gen  r  r  r  r~  Nc                    < S! W.VO5!  oS# r   r   )delaycallbackr$   handleorig_call_laters   &&*r   r  3BaseTaskTests.test_sleep_cancel.<locals>.call_later  s    $U<t<FMr   )rf   rW   r   r   r  r  rR  r  
_cancelledr{   r   )r-   r&  rQ   r   r  r  r  s   f    @@r   test_sleep_cancelBaseTaskTests.test_sleep_cancel  s    	
 !!#&MM$dF ;<//	
 %t$**+	
t$))*r   c                   a aa V 3R  lpS P                  V4      oR oVV V3R lpV! 4       pS P                  SP                  V4      R4       S P                  RSP	                  4       4       R# )c               3   p   <"   R x p SP                  RV 4       ^ x p SP                  RV 4       Rx  R # 5i)Nr    r  r  s    r   r&  9BaseTaskTests.test_task_cancel_sleeping_task.<locals>.gen  s7     D""3-7D""4.Irp  c                 N   "   \         P                  ! V 4      G R j  xL
  R #  L5ir   r  )r  s   &r   r   ;BaseTaskTests.test_task_cancel_sleeping_task.<locals>.sleep&  r  r  c                     <"   SP                  SS! R 4      4      p SP                  RV P                  4        V G Rj  xL
  R#  L  \        P                   d     R# i ; i5i)r  r  Nzslept inr  )rW   r  r{   r   r}   )r  rQ   r-   r   s    r   doit:BaseTaskTests.test_task_cancel_sleeping_task.<locals>.doit)  sY     mmD%+6GOOC0" "	 )) #"#s8   5A#A AA A#A A A#A  A#r  r  N)rf   rm   r~   r  r`  )r-   r&  r  doerrQ   r   s   f   @@r   test_task_cancel_sleeping_task,BaseTaskTests.test_task_cancel_sleeping_task  s^    	 !!#&	$	" v006DsDIIK0r   c                B  a V P                  V P                  4      oV3R  lpV P                  V P                  V! 4       4      p\        P                  ! V P                  4       V P                  VP                  S4       VP                  4        \        P                  ! V P                  4       V P                  \        P                  V P                  P                  V4       V P                  VP                  4       V P                  SP                  4       4       R# )c                  (   <"   S G R j  xL
  R #  L5ir   r   r   s   r   rV   :BaseTaskTests.test_task_cancel_waiter_future.<locals>.coro:  r1  r   N)r^   rQ   rW   r  rR  r   r  r{   r|   r   r}   r~   r  r   r  )r-   rV   rq   r   s   &  @r   test_task_cancel_waiter_future,BaseTaskTests.test_task_cancel_waiter_future7  s    oodii(	 }}TYY/tyy)d&&,tyy)""DII$@$@$	H$**+(r   c                   R  pV! 4       pV P                  V P                  V4      pV P                  \        R4      ;_uu_ 4        VP	                  R4       RRR4       V P                  \        R4      ;_uu_ 4        VP                  \        4       4       RRR4       V P                  V P                  P                  V4      R4       R#   + '       g   i     L}; i  + '       g   i     LP; i)c                     "   R # 5i)r   r   r   r   r   r   4BaseTaskTests.test_task_set_methods.<locals>.notmuchI  r   r   znot support set_resultr   Nznot support set_exceptionr   )	rW   rQ   r   r   r   set_exceptionr   rm   r~   )r-   r   r&  rq   s   &   r   test_task_set_methods#BaseTaskTests.test_task_set_methodsH  s    	 i}}TYY,##L2JKKOOD! L ##L2MNNz|, O 	II((.	 LK ONs   C=CC	C/	c                B  aa  ! R  R\         P                  4      pV! V P                  R7      oRoVV3R lpV P                  V P                  V! 4       4      p\        P
                  ! V P                  4       V P                  SP                  4       \        4       pSP                  V4       \        P
                  ! V P                  4       V P                  VS4       V P                  VP                  4       4       V P                  VP                  4       4       R# )c                   >   a a ] tR tRt oV 3R ltV 3R ltRtVtV ;t# )2BaseTaskTests.test_step_result_future.<locals>.Futi\  c                6   < R V n         \        SV `  ! V/ VB  R# )FN)cb_addedrd   r   )r-   r$   kwdsrT   s   &*,r   r   ;BaseTaskTests.test_step_result_future.<locals>.Fut.__init__]  s     % $/$/r   c                6   < R V n         \        SV `  ! V/ VB  R# r  )r  rd   r!  r-   r$   kwargsrT   s   &*,r   r!  DBaseTaskTests.test_step_result_future.<locals>.Fut.add_done_callbacka  s     $)4:6:r   )r  	r4   r5   r6   r7   r   r!  r8   r9   __classcell__rT   r;   s   @@r   Futr  \  s     0; ;r   r  r[   Nc                  (   <"   S G R j  xL
 oR #  L5ir   r   )r   r   s   r   wait_for_future>BaseTaskTests.test_step_result_future.<locals>.wait_for_futureh  s     YFYr   )r   r\   rQ   rW   r  rR  r   r  objectr   r   r   r  r   )r-   r  r  r   r  r   r   s   &    @@r   test_step_result_future%BaseTaskTests.test_step_result_futureY  s    	;'.. 	; tyy!	 MM$))_%67tyy)%hstyy)c6"!!((*%r   c                  a aa V 3R  lpS P                  V4      pR o\        4       oVV3R lpS P                  W#! 4       4      p\        P                  ! V4       VP                  4        S P                  VP                  4       4       S P                  \        \        P                  V4       S P                  VP                  4       4       S P                  VP                  4       4       S P                  VP                  4       S4       R# )c               3   D   <"   R x p SP                  RV 4       ^ x  R # 5ir  r  r  s    r   r&  ;BaseTaskTests.test_baseexception_during_cancel.<locals>.geny  r  r  c                  N   "   \         P                  ! ^
4      G Rj  xL
  R#  L5ir~  r  r   r   r   r  ?BaseTaskTests.test_baseexception_during_cancel.<locals>.sleeper  r  r  c                  j   <"    S! 4       G R j  xL
  R #  L  \         P                   d    S hi ; i5ir   r  )base_excr  s   r   notmutch@BaseTaskTests.test_baseexception_during_cancel.<locals>.notmutch  s-     i)) s    3
  3 03N)rf   
SystemExitrW   r  rR  r{   r  r   r|   r   r  r   r   )r-   r&  rQ   r  rq   r  r  s   f    @@r    test_baseexception_during_cancel.BaseTaskTests.test_baseexception_during_cancelw  s    	
 !!#&	$ <	 }}T8:.t$%*j&<&<dC		$)*dnn&1r   )categoryc                   R  pV P                  \        P                  ! V4      4       R pV P                  \        P                  ! V4      4       R pV P                  \        P                  ! V4      4       V P                  \        P                  ! \        P
                  ! 4       4      4       V P                  \        P                  ! \        P                  ! 4       4      4       R# )c                      R # r   r   r   r   r   fn2BaseTaskTests.test_iscoroutinefunction.<locals>.fn  s    r   c               3      "   R x  R # 5ir   r   r   r   r   fn13BaseTaskTests.test_iscoroutinefunction.<locals>.fn1  r  ri  c                     "   R # 5ir   r   r   r   r   fn23BaseTaskTests.test_iscoroutinefunction.<locals>.fn2  rw   r   N)r  r   iscoroutinefunctionr   r   Mock	AsyncMock)r-   r  r  r  s   &   r   test_iscoroutinefunction&BaseTaskTests.test_iscoroutinefunction  s    	 	44R89	44S9:	33C8944TYY[AB33DNN4DEFr   c                   R  pV P                  \        P                  ! V4      4       V! 4       pV P                  \        P                  ! V4      4       V P                  P                  V4      pV P                  VR4       R# )c                     "   R # 5i)r   r   r   r   r   r  ;BaseTaskTests.test_coroutine_non_gen_function.<locals>.func  s     r   r   N)r   r   r  iscoroutinerQ   r~   rm   )r-   r  rV   r  s   &   r   test_coroutine_non_gen_function-BaseTaskTests.test_coroutine_non_gen_function  sb    	 	33D9:v++D12ii**40f%r   c                r  a V P                  V P                  4      oV3R  lpV3R lpV P                  V P                  V! 4       4      pV P                  V P                  V! 4       4      pV P                  P                  V4      pV P	                  VS4       V P                  VP                  4       4       R# )c                     <"   S # 5ir   r   r   s   r   r  IBaseTaskTests.test_coroutine_non_gen_function_return_future.<locals>.func  s     Js   c                  2   <"   S P                  R 4       R# 5i)r   Nr   r   s   r   rV   IBaseTaskTests.test_coroutine_non_gen_function_return_future.<locals>.coro  s     NN6"s   N)r^   rQ   rW   r~   rm   r  r   )r-   r  rV   r7  r8  r  r   s   &     @r   -test_coroutine_non_gen_function_return_future;BaseTaskTests.test_coroutine_non_gen_function_return_future  s    oodii(		# ]]499df-]]499df-ii**2.c""))+&r   c                R  a a S P                  S P                  S P                  R 7      4       V V3R lpS P                  S P                  V! S P                  4      4      oS P                  P	                  S4       S P                  S P                  S P                  R 7      4       R# )r[   c                    <"   SP                  SP                  4       S4       SP                  SP                  R 4      S4       SP                  SP                  4       S4       R # 5ir   )r   r  )rQ   r-   rq   s   &r   rV   -BaseTaskTests.test_current_task.<locals>.coro  sM     MM$++-t4MM$++D148MM$++-t4s   A$A'N)r  r  rQ   rW   r~   rg  s   f @r   test_current_taskBaseTaskTests.test_current_task  sx    $+++;<	5 }}TYYTYY8		$$T*$+++;<r   c                ^  a aaaa S P                  S P                  S P                  R 7      4       S P                  S P                  4      oS P                  S P                  4      oVVV V3R lpVVV V3R lpS P	                  S P                  V! S P                  4      4      oS P	                  S P                  V! S P                  4      4      oS P                  P                  \        P                  ! SS34      4       S P                  S P                  S P                  R 7      4       R# )r[   c                    <"   SP                  SP                  4       SJ 4       SG R j  xL
  SP                  SP                  4       SJ 4       SP                  R4       R #  L85i)NTr   r  r   )rQ   r  r  r-   task1s   &r   r  FBaseTaskTests.test_current_task_with_interleaving_tasks.<locals>.coro1  sR     OOD--/589JJOOD--/589OOD! s   'A%A#9A%c                    <"   SP                  SP                  4       SJ 4       SP                  R 4       SG Rj  xL
  SP                  SP                  4       SJ 4       R#  L'5ir  r  )rQ   r  r  r-   task2s   &r   r  FBaseTaskTests.test_current_task_with_interleaving_tasks.<locals>.coro2  sR     OOD--/589OOD!JJOOD--/589 s   8A%A#(A%N)r  r  rQ   r^   rW   r~   r   r  )r-   r  r  r  r  r  r  s   f  @@@@r   )test_current_task_with_interleaving_tasks7BaseTaskTests.test_current_task_with_interleaving_tasks  s    $+++;<tyy)tyy)	" 	"	: 	: diityy)9:diityy)9:		$$W\\5%.%AB$+++;<r   c                  a aaa ^ oS P                  S P                  4      oVV V3R loVV3R lp\        P                  ! V! 4       S P                  R7      p\        P
                  ! S P                  4       VP                  4        S P                  P                  V4       S P                  S^e4       S P                  SP                  4       4       R# )r   c                     <"    SG R j  xL
  SP                  R4       R #  L  \        P                   d    S ^,          o h i ; i5i)Nzgot past sleep() in inner())rH  r   r}   )proofr-   waiters   r   inner<BaseTaskTests.test_yield_future_passes_cancel.<locals>.inner  sF     9
 		78 )) 
s%   A$ "$ A$  AAc                     <"    S ! 4       G R j  xL
  S^
,          oR #  L  \         P                   d    S^d,          o R # i ; i5ir   r  r   r  s   r   r[  <BaseTaskTests.test_yield_future_passes_cancel.<locals>.outer  sA     g 	 )) s0   A
! ! A! AAAAr[   N)r^   rQ   r   r   r  rR  r{   r~   rm   r   r  r-   r[  r   r   r  r  s   f  @@@r   test_yield_future_passes_cancel-BaseTaskTests.test_yield_future_passes_cancel  s    +	9	 !!%'		:tyy)	
		$$Q'$((*+r   c                  a aaa ^ oS P                  S P                  4      oVV3R loVVV 3R lp\        P                  ! V! 4       S P                  R7      p\        P
                  ! S P                  4       VP                  4        S P                  \        P                  S P                  P                  V4       SP                  R4       \        P
                  ! S P                  4       S P                  S^4       R# )r   c                  :   <"   SG R j  xL
  S ^,          o R #  L5ir   r   r  r  s   r   r   CBaseTaskTests.test_yield_wait_does_not_shield_cancel.<locals>.inner       LLQJE    c                    <"   SP                  \        4      ;_uu_ 4        \        P                  ! \        P                  ! S! 4       4      .4      G R j  xL
 w  rR R R 4       S^d,          oR #  L  + '       g   i     L; i5ir   )assertWarnsDeprecationWarningr   r  r  )r  pr   r  r-   s     r   r[  CBaseTaskTests.test_yield_wait_does_not_shield_cancel.<locals>.outer  sW     !!"455$\\7+>+>uw+G*HII 6SLE J 65s.   B4A1A/A1B/A11B	<Br[   Nr^   rQ   r   r   r  rR  r{   r|   r}   r~   r   rm   r  s   f  @@@r   &test_yield_wait_does_not_shield_cancel4BaseTaskTests.test_yield_wait_does_not_shield_cancel  s     +	
	 !!%'		:tyy)	
""DII$@$@!	E$tyy)"r   c                    V P                  V P                  4      p\        P                  ! V4      pVP	                  ^*4       V P                  P                  V4      pV P                  V^*4       R# r@   N)r^   rQ   r   shieldr   r~   rm   )r-   r   r[  r  s   &   r   test_shield_result BaseTaskTests.test_shield_result&  sT    		*u%ii**51b!r   c                `   V P                  V P                  4      p\        P                  ! V4      p\        P
                  ! V P                  4       \        R 4      pVP                  V4       \        P
                  ! V P                  4       V P                  VP                  4       V4       R# )expectedN)
r^   rQ   r   r  r  rR  r   r  r   r   )r-   r   r[  r%   s   &   r   test_shield_exception#BaseTaskTests.test_shield_exception-  ss    		*u%tyy):&C tyy)eoo'-r   c                F   V P                  V P                  4      p\        P                  ! V4      p\        P
                  ! V P                  4       VP                  4        \        P
                  ! V P                  4       V P                  VP                  4       4       R # r   )	r^   rQ   r   r  r  rR  r{   r   r  r-   r   r[  s   &  r   test_shield_cancel_inner&BaseTaskTests.test_shield_cancel_inner6  sb    		*u%tyy)tyy))*r   c                   V P                  V P                  4      p\        P                  ! V4      p\        P
                  ! V P                  4       VP                  4        \        P
                  ! V P                  4       V P                  VP                  4       4       T P                  ^ VP                  f	   ^ 4       R# \        VP                  4      4       R# r  )r^   rQ   r   r  r  rR  r{   r   r  rm   
_callbacksr  r   s   &  r   test_shield_cancel_outer&BaseTaskTests.test_shield_cancel_outer>  s    		*u%tyy)tyy))*!1!1!9AUs5CSCS?TUr   c                   \         P                  ! 4       pV P                  P                  V4       V P	                  V P                  4      p\
        P                  ! V4      p\        P                  ! V P                  4       VP                  4        \        P                  ! V P                  4       VP                  ^4       \        P                  ! V P                  4       VP                  4        R# rt  )r   r  rQ   set_exception_handlerr^   r   r  r  rR  r{   r   assert_not_calledr-   mock_handlerr   r[  s   &   r   test_shield_cancel_outer_result-BaseTaskTests.test_shield_cancel_outer_resultG  s    yy{		''5		*u%tyy)tyy)tyy)&&(r   c                   \         P                  ! 4       pV P                  P                  V4       V P	                  V P                  4      p\
        P                  ! V4      p\        P                  ! V P                  4       VP                  4        \        P                  ! V P                  4       VP                  \        R 4      4       \        P                  ! V P                  4       VP                  4        R# r   Nr   r  rQ   r(  r^   r   r  r  rR  r{   r  rm  assert_called_oncer*  s   &   r   "test_shield_cancel_outer_exception0BaseTaskTests.test_shield_cancel_outer_exceptionS  s    yy{		''5		*u%tyy)tyy)Ie,-tyy)'')r   c                   \         P                  ! 4       pV P                  P                  V4       V P	                  V P                  4      p\
        P                  ! V4      p\        P                  ! V P                  4       VP                  4        \        P                  ! V P                  4       \
        P                  ! V4      p\        P                  ! V P                  4       VP                  4        \        P                  ! V P                  4       VP                  \        R 4      4       \        P                  ! V P                  4       VP                  4        R# r/  r0  r*  s   &   r   test_shield_duplicate_log_once,BaseTaskTests.test_shield_duplicate_log_once_  s    yy{		''5		*u%tyy)tyy)u%tyy)tyy)Ie,-tyy)'')r   c                    V P                  V P                  4      pVP                  ^*4       V P                  P                  \        P
                  ! V4      4      pV P                  V^*4       R# r  )r^   rQ   r   r~   r   r  rm   )r-   r   r  s   &  r   test_shield_shortcut"BaseTaskTests.test_shield_shortcuto  sM    oodii(rii**7>>#+>?b!r   c                R  aaa ^ oV P                  V P                  4      oVV3R loVV3R lp\        P                  ! V! 4       V P                  R7      p\        P
                  ! V P                  4       VP                  4        V P                  \        P                  4      ;_uu_ 4        V P                  P                  V4       RRR4       SP                  R4       \        P
                  ! V P                  4       V P                  S^4       R#   + '       g   i     LU; i)r   c                  :   <"   SG R j  xL
  S ^,          o R #  L5ir   r   r
  s   r   r   /BaseTaskTests.test_shield_effect.<locals>.innerz  r  r  c                  l   <"   \         P                  ! S ! 4       4      G R j  xL
  S^d,          oR #  L5ir   r   r  r  s   r   r[  /BaseTaskTests.test_shield_effect.<locals>.outer  s(     ..)))SLE *s   424r[   Nr  r  s   &  @@@r   test_shield_effect BaseTaskTests.test_shield_effectu  s    +	
	
 !!%'		:tyy)	
w5566II((+ 7$tyy)"	 76s   -DD&	c                p   V P                  V P                  4      pV P                  V P                  4      p\        P                  ! W4      p\        P                  ! V4      p\
        P                  ! V P                  4       VP                  4        \
        P                  ! V P                  4       V P                  VP                  4       4       VP                  ^4       VP                  ^4       \
        P                  ! V P                  4       V P                  VP                  4       ^^.4       R# rt  )r^   rQ   r   r   r  r  rR  r{   r   r  r   rm   r   )r-   child1child2parentr[  s   &    r   test_shield_gather BaseTaskTests.test_shield_gather  s    ++/v&tyy)tyy))*!!tyy)1a&1r   c                   V P                  V P                  4      pV P                  V P                  4      p\        P                  ! V4      p\        P                  ! V4      p\        P                  ! W44      p\
        P                  ! V P                  4       VP                  4        \
        P                  ! V P                  4       V P                  VP                  4       \        P                  4       V P                  VP                  4       4       V P                  VP                  4       4       VP                  ^4       VP                  ^4       \
        P                  ! V P                  4       R# rt  )r^   rQ   r   r  r   r  rR  r{   ro   r   r}   r   r  r   )r-   rC  rD  rY  rZ  rE  s   &     r   test_gather_shield BaseTaskTests.test_gather_shield  s    ++''/tyy)tyy)f..0'2H2HI((*+((*+!!tyy)r   c                    R  pV! 4       pV P                  VP                  4       V P                  \        R4      ;_uu_ 4        \        P
                  ! V4       RRR4       R#   + '       g   i     R# ; i)c                     "   ^*# 5ir?   r   r   r   r   rV   >BaseTaskTests.test_shield_coroutine_without_loop.<locals>.coro  r_  r   r   N)r   rI   r   r   r   r  r-   rV   r   s   &  r   "test_shield_coroutine_without_loop0BaseTaskTests.test_shield_coroutine_without_loop  sP    	 $##L2IJJNN5! KJJJs   A%%A6	c                   a R  oV3R lpV P                   P                  V! 4       4      pV P                  VP                  V P                   4       V P                   P                  V4      pV P                  V^*4       R# )c                     "   ^*# 5ir?   r   r   r   r   rV   BBaseTaskTests.test_shield_coroutine_use_running_loop.<locals>.coro  r_  r   c                  B   <"   \         P                  ! S ! 4       4      # 5ir   r>  r   s   r   r   BBaseTaskTests.test_shield_coroutine_use_running_loop.<locals>.test  s     >>$&))r   N)rQ   r~   rm   r   )r-   r   r[  r  rV   s   &   @r   &test_shield_coroutine_use_running_loop4BaseTaskTests.test_shield_coroutine_use_running_loop  s_    		*		,,TV4dii0ii**51b!r   c                h   R  p\         P                  ! V P                  4       V P                  \         P                  R4       \         P                  ! V! 4       4      pV P                  VP                  V P                  4       V P                  P                  V4      pV P                  V^*4       R# )c                     "   ^*# 5ir?   r   r   r   r   rV   ABaseTaskTests.test_shield_coroutine_use_global_loop.<locals>.coro  r_  r   N)r   r   rQ   r   r  rm   r   r~   )r-   rV   r[  r  s   &   r   %test_shield_coroutine_use_global_loop3BaseTaskTests.test_shield_coroutine_use_global_loop  s{    	 	tyy)..5tv&dii0ii**51b!r   c                   V P                  V P                  4      pV P                  \        4      ;_uu_ 4        \        P
                  ! V4      p\        V4       R R R 4       \        4       pV P                  \        4      ;_uu_ 4        \        P
                  ! V4      p\        V4       R R R 4       VP                  4        R pV P                  V P                  4      pV P                  \        4      ;_uu_ 4        V P                  P                  V! V4      4       R R R 4       \        4       pV P                  \        4      ;_uu_ 4        V P                  P                  V! V4      4       R R R 4       VP                  4        R #   + '       g   i     EL:; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L\; i)Nc                 Z   "   \         P                  ! V 4        R j  xL
  p R #  LD	R # 5ir   rW  )awr   s   & r   r  HBaseTaskTests.test_as_completed_invalid_args.<locals>.try_async_iterator  s*     "//3  a3s   +(&(+(+)
r^   rQ   r|   r   r   r  nextr   rI   r~   )r-   r   r:  rV   r  s   &    r   test_as_completed_invalid_args,BaseTaskTests.test_as_completed_invalid_args  s2    oodii(y))++C0HN * "#y))++D1HN * 	

	 oodii(y))II(();C)@A *!#y))II(();D)AB *

) *)) *) *) *)s/   "F
"F ?"F3"GF	 F0	3G	G	c                   V P                  V P                  4      pV P                  \        V P                  P                  \
        P                  ! V4      4       \        4       pV P                  \        V P                  P                  \
        P                  ! V4      4       VP                  4        V P                  \        V P                  P                  \
        P                  ! . 4      4       R # r   )
r^   rQ   r|   r   r~   r   r  r   rI   r   )r-   r   rV   s   &  r   test_wait_invalid_args$BaseTaskTests.test_wait_invalid_args  s    oodii( 	)TYY%A%ALL	!#)TYY%A%ALL	 

 	*dii&B&BLL	r   c           	     x  a  V 3R  lp\         P                  ! 4       pS P                  P                  R4       S P                  P	                  V4       V! S P                  4      pS P                  S P                  V4      pS P                  S P                  S P                  R7      V04       S P                  P                  \        P                  ! ^ 4      4       S P                  \        S P                  P                  4      ^ 4       RpVP                  pRp\        P                  ! 4        VP!                  S P                  RRR\         P"                  RV/4       VP%                  4        \        P                  ! 4        S P                  S P                  S P                  R7      \'        4       4       R# )c                 \   <"   SP                  V 4      pVG R j  xL
  \        R4      h L5i)Nzcode never reached)r^   rm  )rQ   futurer-   s   & r   kill_me>BaseTaskTests.test_log_destroyed_pending_task.<locals>.kill_me  s.     __T*FLL 011 s   ,*,Tr[   Nmessagez%Task was destroyed but it is pending!rq   r   )r   r  rQ   r  r(  rW   rm   	all_tasksr~   r   r   r  _readyr"  r   
gc_collectassert_called_withANY
reset_mockrs  )r-   rj  r+  rV   rq   r   s   f     r   test_log_destroyed_pending_task-BaseTaskTests.test_log_destroyed_pending_task  sG   	2 yy{		D!		''5 tyy!}}TYY-TYY7$@ 			$$W]]1%56TYY--.211 	''		>DHH 04
 	
 	!TYY7?r   c                    V P                   P                  p ! R  RV4      pR pV! 4       pV! W@P                  R7      pRVn        ?\        P
                  ! 4        VP                  4        R# )c                   &   a  ] tR tRt o R tRtV tR# )HBaseTaskTests.test_task_not_crash_without_finalization.<locals>.Subclassi$	  c                    R # r   r   r,   s   &r   r   PBaseTaskTests.test_task_not_crash_without_finalization.<locals>.Subclass.__del__%	  s    r   r   Nr   r:   s   @r   Subclassrw  $	  s      r   rz  c                  N   "   \         P                  ! R 4      G Rj  xL
  R#  L5i)r  Nr  r   r   r   corofnFBaseTaskTests.test_task_not_crash_without_finalization.<locals>.corofn(	  s     --%%%r  r[   FN)rT   rU   rQ   _log_destroy_pendingr   ro  rI   )r-   rU   rz  r|  rV   rq   s   &     r   (test_task_not_crash_without_finalization6BaseTaskTests.test_task_not_crash_without_finalization!	  sY    ~~""	t 		& xYY/$)!

r   zasyncio.base_events.loggerc                   a aa \         P                  ! 4       oS P                  S4       R  oVVV 3R lpSP                  V! 4       4       S P	                  VP
                  P                  4       R# )c                     "   \         h5ir   )r   r   r   r   rV   BBaseTaskTests.test_tb_logger_not_called_after_cancel.<locals>.coro:	  s
     Ori  c                     <"   SP                  SS! 4       4      p \        P                  ! R 4      G Rj  xL
  V P                  4        Rp R#  L5i)rG  Nr3  )rq   rV   rQ   r-   s    r   r  DBaseTaskTests.test_tb_logger_not_called_after_cancel.<locals>.runner=	  s=     ==tv.D--%%%KKMD &s   1AAAN)r   r   r   r~   r  errorcalled)r-   m_logr  rV   rQ   s   f& @@r   &test_tb_logger_not_called_after_cancel4BaseTaskTests.test_tb_logger_not_called_after_cancel5	  sS    %%'D!		 	)++,r   c                   V P                   P                  R 4       V P                  V P                   \        4       4      p\        P
                  ! 4       P                  ^,
          pV P                  VP                  \        4       V P                  VP                  R,          R,          \        VR34       V P                   P                  V4       R# )T:Nrk  Ntest_task_source_tracebackN)rQ   r  rW   r   r  	_getframef_linenoro   r"  rJ  rm   __file__r~   )r-   rq   r%  s   &  r   r  (BaseTaskTests.test_task_source_tracebackF	  s    		D!}}TYY(:(<=))A-d44d;//3B7" 68	9 			$$T*r   c                  aaa \         P                  ! 4       pV P                  VP                  4       V P	                  V4      oV3R lpVP                  V! 4       4      oRoVV3R lpSP                  V4       SP                  ^*4       VP                  S4       V P                  SR4       V P                  SP                  4       4       V P                  SP                  4       ^*.4       R# )zQEnsure that a gathering future refuses to be cancelled once all
children are donec                  z   <"   V3R  lp \         P                  ! V ! 4       4      p\         P                  ! V4      # 5i)c                  $   <"   S G R j  xL
 #  L5ir   r   r   s   r   
child_coroFBaseTaskTests.test_cancel_gather_1.<locals>.create.<locals>.child_coro\	  s      y ys   )r   r   r   )r  gather_futurer   s     r   create2BaseTaskTests.test_cancel_gather_1.<locals>.createY	  s,     !#NN:<8M((77s   8;Nc                 (   < SP                  4       oR # r   r  )r   cancel_resultgather_tasks   &r   cancelling_callback?BaseTaskTests.test_cancel_gather_1.<locals>.cancelling_callbackc	  s    '..0Mr   F)r   r   r   rI   r^   r~   r!  r   rm   r  r  r   )r-   rQ   r  r  r  r   r  s   &   @@@r   test_cancel_gather_1"BaseTaskTests.test_cancel_gather_1R	  s     %%'

#ood#	8 --fh7	1 	12r 	, 	...01++-t4r   c           
     >  a aaa . ROpV F  w  opS P                  SR7      ;_uu_ 4        \        P                  ! 4       oS P                  SP                  4       R oVVV V3R lp SP                  V! 4       4       S P                  R4       R R R 4       K  	  R #   \        P                   dU   pS P                  TP                  T4       \        T4      pS P                  T\        P                  T^ 34        R p?LrR p?ii ; i  + '       g   i     EK  ; i)Nr  c                     "   ^ p  V R,          p \         P                  ! \         P                  ! R4      RR7      G Rj  xL
  V ^8  g   KG  R#  L5i)r   TrG  return_exceptionsN)r   r   r   )r`  s    r   r   0BaseTaskTests.test_cancel_gather_2.<locals>.test	  sM     D%nnW]]4-@?CE E E!8"Es   <AAAAc                     <"   SP                  SS! 4       4      p \        P                  ! R 4      G Rj  xL
  V P                  ! S!   V G Rj  xL
  R#  L  L5i)rX  Nr3  )qwer  rQ   r-   r   s    r   r  0BaseTaskTests.test_cancel_gather_2.<locals>.main	  sE     --df5C!--,,,JJ,II -r6  zWgather() does not propagate CancelledError raised by inner task to the gather() caller.r  )r  r   r   r   rI   r~   rH  r}   rm   r$   r(   )	r-   r  r  r  r%   r  r  rQ   r   s	   f     @@@r   test_cancel_gather_2"BaseTaskTests.test_cancel_gather_2r	  s    
 +0&K+66--/

+# ++DF3 IIG; 76 +0, -- $$SXX}=237F$$ //B + 766s6   =D
)B?D
D	3A
D	=D
D	D

Dc                ^   a a R  oVV 3R lpS P                   P                  V! 4       4       R# )c                      "   ^^ ,           R# 5irt  r   r   r   r   r   3BaseTaskTests.test_exception_traceback.<locals>.foo	  s     EEr  c                     <"   SP                  SP                  S! 4       4      p \        P                  ! ^ 4      G Rj  xL
  SP	                  V P                  4       P                  4       R#  L/5ir  )rW   rQ   r   r   r3  r   __traceback__)rq   r   r-   s    r   r  4BaseTaskTests.test_exception_traceback.<locals>.main	  sN     ==CE2D--"""  !1!?!?@ #s   ;A0A.0A0Nr  )r-   r  r   s   f @r   test_exception_traceback&BaseTaskTests.test_exception_traceback	  s$    		A
 			$$TV,r   c                   R  pW P                   n        R pV P                  VP                  P                  4       V P                  \        4      ;_uu_ 4        V! 4       p V P                  V P                   V4       VP                  4         RRR4       \        P                  ! 4        V P                  VP                  P                  4       VP                  P                  ^ ,          ^ ,          pV P                  RV4       V P                  V P                  V P                   4      \!        4       4       R#   TP                  4        i ; i  + '       g   i     L; i)c                     \         hr   rf  )r  r$   r  s   &*,r   r  8BaseTaskTests.test_error_in_call_soon.<locals>.call_soon	  s    r   c                     "   R # 5ir   r   r   r   r   rV   3BaseTaskTests.test_error_in_call_soon.<locals>.coro	  rw   r   Nz$Task was destroyed but it is pending)rQ   r  r  r  r  r|   r   rW   rI   r   r   r   	call_argsr  rm   rm  rs  )r-   r  r  rV   r&  rl  s   &&    r   test_error_in_call_soon%BaseTaskTests.test_error_in_call_soon	  s    	'			 	++,z**&Cdii-		 + 	

**+++''*1-<gF		2CE: 		 +*s$   E"D<>E<EEE!	c                `   V P                  \        R 4      ;_uu_ 4        V P                  V P                  ^{4       RRR4       V P                  \        R 4      ;_uu_ 4        V P                  V P                  ^{4       RRR4       R#   + '       g   i     LU; i  + '       g   i     R# ; i)z!a coroutine was expected, got 123N)r   r   rW   rQ   r,   s   &r   "test_create_task_with_noncoroutine0BaseTaskTests.test_create_task_with_noncoroutine	  s    ##I$GI IMM$))S)I ##I$GI IMM$))S)I II II I Is   B	"B	B	B-	c                h   R  pV P                  V P                  V! 4       4      pV P                  W P                  4       V P                  P	                  V4       V P                  V P                  V! 4       4      pV P                  W P                  4       V P                  P	                  V4       R# )c                     "   R # 5ir   r   r   r   r   rV   @BaseTaskTests.test_create_task_with_async_function.<locals>.coro	  rw   r   N)rW   rQ   ro   rU   r~   rg  s   &  r   $test_create_task_with_async_function2BaseTaskTests.test_create_task_with_async_function	  s    	 }}TYY/dII.		$$T* }}TYY/dII.		$$T*r   c                   V P                  V P                  \        4       4      pV P                  WP                  4       V P                  V P                  P                  V4      ^*4       V P                  V P                  \        4       4      pV P                  WP                  4       V P                  V P                  P                  V4      ^*4       R# r  )rW   rQ   r=   ro   rU   rm   r~   rp   s   & r   (test_create_task_with_asynclike_function6BaseTaskTests.test_create_task_with_asynclike_function	  s    }}TYY(89dII.55d;R@ }}TYY(89dII.55d;R@r   c                ^   a a R  oVV 3R lpS P                   P                  V! 4       4       R# )c                     "   ^# 5i)r  r   r   r   r   r   2BaseTaskTests.test_bare_create_task.<locals>.inner	  s     r   c                     <"   \         P                  ! S! 4       4      p SP                  V SP                  4       V G R j  xL
 pSP	                  ^V4       R #  L5ir   )r   r  ro   rU   rm   )rq   retr   r-   s     r   rV   1BaseTaskTests.test_bare_create_task.<locals>.coro	  sH     &&uw/D!!$		2*CQ$ s   =A AANr  rN  s   f @r   test_bare_create_task#BaseTaskTests.test_bare_create_task	  s#    		% 			$$TV,r   c                ^   a a R  oVV 3R lpS P                   P                  V! 4       4       R# )c                     "   R # 5ir   r   r   r   r   	coro_noop<BaseTaskTests.test_bare_create_named_task.<locals>.coro_noop	  rw   r   c                     <"   \         P                  ! S! 4       R R7      p SP                  V P                  4       R 4       V G Rj  xL
  R#  L5i)zNo-opr@  N)r   r  rm   rC  )rq   r  r-   s    r   rV   7BaseTaskTests.test_bare_create_named_task.<locals>.coro	  s7     &&y{ADT]]_g6JJs   AAAANr  )r-   rV   r  s   f @r   test_bare_create_named_task)BaseTaskTests.test_bare_create_named_task	  s#    		
 			$$TV,r   c                $  a aaa \         P                  ! R RR7      oVV 3R loVVV V3R lp\        P                  ! 4       o S P	                  SV! 4       4      pSP                  V4       SP                  4        R#   SP                  4        i ; i)cvarnopedefaultc                     <"   \         P                  ! R 4      G Rj  xL
  SP                  S P                  4       R4       S P	                  R4       R#  L75i)r  Nr  something else)r   r   rm   getrs  )r  r-   s   r   sub)BaseTaskTests.test_context_1.<locals>.sub
  s@     --%%%TXXZ0HH%& &s   AA8Ac                  8  <"   SP                  SP                  4       R 4       SP                  SS! 4       4      p SP                  R4       SP                  SP                  4       R4       V G Rj  xL
  SP                  SP                  4       R4       R#  L&5i)r  yesN)rm   r  rW   rs  )subtaskr  rQ   r-   r  s    r   r  *BaseTaskTests.test_context_1.<locals>.main	
  sq     TXXZ0mmD#%0GHHUOTXXZ/MMTXXZ/ s   A.B1B2'BN)contextvars
ContextVarr   r   rW   r~   rI   )r-   r  rq   r  rQ   r  s   f  @@@r   test_context_1BaseTaskTests.test_context_1
  sl    %%ff=	'
	0 	0 %%'	==tv.D##D)JJLDJJLs   (A= =Bc                R  a aa \         P                  ! R RR7      oVVV 3R lp\        P                  ! 4       o S P	                  SV! 4       4      pSP                  V4       SP                  4        S P                  SP                  4       R4       R#   SP                  4        i ; i)r  r  r  c            	      `  <"   V3R  lp SP                  SP                  4       R4       \        ^4       F  pSP                  S4      pVP	                  V 4       SP                  RV 24       SP                  VP                  R4       VG Rj  xL
  SP                  SP                  4       RV 24       \        ^4       F^  pSP                  RV RV 24       \        P                  ! R4      G Rj  xL
  SP                  SP                  4       RV RV 24       K`  	  K  	  R#  L L65i)c                 *   < SP                  R 4       R# )r  N)rs  )r   r  s   &r   fut_on_done?BaseTaskTests.test_context_2.<locals>.main.<locals>.fut_on_done
  s     )*r   r  r  N-MbP?)
rm   r  r   r^   r!  rs  r  r   r   r   )r  jr   r  r  rQ   r-   s       r   r  *BaseTaskTests.test_context_2.<locals>.main
  s     +
 TXXZ01Xood+%%k23qc#s~~t4		  s1#Y7qAHHs1#Qqc]+!--...$$TXXZ3qc1#?	 " 
  /s%   BD.D*A%D.5D,65D.,D.N)	r  r  r   r   rW   r~   rI   rm   r  )r-   r  rq   r  rQ   s   f  @@r   test_context_2BaseTaskTests.test_context_2
  s|    %%ff=	@, %%'	==tv.D##D)JJLV, JJLs   (B B&c                <  a aaa \         P                  ! R RR7      oVV 3R loVV3R lp\        P                  ! 4       o SP	                  V! 4       4       SP                  4        S P                  SP                  4       R4       R#   SP                  4        i ; i)r  r  c                   <"   \        ^
4       Fs  pSP                  W,           4       \        P                  ! \        P
                  ! RR4      4      G Rj  xL
  SP                  SP                  4       W,           4       Ku  	  R#  L05i)r  r  rG  N)r   rs  r   r   randomuniformrm   r  )numr  r  r-   s   & r   r  )BaseTaskTests.test_context_3.<locals>.sub?
  sZ     2Y!mmFNN5$$?@@@  SW5 @s   AB
B1B
c            	         <"   . p \        ^d4       FA  pSP                  S! \        P                  ! ^ ^
4      4      4      pV P                  ! V4       KC  	  \
        P                  ! V !  G Rj  xL
  R#  L5ir  )r   r  r  randintr  r   r   )r   r  rq   rQ   r  s      r   r  *BaseTaskTests.test_context_3.<locals>.mainE
  sY     E3Z''FNN1b,A(BCT"   ..%(((s   A*A6-A4.A6Nr   )r  r  r   r   r~   rI   rm   r  )r-   r  r  rQ   r  s   f @@@r   test_context_3BaseTaskTests.test_context_3:
  sr     %%fb9	6	) %%'	##DF+JJLR( JJLs   B	 	Bc                F  a aaa \         P                  ! R 4      oV3R loVVVV 3R lp\        P                  ! 4       o S P	                  SV! 4       4      pSP                  V4      pSP                  4        S P                  . ROV4       R#   SP                  4        i ; i)r  c                 r   <"   \         P                  ! ^ 4      G Rj  xL
  SP                  V 4       R#  L5ir  r   r   rs  valr  s   &r   rV   *BaseTaskTests.test_context_4.<locals>.coroX
  (     --"""HHSM #   757c                    <"   . p \         P                  ! 4       pV P                  VP                  S4      4       SP	                  SS! ^4      VR7      pVG Rj  xL
  V P                  VP                  S4      4       SP	                  SS! ^4      VR7      pVG Rj  xL
  V P                  VP                  S4      4       V #  Lj L(5ir  r'   N)r  copy_contextr  r  rW   )r  ctxr7  r8  rV   r  rQ   r-   s       r   r  *BaseTaskTests.test_context_4.<locals>.main\
  s     C**,CJJswwt}%tT!Wc:BHHJJswwt}%tT!Wc:BHHJJswwt}%J  s%   AC	CAC	C'C	C	NNr  r  r  r  r   r   rW   r~   rI   rm   r-   r  rq   r  rV   r  rQ   s   f   @@@r   test_context_4BaseTaskTests.test_context_4U
  s    %%f-	
	 
	 %%'	==tv.D))$/CJJLs+ JJLs    (B B c                <  aa \         P                  ! R 4      oV3R loVV3R lp\        P                  ! 4       p V P	                  W!! 4       4      pVP                  V4      pVP                  4        V P                  . ROV4       R#   TP                  4        i ; i)r  c                 r   <"   \         P                  ! ^ 4      G Rj  xL
  SP                  V 4       R#  L5ir  r   r  s   &r   rV   *BaseTaskTests.test_context_5.<locals>.corot
  r  r  c                    <"   . p \         P                  ! 4       pV P                  VP                  S4      4       \        P
                  ! S! ^4      VR7      pVG Rj  xL
  V P                  VP                  S4      4       \        P
                  ! S! ^4      VR7      pVG Rj  xL
  V P                  VP                  S4      4       V #  Ln L(5ir  )r  r	  r  r  r   r  )r  r
  r7  r8  rV   r  s       r   r  *BaseTaskTests.test_context_5.<locals>.mainx
  s     C**,CJJswwt}%$$T!Wc:BHHJJswwt}%$$T!Wc:BHHJJswwt}%J  s%   ACCAC&C''CCNr  r  )r-   r  rQ   rq   r  rV   r  s   &    @@r   test_context_5BaseTaskTests.test_context_5q
  sz    %%f-	
	 %%'	==tv.D))$/CJJLs+ JJLs   'B	 	Bc                @  aaa \         P                  ! R 4      oV3R loVVV3R lp\        P                  ! 4       o SP	                  V! 4       4      pSP                  V4      pSP                  4        V P                  . ROV4       R#   SP                  4        i ; i)r  c                 r   <"   \         P                  ! ^ 4      G Rj  xL
  SP                  V 4       R#  L5ir  r   r  s   &r   rV   *BaseTaskTests.test_context_6.<locals>.coro
  r  r  c                    <"   . p \         P                  ! 4       pV P                  VP                  S4      4       SP	                  S! ^4      VR7      pVG Rj  xL
  V P                  VP                  S4      4       SP	                  S! ^4      VR7      pVG Rj  xL
  V P                  VP                  S4      4       V #  Li L(5ir  )r  r	  r  r  r  )r  r
  r7  r8  rV   r  rQ   s       r   r  *BaseTaskTests.test_context_6.<locals>.main
  s     C**,CJJswwt}%!!$q'3!7BHHJJswwt}%!!$q'3!7BHHJJswwt}%J  s%   ACCACC'CCNr  )r  r  r   r   r  r~   rI   rm   r  s   &   @@@r   test_context_6BaseTaskTests.test_context_6
  sz    %%f-	
	 %%'	##DF+D))$/CJJLs+ JJLs   'B Bc                .   a aa R oVV 3R loVVV 3R lpR # )Nc                  L   <"   SP                  4       P                  4       o R # 5ir   r  rC  rR   r-   s   r   asyncfn4BaseTaskTests.test_eager_start_true.<locals>.asyncfn
       $$&//1D   !$c                     <"   SP                  S! 4       \        P                  ! 4       R RR7      p SP                  V P	                  4       4       SP                  SR4       V G Rj  xL
  R#  L5i)TexamplerV   rQ   rS   rR   N)rW   r   get_running_loopr   r   rm   r   r#  rR   r-   s    r   r  1BaseTaskTests.test_eager_start_true.<locals>.main
  sR     7973K3K3M[_fopAOOAFFH%T9-GGs   A$A0'A.(A0r   r-   r  r#  rR   s   f @@r   test_eager_start_true#BaseTaskTests.test_eager_start_true
  s    	2	 	r   c                   a aa R oVV 3R loVVV 3R lp\         P                  ! V! 4       \         P                  R7       R # )Nc                  L   <"   SP                  4       P                  4       o R # 5ir   r!  r"  s   r   r#  5BaseTaskTests.test_eager_start_false.<locals>.asyncfn
  r%  r&  c                    <"   SP                  S! 4       \        P                  ! 4       R RR7      p SP                  V P	                  4       4       SP                  S4       V G Rj  xL
  SP                  SR4       R#  L5i)Fr(  r)  N)rW   r   r*  r  r   r  rm   r+  s    r   r  2BaseTaskTests.test_eager_start_false.<locals>.main
  sg     7973K3K3M[`gpqAQVVX&d#GGT9- s   A#B&A?'B)loop_factory)r   r   	EventLoopr-  s   f @@r   test_eager_start_false$BaseTaskTests.test_eager_start_false
  s*    	2	. 	DF):):;r   c                   \         P                  ! 4       p\        4       p V P                  W4      pVP	                  V4       V P                  VP                  4       V4       VP                  4        R #   TP                  4        i ; ir   )r   r   r   rW   r~   r   r   rI   )r-   rQ   rV   rq   s   &   r   test_get_coroBaseTaskTests.test_get_coro
  s`    %%'!#	==,D##D)MM$--/40JJLDJJLs   AA5 5Bc                B   \         P                  ! 4       p\        4       p\        P                  ! 4       p V P                  WVR 7      pVP                  V4       V P                  VP                  4       V4       VP                  4        R#   TP                  4        i ; i)r  N)
r   r   r   r  r	  rW   r~   r   get_contextrI   )r-   rQ   rV   r'   rq   s   &    r   test_get_contextBaseTaskTests.test_get_context
  su    %%'!#**,	==W==D##D)MM$**,g6JJLDJJLs   AB Bc                    ! R  R4      p\        4       p\        P                  ! V4      p\        4       p\        P
                  ! \        P                  ! 4       4      ;_uu_ 4       p\        P                  P                  \        P                  4      p\        ^4       FB  pV P                  \        R4      ;_uu_ 4        VP                  WEW!! 4       R7       RRR4       KD  	  VP                  4        RVn        ?V P!                  \        P                  ! V4      V4       RRR4       R#   + '       g   i     K  ; i  + '       g   i     R# ; i)c                   &   a  ] tR tRt o R tRtV tR# )2BaseTaskTests.test_proper_refcounts.<locals>.Breaki
  c                    \        R 4      h)breakr:  r,   s   &r   __str__:BaseTaskTests.test_proper_refcounts.<locals>.Break.__str__
  s    "7++r   r   N)r4   r5   r6   r7   rE  r8   r9   r:   s   @r   BreakrB  
  s     , ,r   rG  rD  )rQ   r'   rR   NF)r  r  getrefcountr   r  r  r   r6  rU   __new__r   r   r   r   rI   r~  rm   )r-   rG  objinitial_refcountrV   rQ   rq   r   s   &       r   test_proper_refcounts#BaseTaskTests.test_proper_refcounts
  s    	, 	, h??3/!# 1 1 344<<''5D1X++L'BBMM$3UWMM CB  JJL(-D%S__S13CD 54 CBB 544s&   &AE D-A
E-D>8	EE	r[   )TestTaskNN)r4   r5   r6   r7   rU   r\   rm  rW   r^   re   rr   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r(  r;  rF  rK  rT  rb  rp  rz  r  r  r  r  r  r  r  r  r  r  r  r
  r  r  r#  r)  r7  r=  rL  rT  ra  rh  rx  r  r  r  r  r  r  r  r  r  r  r  r  r  r&  r3  rC  rO  r]  ri  rn  rv  r  r  r  r  r  r  r  r  r	   r  r  r  r  r  r  r  r  r  r  r!  r%  r,  r2  r5  r8  r@  rF  rI  rO  rV  r[  rb  re  rs  r  r   patchr  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r.  r7  r:  r>  rL  r8   r9   r  r  s   @@r   rO   rO   V   s    DFIi0E2
=A	/"+>!*!*- (/81Sf)$
((+@ :+@0(TgR0%* @D @D38:0%''((.(<%(%&")HO666:!NF+":J6:&06:6<2@686622(..`(6T.>`0-A^(<0B16	(1,'+818)""&<2@ 01G 2G" 01
& 2
&'==6,>#4".+V
)
** "#02*""	"
":'@R( 
ZZ,-- .- 
+5@)V- 
ZZ,-; .;0	*+	A-
-. -D)6,8,8,8< 	E Er   rO   c                     V P                   pV P                  pVe   Vf   V #  ! R R4      p ! R RW14      p ! R RW24      pR pW@n         WPn        W`n        R V n        V # )Nc                   >   a a ] tR tRt oV 3R ltV 3R ltRtVtV ;t# )(add_subclass_tests.<locals>.CommonFuturei
  c                `   < \         P                  ! R  4      V n        \        SV `  ! V/ VB  R# )c                      ^ # )r   r   r   r   r   rb   Cadd_subclass_tests.<locals>.CommonFuture.__init__.<locals>.<lambda>
  s    r   N)collectionsdefaultdictcallsrd   r   r  s   &*,r   r   1add_subclass_tests.<locals>.CommonFuture.__init__
  s'    $00;DJGd-f-r   c                b   < V P                   R ;;,          ^,          uu&   \        SV `  ! V/ VB # )r!  )rX  rd   r!  r  s   &*,r   r!  :add_subclass_tests.<locals>.CommonFuture.add_done_callback
  s-    JJ*+q0+7,d=f==r   )rX  r  r  s   @@r   CommonFuturerR  
  s     	.	> 	>r   r\  c                       ] tR tRtRtR# ) add_subclass_tests.<locals>.Taski  r   Nr4   r5   r6   r7   r8   r   r   r   rU   r^        r   rU   c                       ] tR tRtRtR# )"add_subclass_tests.<locals>.Futurei  r   Nr_  r   r   r   r\   rb    r`  r   r\   c                   a a S P                  S P                  R 7      oVV 3R lpS P                  V! 4       S P                  R 7      pS P                  P                  V4      pS P	                  VR4       S P	                  \        VP                  4      R^/4       S P	                  \        SP                  4      R^/4       R# )r[   c                  b   <"   SP                   P                  V 3R  l4       S G Rj  xL
 #  L5i)c                  &   < S P                  R 4      # )r  r  r   s   r   rb   Yadd_subclass_tests.<locals>.test_subclasses_ctask_cfuture.<locals>.func.<locals>.<lambda>  s    v(>r   N)rQ   r  )r   r-   s   r   r  Gadd_subclass_tests.<locals>.test_subclasses_ctask_cfuture.<locals>.func  s#     II >?99s   %/-/r  r!  N)r\   rQ   rU   r~   rm   dictrX  )r-   r  rq   r   r   s   f   @r   test_subclasses_ctask_cfuture9add_subclass_tests.<locals>.test_subclasses_ctask_cfuture  s    kktyyk)	 yydiiy0--d3( !$	& 	O !$	&r   )rU   r\   ri  r  )clsBaseTask
BaseFuturer\  rU   r\   ri  s   &      r   add_subclass_testsrn  
  so    xxHJ:-
> >|  &, HJ )F%
 &*C"Jr   c                   ,   a  ] tR tRt o R tR tRtV tR# )SetMethodsTesti,  c                @   \        V 4      P                  p\        P                  ! 4       ;V P                  n        pR  pV! 4       pV P                  V P                  V4      pVP                  VR4       V P                  V P                  P                  V4      R4       VP                  4        VP                  ^ ,          ^ ,          R,          pV P                  \        P                  R4      ;_uu_ 4        Vh  + '       g   i     M; iTP                  4        R# )c                  N   "   \         P                  ! R 4      G Rj  xL
  ^
#  L5ir  Nr  r   r   r   r   @SetMethodsTest.test_set_result_causes_invalid_state.<locals>.foo2       --$$$ %r  r  r   step\(\): already doneN)r#   r\   r   r  rQ   call_exception_handlerrW   r   rm   r~   r1  r  r   r   InvalidStateErrorrI   )r-   r\   exc_handlerr   rV   rq   r%   s   &      r   $test_set_result_causes_invalid_state3SetMethodsTest.test_set_result_causes_invalid_state.  s    d""9=D		(;	 u}}TYY-$'II((.	 	&&(##A&q)+6##G$=$=$=? ?I? ? 	

s   8C;;D	c                    ! R  R\         4      p\        V 4      P                  p\        P                  ! 4       ;V P
                  n        pR pV! 4       pV P                  V P
                  V4      pVP                  Wa! 4       4       V P                  V4      ;_uu_ 4        V P
                  P                  V4       RRR4       VP                  4        VP                  ^ ,          ^ ,          R,          pV P                  \        P                  R4      ;_uu_ 4        Vh  + '       g   i     Ll; i  + '       g   i     M; iTP!                  4        R# )c                       ] tR tRtRtR# )ESetMethodsTest.test_set_exception_causes_invalid_state.<locals>.MyExciG  r   Nr_  r   r   r   MyExcr~  G  s    r   r  c                  N   "   \         P                  ! R 4      G Rj  xL
  ^
#  L5irs  r  r   r   r   r   CSetMethodsTest.test_set_exception_causes_invalid_state.<locals>.fooM  ru  r  Nr   rv  )rm  r#   r\   r   r  rQ   rw  rW   r  r|   r~   r1  r  r   r   rx  rI   )r-   r  r\   ry  r   rV   rq   r%   s   &       r   'test_set_exception_causes_invalid_state6SetMethodsTest.test_set_exception_causes_invalid_stateF  s    	I 	 d""9=D		(;	 u}}TYY-T57+u%%II((. & 	&&(##A&q)+6##G$=$=$=? ?I &%
? ? 	

s    D D3 D0	3E	r   N)r4   r5   r6   r7   rz  r  r8   r9   r:   s   @r   rp  rp  ,  s     0 r   rp  _CFuture_CTaskzrequires the C _asyncio modulec                      a  ] tR tRt o ]! ]RR4      t]! ]RR4      t]! ]RR4      t	]
! ]! ]RR4      4      t]P                  R 4       tR tR	tV tR# )
CTask_CFuture_Testsia  r  Nr  _c_all_tasks_c_current_taskc                   \         P                  ! \        R 4      pR pV P                  V P                  V! 4       4      pV P                  P                  V4       V! 4       p\        ^d4       F@  pVP                  V! 4       V P                  R7       V P                  P                  V4       KB  	  V P                  V! 4       V,
          ^ ^
R7       R# )gettotalrefcountc                     "   R # 5ir   r   r   r   r   rV   @CTask_CFuture_Tests.test_refleaks_in_task___init__.<locals>.coroo  rw   r   r[   )deltaN)	r   get_attributer  rW   rQ   r~   r   r   r  )r-   r  rV   rq   refs_beforer  s   &     r   test_refleaks_in_task___init__2CTask_CFuture_Tests.test_refleaks_in_task___init__l  s    "006HI	}}TYY/		$$T*&(sAMM$&tyyM1II((.  	/1K?"Mr   c                    R  pV P                  V P                  V! 4       4      pV P                  P                  V4       V P                  \        4      ;_uu_ 4        V=RRR4       R#   + '       g   i     R# ; i)c                     "   R # 5ir   r   r   r   r   rV   HCTask_CFuture_Tests.test_del__log_destroy_pending_segfault.<locals>.coroz  rw   r   N)rW   rQ   r~   r|   AttributeErrorr~  rg  s   &  r   &test_del__log_destroy_pending_segfault:CTask_CFuture_Tests.test_del__log_destroy_pending_segfaulty  sU    	}}TYY/		$$T*~..) /...s   A**A;	r   )r4   r5   r6   r7   getattrr   rU   r   r\   rm  staticmethodr  r   refcount_testr  r  r8   r9   r:   s   @r   r  r  a  si      5(D)DWj$/F~t4I/@$ GHL
N 
N* *r   r  c                   r    ] tR tRt]! ]RR4      t]! ]RR4      t]! ]RR4      t	]
! ]! ]RR4      4      tRtR# )CTask_CFuture_SubclassTestsi  r  Nr  r  r  r   )r4   r5   r6   r7   r  r   rU   r   r\   rm  r  r  r8   r   r   r   r  r    sB     5(D)DWj$/F~t4I/@$ GHLr   r  c                   v    ] tR tRt]! ]RR4      t]P                  t	]! ]RR4      t
]! ]! ]RR4      4      tRtR# )CTaskSubclass_PyFuture_Testsi  r  Nr  r  r   r4   r5   r6   r7   r  r   rU   r   	_PyFuturer\   rm  r  r  r8   r   r   r   r  r    s?    
 5(D)DF~t4I/@$ GHLr   r  c                       ] tR tRt]! ]RR4      t]P                  t	]
! ]P                  4      t]
! ]P                  4      tRtR# )PyTask_CFutureSubclass_Testsi  r  Nr   )r4   r5   r6   r7   r  r   r\   r   _PyTaskrU   r  _py_all_tasksrm  _py_current_taskr  r8   r   r   r   r  r    s;    
 Wj$/F==DU001I 6 67Lr   r  c                   v    ] tR tRt]! ]RR4      t]P                  t	]! ]RR4      t
]! ]! ]RR4      4      tRtR# )CTask_PyFuture_Testsi  r  Nr  r  r   r  r   r   r   r  r    s?     5(D)DF~t4I/@$ GHLr   r  c                       ] tR tRt]P
                  t]! ]RR4      t	]
! ]P                  4      t]
! ]P                  4      tRtR# )PyTask_CFuture_Testsi  r  Nr   )r4   r5   r6   r7   r   r  rU   r  r   r\   r  r  rm  r  r  r8   r   r   r   r  r    s;     ==DWj$/FU001I 6 67Lr   r  c                       ] tR tRt]P
                  t]P                  t	]
! ]P                  4      t]
! ]P                  4      tRtR# )PyTask_PyFuture_Testsi  r   Nr4   r5   r6   r7   r   r  rU   r   r  r\   r  r  rm  r  r  r8   r   r   r   r  r    s8     ==DFU001I 6 67Lr   r  c                       ] tR tRt]P
                  t]P                  t	]
! ]P                  4      t]
! ]P                  4      tRtR# )PyTask_PyFuture_SubclassTestsi  r   Nr  r   r   r   r  r    s6    ==DFU001I 6 67Lr   r  c                   &   a  ] tR tRt o R tRtV tR# )CTask_Future_Testsi  c                  a  ! R  R\         P                  4      pV3R lp\         P                  ! 4       V n         V! V P                  R7      oV P                  P	                  RSP
                  ^4       V P                  P                  V! 4       4      pV P                  P                  V4      pV P                  P                  4        V P                  VR4       R#   T P                  P                  4        i ; i)c                   0   a  ] tR tRt o ]R 4       tRtV tR# )+CTask_Future_Tests.test_foobar.<locals>.Futi  c                    \         hr   )r  r,   s   &r   r   4CTask_Future_Tests.test_foobar.<locals>.Fut.get_loop  s    $$r   r   N)r4   r5   r6   r7   propertyr   r8   r9   r:   s   @r   r  r    s     % %r   r  c                  (   <"   S G R j  xL
  R#  L5i)Nr  r   r   s   r   rV   ,CTask_Future_Tests.test_foobar.<locals>.coro  s     II r   r[   r  r  N)
r   r\   r   rQ   r  r   r  r~   rI   rm   )r-   r  rV   rq   r  r   s   &    @r   test_foobarCTask_Future_Tests.test_foobar  s    	%'.. 	%
	 **,		499%CII  cnna899((0D))..t4CIIOOf% IIOOs   A5C C;r[   N)r4   r5   r6   r7   r  r8   r9   r:   s   @r   r  r    s     & &r   r  c                   p   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V tR# )BaseTaskIntrospectionTestsi  Nc                4  a  ! V3R  lR4      pV! 4       p\         P                  ! 4       oV P                  V P                  S4      \	        4       4       V P                  V4       V P                  V P                  S4      V04       V P                  V4       R# )c                   >   <a  ] tR tRt o ]V3R l4       tR tRtV tR# )BBaseTaskIntrospectionTests.test__register_task_1.<locals>.TaskLikei  c                   < S# r   r   r]   s   &r   r   HBaseTaskIntrospectionTests.test__register_task_1.<locals>.TaskLike._loop  s    r   c                    R # Fr   r,   s   &r   r   GBaseTaskIntrospectionTests.test__register_task_1.<locals>.TaskLike.done      r   r   N)	r4   r5   r6   r7   r  r   r   r8   r9   r;   rQ   s   @r   TaskLiker    s!       r   r  Nr   r  rm   rm  rs  _register_task_unregister_taskr-   r  rq   rQ   s   &  @r   test__register_task_10BaseTaskIntrospectionTests.test__register_task_1  ss    	 	 zyy{-su5D!-v6d#r   c                4  a  ! V3R  lR4      pV! 4       p\         P                  ! 4       oV P                  V P                  S4      \	        4       4       V P                  V4       V P                  V P                  S4      V04       V P                  V4       R# )c                   4   <a  ] tR tRt o V3R ltR tRtV tR# )BBaseTaskIntrospectionTests.test__register_task_2.<locals>.TaskLikei  c                   < S# r   r   r]   s   &r   r   KBaseTaskIntrospectionTests.test__register_task_2.<locals>.TaskLike.get_loop      r   c                    R # r  r   r,   s   &r   r   GBaseTaskIntrospectionTests.test__register_task_2.<locals>.TaskLike.done  r  r   r   Nr4   r5   r6   r7   r   r   r8   r9   r  s   @r   r  r    s      r   r  Nr  r  s   &  @r   test__register_task_20BaseTaskIntrospectionTests.test__register_task_2  ss    	 	 zyy{-su5D!-v6d#r   c                B  a  ! V3R  lR4      pV! 4       p\         P                  ! 4       oV P                  V P                  S4      \	        4       4       V P                  V4       V P                  V P                  S4      \	        4       4       V P                  V4       R# )c                   4   <a  ] tR tRt o V3R ltR tRtV tR# )BBaseTaskIntrospectionTests.test__register_task_3.<locals>.TaskLikei  c                   < S# r   r   r]   s   &r   r   KBaseTaskIntrospectionTests.test__register_task_3.<locals>.TaskLike.get_loop  r  r   c                    R # )Tr   r,   s   &r   r   GBaseTaskIntrospectionTests.test__register_task_3.<locals>.TaskLike.done  s    r   r   Nr  r  s   @r   r  r    s      r   r  Nr  r  s   &  @r   test__register_task_30BaseTaskIntrospectionTests.test__register_task_3
  ss    	 	 zyy{-su5D!-su5d#r   c                x   \         P                  ! 4       p\         P                  ! 4       p\        P                  ! V4       V P	                  V P                  V4      4       V P                  W!4       V P                  V P                  V4      V4       V P                  W!4       \        P                  ! R 4       R # r   )	r   r  r   _set_running_loopr  r  _enter_taskr   _leave_taskr-   rq   rQ   s   &  r   test__enter_task+BaseTaskIntrospectionTests.test__enter_task  s    yy{yy{ 	!!$'$++D12$d''-t4$!!$'r   c                   \         P                  ! 4       p\         P                  ! 4       p\         P                  ! 4       p\        P                  ! V4       V P	                  W14       V P                  \        4      ;_uu_ 4        V P	                  W24       R R R 4       V P                  V P                  V4      V4       V P                  W14       \        P                  ! R 4       R #   + '       g   i     LZ; ir   )
r   r  r   r  r  r|   r   r   r  r  r-   r  r  rQ   s   &   r   test__enter_task_failure3BaseTaskIntrospectionTests.test__enter_task_failure'  s    				yy{!!$'%|,,T) -d''-u5%!!$'	 -,   C((C8	c                6   \         P                  ! 4       p\         P                  ! 4       p\        P                  ! V4       V P	                  W!4       V P                  W!4       V P                  V P                  V4      4       \        P                  ! R 4       R # r   )r   r  r   r  r  r  r  r  r  s   &  r   test__leave_task+BaseTaskIntrospectionTests.test__leave_task3  si    yy{yy{!!$'$$$++D12!!$'r   c                   \         P                  ! 4       p\         P                  ! 4       p\         P                  ! 4       p\        P                  ! V4       V P	                  W14       V P                  \        4      ;_uu_ 4        V P                  W24       R R R 4       V P                  V P                  V4      V4       V P                  W14       \        P                  ! R 4       R #   + '       g   i     LZ; ir   )
r   r  r   r  r  r|   r   r  r   r  r  s   &   r   test__leave_task_failure14BaseTaskIntrospectionTests.test__leave_task_failure1<  s    				yy{ 	!!$'%|,,T) -d''-u5%!!$'	 -,r  c                   \         P                  ! 4       p\         P                  ! 4       p\        P                  ! V4       V P	                  \
        4      ;_uu_ 4        V P                  W!4       R R R 4       V P                  V P                  V4      4       \        P                  ! R 4       R #   + '       g   i     LH; ir   )	r   r  r   r  r|   r   r  r  r  r  s   &  r   test__leave_task_failure24BaseTaskIntrospectionTests.test__leave_task_failure2K  sz    yy{yy{!!$'|,,T( -$++D12!!$' -,s   B00C 	c                  a \         P                  ! 4       p\         P                  ! 4       oV3R  lVn        V P                  V4       V P	                  V4       V P                  V P                  S4      \        4       4       R# )c                     < S # r   r   r[   s   r   rb   BBaseTaskIntrospectionTests.test__unregister_task.<locals>.<lambda>W  s    r   N)r   r  r   r  r  rm   rm  rs  r  s   & @r   test__unregister_task0BaseTaskIntrospectionTests.test__unregister_taskT  sW    yy{yy{$D!d#-su5r   c                    \         P                  ! 4       p\         P                  ! 4       pV P                  V4       V P                  V P	                  V4      \        4       4       R # r   )r   r  r  rm   rm  rs  r  s   &  r   $test__unregister_task_not_registered?BaseTaskIntrospectionTests.test__unregister_task_not_registered\  sA    yy{yy{d#-su5r   r   )r4   r5   r6   r7   r  r  r  r  rm  r  r  r  r  r  r  r  r  r  r  r8   r9   r:   s   @r   r  r    sV     NKKI$"$ $ (
((((66 6r   r  c                       ] tR tRt]! ]P                  4      t]! ]P                  4      t	]! ]P                  4      t]! ]P                  4      t]! ]P                  4      t]! ]P                   4      tRtR# )PyIntrospectionTestsic  r   N)r4   r5   r6   r7   r  r   _py_register_taskr  _py_unregister_taskr  _py_enter_taskr  _py_leave_taskr  r  rm  r  r  r8   r   r   r   r  r  c  sc    !%"9"9:N#E$=$=>u334Ku334KU001I 6 67Lr   r  _c_register_taskc                   $   ] tR tRt]! ]R4      '       dq   ]! ]P                  4      t]! ]P                  4      t
]! ]P                  4      t]! ]P                  4      t]! ]P                  4      t]! ]P"                  4      tRtR# R;t;t
;ttRtR# )CIntrospectionTestsil  r  Nr   )r4   r5   r6   r7   hasattrr   r  r  r  _c_unregister_taskr  _c_enter_taskr  _c_leave_taskr  r  rm  r  r  r8   r   r   r   r  r  l  s     u())%e&<&<='(@(@A"5#6#67"5#6#67 !3!34	#E$9$9:HLLL)LK+r   r  c                   N   a a ] tR tRt oRtV 3R ltR tR tR tR t	Rt
VtV ;t# )	BaseCurrentLoopTestsiz  Nc                   < \         SV `  4        \        P                  ! 4       V n        V P                  V P                  4       R # r   rd   re   r   r   rQ   r   ri   s   &r   re   BaseCurrentLoopTests.setUp}  .    **,	DII&r   c                    \         hr   )NotImplementedErrorr   s   &&r   rW   BaseCurrentLoopTests.new_task  s    !!r   c                \    V P                  V P                  V P                  R 7      4       R# r  )r  r  rQ   r,   s   &r   !test_current_task_no_running_loop6BaseCurrentLoopTests.test_current_task_no_running_loop  s"    $+++;<r   c                    V P                  \        R 4      ;_uu_ 4        V P                  4        RRR4       R#   + '       g   i     R# ; i)zno running event loopN)r   r   r  r,   s   &r   *test_current_task_no_running_loop_implicit?BaseCurrentLoopTests.test_current_task_no_running_loop_implicit  s2    ##L2IJJ KJJJs	   :A	c                   a a V V3R  lpS P                  V! 4       4      oS P                  P                  S4       S P                  S P	                  S P                  R7      4       R# )c                     <"   S P                  S P                  S P                  R 7      S4       S P                  S P                  R4      S4       S P                  S P                  4       S4       R# 5ir  )r   r  rQ   rp   s   r   rV   GBaseCurrentLoopTests.test_current_task_with_implicit_loop.<locals>.coro  sV     MM$+++;TBMM$++D148MM$++-t4s   A0A3r[   N)rW   rQ   r~   r  r  rg  s   f @r   $test_current_task_with_implicit_loop9BaseCurrentLoopTests.test_current_task_with_implicit_loop  sL    	5 }}TV$		$$T*$+++;<r   r[   )r4   r5   r6   r7   r  re   rW   r  r  r  r8   r9   r  r  s   @@r   r  r  z  s(     L'
"= 	= 	=r   r  c                   J   a  ] tR tRt o ]! ]P                  4      tR tRt	V t
R# )PyCurrentLoopTestsi  c                D    \         P                  ! WP                  R 7      # rZ   )r   r  rQ   r   s   &&r   rW   PyCurrentLoopTests.new_task  s    }}T		22r   r   N)r4   r5   r6   r7   r  r   r  r  rW   r8   r9   r:   s   @r   r"  r"    s      6 67L3 3r   r"  r  c                   n   a  ] tR tRt o ]! ]R4      '       d   ]! ]P                  4      tMRtR t	Rt
V tR# )CCurrentLoopTestsi  r  Nc                D    \        \        R 4      ! WP                  R7      # )r  r[   )r  r   rQ   r   s   &&r   rW   CCurrentLoopTests.new_task  s    uh'99==r   r   )r4   r5   r6   r7   r	  r   r  r  r  rW   r8   r9   r:   s   @r   r&  r&    s4      u'((#E$9$9:> >r   r&  c                   J   a  ] tR tRt o R t]P                  R 4       tRtV t	R# )GenericTaskTestsi  c                b    V P                  \        P                  \        P                  4       R # r   )assertIsSubclassr   rU   r\   r,   s   &r   test_future_subclass%GenericTaskTests.test_future_subclass  s    gllGNN;r   c                     ^ RI p^ RIp^ RIp ^ RIpR#   \         d    T P                  R4        R# i ; i  \         d    T P                  R4        R# i ; i)r   Nz_asyncio module is missingzC modules are not available)
_functools_json_pickle_asyncioImportErrorrH  skipTest)r-   r0  r1  r2  r3  s   &    r   test_asyncio_module_compiled-GenericTaskTests.test_asyncio_module_compiled  sQ    
	88 8		678  	9MM78	9s   8  55AAr   N)
r4   r5   r6   r7   r-  r   cpython_onlyr6  r8   r9   r:   s   @r   r*  r*    s$     < 8 8r   r*  c                   \   a a ] tR tRt oV 3R ltR tR tR tR tR t	R t
R	 tR
tVtV ;t# )GatherTestsBasei  c                   < \         SV `  4        V P                  4       V n        V P                  4       V n        V P                  V P                  R R7       R# )F)cleanupN)rd   re   rf   one_loopr   r   ri   s   &r   re   GatherTestsBase.setUp  sC    **,,,.DMM59r   c                Z    VP                   '       d   \        P                  ! V4       K*  R # r   )rn  r  rR  r]   s   &&r   	_run_loopGatherTestsBase._run_loop  s    kkk""4( r   c                   \        ^4       Uu. uF  q P                  P                  4       NK  	  upw  r4pV P                  ! V P	                  W4V4      / VB p\
        P                  ! 4       pVP                  V4       VP                  ^4       VP                  ^4       V P                  V P                  4       V P                  VP                  R4       V P                  VP                  4       4       VP                  ^4       V P                  V P                  4       VP                  V4       V P                  VP                  4       . RO4       R# u upi )rk  FN)r  r  rk  )r   r=  rh   _gatherwrap_futuresr  MockCallbackr!  r   r@  rm   r  r  r   assert_called_once_withr   )r-   r  r  r   rX  r  r   cbs   &,      r   _check_successGatherTestsBase._check_success  s    :?(C(Q==..0(CallD--aA6A&A$$&b!	Q	Qt}}%E*$	Qt}}%
""3'y1 Ds   "Ec                J    V P                  4        V P                  R R7       R# )Fr  NrH  r,   s   &r   test_successGatherTestsBase.test_success  s    e4r   c                *    V P                  R R7       R# )Tr  NrK  r,   s   &r   test_result_exception_success-GatherTestsBase.test_result_exception_success  s    d3r   c           	        \        ^4       Uu. uF  qP                  P                  4       NK  	  upw  r#rEpV P                  ! V P	                  W#WEV4      !  p\
        P                  ! 4       pVP                  V4       \        4       p	VP                  ^4       VP                  V	4       V P                  V P                  4       V P                  VP                  4       4       VP                  V4       V P                  VP!                  4       V	4       VP                  ^4       VP#                  4        VP                  \%        4       4       VP!                  4        R# u upi r  N)r   r=  rh   rC  rD  r  rE  r!  r  r   r  r@  r   r   rF  r   r   r{   r   )
r-   r  r   rX  r  r  er   rG  r%   s
   &         r   test_one_exception"GatherTestsBase.test_one_exception  s    @EaI1446IaAllD--aA!<=$$&b!!	Q	t}}%
#
""3'cmmos+	Q	
	'	 Js   "E!c                
   \        ^4       Uu. uF  qP                  P                  4       NK  	  upw  r#rEV P                  ! V P	                  W#WE4      RR/ p\
        P                  ! 4       pVP                  V4       \        4       p\        4       p	VP                  ^4       VP                  V4       VP                  ^4       V P                  V P                  4       V P                  VP                  4       4       VP                  V	4       V P                  V P                  4       V P                  VP                  4       4       VP!                  V4       V P#                  VP%                  4       ^^W.4       R# u upi )   r  TN)r   r=  rh   rC  rD  r  rE  r!  r  r   r   r  r@  r  r   r   rF  rm   r   )
r-   r  r   rX  r  r  r   rG  r%   exc2s
   &         r   test_return_exceptions&GatherTestsBase.test_return_exceptions  s   =B1XFXmm113XF
allD--aA9 3-13$$&b!!~	Q		Qt}}%$	t}}%
#
""3'1c'89! Gs   "F c                   R P                  R4      p\        RRV4      w  r#pV P                  VP                  4       R4       \        RVRRR7      w  r#pV P                  VP                  4       R4       \        RVRRR7      w  r#pV P                  VP                  4       R4       \        RRVRRR7      w  r#pV P                  VP                  4       R4       \        RRR	RV4      w  r#pV P                  VP                  4       R4       R
# )
z-Ez-cs   False )PYTHONASYNCIODEBUGPYTHONDEVMODE1s   Truez-XdevN)zimport asyncio.coroutinesz*print(asyncio.coroutines._is_debug_mode()))joinr   rm   rstrip)r-   codestsstdoutstderrs   &    r   test_env_var_debug"GatherTestsBase.test_env_var_debug  s
   yy : ; /tT4@V(3.tTBD=?AV 	(3.tTBE=?AV 	'2.tT4BE=?AV 	(3 /tT5/3T;V'2r   )r=  r   )r4   r5   r6   r7   re   r@  rH  rL  rO  rT  rY  rh  r8   r9   r  r  s   @@r   r:  r:    s2     :)254$:&3 3r   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# )FutureGatherTestsi*  c                    V# r   r   )r-   r   s   &*r   rD  FutureGatherTests.wrap_futures,  s    r   c                .    \         P                  ! V/ VB # r   r   r   )r-   r$   r  s   &*,r   rC  FutureGatherTests._gather/  s    ~~t.v..r   c                    V P                  \        R 4      ;_uu_ 4        \        P                  ! 4        RRR4       R#   + '       g   i     R# ; i)r   N)r   r   r   r   r,   s   &r   ,test_constructor_empty_sequence_without_loop>FutureGatherTests.test_constructor_empty_sequence_without_loop2  s0    ##L2IJJNN KJJJs	   ?A	c                   R  pV P                   P                  V! 4       4      pV P                  V\        P                  4       V P                  VP                  V P                   4       V P                  V P                   4       V P                  VP                  4       4       V P                  VP                  4       . 4       R# )c                  4   "   \         P                  ! 4       # 5ir   ro  r   r   r   r   RFutureGatherTests.test_constructor_empty_sequence_use_running_loop.<locals>.gather7  s     >>##s   N)r=  r~   ro   r   r\   r   r   r@  r   r   rm   r   )r-   r   r   s   &  r   0test_constructor_empty_sequence_use_running_loopBFutureGatherTests.test_constructor_empty_sequence_use_running_loop6  s    	$mm..vx8c7>>2cii/t}}%
#r*r   c                   \         P                  ! V P                  4       V P                  \         P                  R 4       \         P                  ! 4       pV P                  V\         P                  4       V P                  VP                  V P                  4       V P                  V P                  4       V P                  VP                  4       4       V P                  VP                  4       . 4       R # r   )r   r   r=  r   r   ro   r\   r   r   r@  r   r   rm   r   )r-   r   s   & r   /test_constructor_empty_sequence_use_global_loopAFutureGatherTests.test_constructor_empty_sequence_use_global_loop@  s    t}}-..5nnc7>>2cii/t}}%
#r*r   c                   V P                   P                  4       pV P                  P                  4       pV P                  \        4      ;_uu_ 4        \
        P                  ! W4       R R R 4       R #   + '       g   i     R # ; ir   )r=  rh   r   r|   r   r   r   )r-   r  r  s   &  r   %test_constructor_heterogenous_futures7FutureGatherTests.test_constructor_heterogenous_futuresK  sR    }}**,,,.z**NN4& +***s   A33B	c                B   \        ^4       Uu. uF  qP                  P                  4       NK  	  pp\        P                  ! V!  pV P                  VP                  V P                  4       V P                  V P                  4       V P                  VP                  4       4       \        P                  ! V!  pV P                  VP                  V P                  4       V P                  V P                  4       V P                  VP                  4       4       R# u upi )rk  N)
r   r   rh   r   r   r   r   r@  r  r   )r-   r  childrenr   s   &   r   #test_constructor_homogenous_futures5FutureGatherTests.test_constructor_homogenous_futuresQ  s    =B1XFXOO113XFnnh'cii1t'$nnh'cii1t'$ Gs   "Dc                   \        ^4       Uu. uF  qP                  P                  4       NK  	  upw  r#rEp\        P                  ! W#WEV4      p\
        P                  ! 4       pVP                  V4       VP                  ^4       VP                  4        V P                  V P                  4       V P                  VP                  4       4       VP                  V4       V P                  VP                  4       4       V P!                  VP#                  4       \        P$                  4       VP                  ^4       VP                  4        VP'                  \)        4       4       VP#                  4        R# u upi rR  )r   r=  rh   r   r   r  rE  r!  r   r{   r@  r   r   rF  r  r  ro   r   r}   r  r   )	r-   r  r   rX  r  r  rS  r   rG  s	   &        r   test_one_cancellation'FutureGatherTests.test_one_cancellation\  s    @EaI1446IaAnnQ1+$$&b!	Q	
t}}%
#
""3')cmmow/E/EF	Q	
	'	 Js   "E:c           
        \        ^4       Uu. uF  pV P                  P                  4       NK  	  upw  r#rErg\        P                  ! W#WEWgRR7      p\
        P                  ! 4       p	VP                  V	4       VP                  ^4       \        4       p
VP                  V
4       VP                  4        V P                  V P                  4       V P                  VP                  4       4       VP                  ^4       VP                  4        \        4       pVP                  V4       V P                  P!                  V4      pV P#                  V^,          \        P$                  4       V P#                  V^,          \        P$                  4       R;V^&   V^&   V P'                  V^V
R^RV.4       V	P)                  V4       R# u upi )   Tr  N)r   r=  rh   r   r   r  rE  r!  r   r  r  r{   r@  r  r   r   r~   ro   r}   rm   rF  )r-   r  r   rX  r  r  rS  r   r   rG  zderter  s   &            r   &test_result_exception_one_cancellation8FutureGatherTests.test_result_exception_one_cancellationn  sd   %*1X/%- !MM779%-/aAnnQ1F$$&b!	Q!		
t}}%$	Q	
n	mm..s3c!fg&<&<=c!fg&<&<=AQq#tQc:;
""3')/s   #Gr   N)r4   r5   r6   r7   rD  rC  rr  rw  rz  r}  r  r  r  r8   r9   r:   s   @r   rk  rk  *  s7     /+	+'	%$( (r   rk  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# )CoroutineGatherTestsi  c                T    . pV F  pV3R  lpVP                  V! 4       4       K!  	  V# )c                 "   "   V G R j  xL
 #  L5ir   r   r   s   &r   rV   /CoroutineGatherTests.wrap_futures.<locals>.coro  s      y yrQ  )r  )r-   r   corosr   rV   s   &*   r   rD  !CoroutineGatherTests.wrap_futures  s.    C" !LL   r   c                T   aa VV3R  lpV P                   P                  V! 4       4      # )c                  8   <"   \         P                  ! S / SB # 5ir   ro  )r$   r  s   r   rV   *CoroutineGatherTests._gather.<locals>.coro  s     >>42622s   )r=  r~   )r-   r$   r  rV   s   &jl r   rC  CoroutineGatherTests._gather  s    	3}}//77r   c                6   R  pV! 4       pV P                  VP                  4       V! 4       pV P                  VP                  4       V P                  \        R4      ;_uu_ 4        \        P
                  ! W#4       RRR4       R#   + '       g   i     R# ; i)c                     "   R # 5ir  r   r   r   r   rV   @CoroutineGatherTests.test_constructor_without_loop.<locals>.coro  r  r   r   N)r   rI   r   r   r   r   )r-   rV   gen1gen2s   &   r   test_constructor_without_loop2CoroutineGatherTests.test_constructor_without_loop  se    	v

#v

###L2IJJNN4& KJJJs   &BB	c                   aa R  pV! 4       oV! 4       oVV3R lpV P                   P                  V! 4       4      pV P                  VP                  V P                   4       V P                   P                  V4       R# )c                     "   R # 5ir  r   r   r   r   rV   DCoroutineGatherTests.test_constructor_use_running_loop.<locals>.coro  r  r   c                  :   <"   \         P                  ! S S4      # 5ir   ro  )r  r  s   r   r   FCoroutineGatherTests.test_constructor_use_running_loop.<locals>.gather  s     >>$--s   N)r=  r~   r   r   )r-   rV   r   r   r  r  s   &   @@r   !test_constructor_use_running_loop6CoroutineGatherTests.test_constructor_use_running_loop  sY    	vv	.mm..vx8cii/((-r   c                V   R  p\         P                  ! V P                  4       V P                  \         P                  R4       V! 4       pV! 4       p\         P                  ! W#4      pV P                  VP                  V P                  4       V P                  P                  V4       R# )c                     "   R # 5ir  r   r   r   r   rV   CCoroutineGatherTests.test_constructor_use_global_loop.<locals>.coro  r  r   N)r   r   r   r   r   r   r   r~   )r-   rV   r  r  r   s   &    r    test_constructor_use_global_loop5CoroutineGatherTests.test_constructor_use_global_loop  sq    	t/..5vvnnT(cii1**3/r   c                    R  pV! R4      pV P                  W"V! R4      V4      pV P                  V P                  4       V P                  VP	                  4       . RO4       R# )c                    "   V # 5ir   r   r|  s   &r   rV   <CoroutineGatherTests.test_duplicate_coroutines.<locals>.coro  r  r   r  defN)r  r  r  r  )rC  r@  r=  rm   r   )r-   rV   r  r   s   &   r   test_duplicate_coroutines.CoroutineGatherTests.test_duplicate_coroutines  sM    	Kll1ea0t}}%'CDr   c                  aaaaa ^ oV P                   P                  4       oVV3R lp\        P                  ! V! 4       V P                   R7      o\        P                  ! V! 4       V P                   R7      oRoVVVV3R lp\        P                  ! V! 4       V P                   R7      p\        P
                  ! V P                   4       V P                  VP                  4       4       V P                  \        P                  4      ;_uu_ 4        V P                   P                  V4       RRR4       V P                  SP                  4       4       V P                  SP                  4       4       V P                  SP                  4       4       V P                  SP                  4       4       \        P
                  ! V P                   4       V P                  S^ 4       R#   + '       g   i     L; i)r   c                  :   <"   SG R j  xL
  S ^,          o R #  L5ir   r   r
  s   r   r   ?CoroutineGatherTests.test_cancellation_broadcast.<locals>.inner  r  r  r[   Nc                  h   <"   \         P                  ! S S4      oSG R j  xL
  S^d,          oR #  L5ir   ro  )rC  rD  gathererr  s   r   r[  ?CoroutineGatherTests.test_cancellation_broadcast.<locals>.outer  s+     ~~ff5HNNSLE s   202)r=  rh   r   r   r  rR  r   r{   r|   r}   r~   r  r  rm   )	r-   r   r[  r   rC  rD  r  r  r  s	   &   @@@@@r   test_cancellation_broadcast0CoroutineGatherTests.test_cancellation_broadcast  sK   ,,.	
 &&uwT]]C&&uwT]]C	 	 !!%'>t}}-
#w5566MM,,Q/ 7*+((*+((*+((*+t}}-" 76s   G##G3	c                $  aaa R  oV P                   P                  4       oV P                   P                  4       oVVV3R lp\        P                  ! V! 4       V P                   R7      p\        P
                  ! V P                   4       SP                  R4       \        P
                  ! V P                   4       SP                  R4       \        P
                  ! V P                   4       V P                  VP                  4       \        4       R# )c                 8   "   V G R j  xL
  \        R4      h L5i)Nzshould not be ignoredr:  r  s   &r   r   :CoroutineGatherTests.test_exception_marking.<locals>.inner  s     GG677 s   c                  j   <"   \         P                  ! S! S 4      S! S4      4      G R j  xL
  R #  L5ir   ro  )r   rX  r   s   r   r[  :CoroutineGatherTests.test_exception_marking.<locals>.outer  s"     ..q58444s   '313r[   N)
r=  rh   r   r   r  rR  r   ro   r   r   )r-   r[  r   r   rX  r   s   &  @@@r   test_exception_marking+CoroutineGatherTests.test_exception_marking  s    	8 MM'')MM'')	5 !!%'>t}}-	Tt}}-	Tt}}-akkm\:r   c           	        \         P                  ! R 4      ;_uu_ 4        R pV! R4      pV P                  \        4      ;_uu_ 4        V P	                  V/ 4       RRR4       V P                  V P                  4       V P                  P                  P                  4        RRR4       R#   + '       g   i     LY; i  + '       g   i     R# ; i)z8asyncio.base_events.BaseEventLoop.call_exception_handlerc                    "   V # 5ir   r   r|  s   &r   rV   2CoroutineGatherTests.test_issue46672.<locals>.coro  s
     r   r  N)	r   rO  r|   r   rC  r@  r=  rw  r)  )r-   rV   r  s   &  r   test_issue46672$CoroutineGatherTests.test_issue46672  s    ZZF
 
UA""9--Q# .NN4==)MM00BBD
 
 .-
 
 
s$   )B?B,	AB?,B<7B??C	r   N)r4   r5   r6   r7   rD  rC  r  r  r  r  r  r  r  r8   r9   r:   s   @r   r  r    s;     8
'	.
0E#@;*E Er   r  c                   h   a a ] tR tRt oRtV 3R ltRR ltRR ltR tR t	R t
R	 tR
 tRtVtV ;t# )RunCoroutineThreadsafeTestsi  z/Test case for asyncio.run_coroutine_threadsafe.c                   < \         SV `  4        \        P                  ! 4       V n        V P                  V P                  4       R # r   r  ri   s   &r   re   !RunCoroutineThreadsafeTests.setUp  r  r   c                ,  "   \         P                  ! R4      G Rj  xL
  V'       d   \        R4      hV'       dM   \         P                  ! V P                  4      P                  4        \         P                  ! ^ 4      G Rj  xL
  W,           #  Ls L5i)z"Wait 0.05 second and return a + b.rG  NFail!)r   r   r   r  rQ   r{   )r-   r   rX  rH  r{   s   &&&&&r   r  RunCoroutineThreadsafeTests.add
  sf     mmD!!!w''  +224--"""u 	"
 #s,   BBBBABBBBc                   V P                  ^^WR7      p\        P                  ! WPP                  4      pV'       d'   V P                  P	                  VP
                  R4        VP                  V4      VP                  4       ;'       g    VP                  4        #  #   TP                  4       ;'       g    TP                  4        i  i ; i)z$Run add coroutine in the event loop.)rH  r{   N)	r  r   run_coroutine_threadsaferQ   call_soon_threadsaferC   r   r   r{   )r-   rH  r{   r  advance_cororV   ri  s   &&&&&  r   target"RunCoroutineThreadsafeTests.target  s     xx14x711$		B II**499d;	-==)KKM,,V]]_,FKKM,,V]]_,s   $B ,Cc                    V P                   P                  RV P                  4      pV P                   P                  V4      pV P	                  V^4       R# )z9Test coroutine submission from a thread to an event loop.N)rQ   run_in_executorr  r~   rm   )r-   ri  r   s   &  r   test_run_coroutine_threadsafe9RunCoroutineThreadsafeTests.test_run_coroutine_threadsafe%  s@    **4=--f5#r   c                H   V P                   P                  RV P                  R4      pV P                  \        4      ;_uu_ 4       pV P                   P                  V4       RRR4       V P                  RXP                  P                  4       R#   + '       g   i     L8; i)zUTest coroutine submission from a thread to an event loop
when an exception is raised.NTr  )	rQ   r  r  r|   r   r~   r  r   r$   )r-   ri  exc_contexts   &  r   ,test_run_coroutine_threadsafe_with_exceptionHRunCoroutineThreadsafeTests.test_run_coroutine_threadsafe_with_exception+  sm     **4dC|,,II((0 -g{4499: -,s   BB!	c                  a  V 3R lpS P                   P                  RV4      pS P                  \        P                  4      ;_uu_ 4        S P                   P                  V4       RRR4       \        P                  ! S P                   4       \        P                  ! S P                   4       F"  pS P                  VP                  4       4       K$  	  R#   + '       g   i     Lx; i)zRTest coroutine submission from a thread to an event loop
when a timeout is raised.c                  (   < S P                  ^ R7      # )r   r  r  r,   s   r   rb   XRunCoroutineThreadsafeTests.test_run_coroutine_threadsafe_with_timeout.<locals>.<lambda>6  s    4;;q;1r   N)rQ   r  r|   r   r  r~   r  rR  rm  r   r   )r-   r  ri  rq   s   f   r   *test_run_coroutine_threadsafe_with_timeoutFRunCoroutineThreadsafeTests.test_run_coroutine_threadsafe_with_timeout3  s     2**4:w3344II((0 5tyy)%%dii0DOODIIK( 1	 54s   CC'	c                
  a  V 3R lpS P                   P                  RV4      pS P                  \        P                  4      ;_uu_ 4        S P                   P                  V4       RRR4       R#   + '       g   i     R# ; i)zTTest coroutine submission from a thread to an event loop
when the task is cancelled.c                  (   < S P                  R R7      # )Tr  r  r,   s   r   rb   ZRunCoroutineThreadsafeTests.test_run_coroutine_threadsafe_task_cancelled.<locals>.<lambda>B  s    4;;d;3r   N)rQ   r  r|   r   r}   r~   )r-   r  ri  s   f  r   ,test_run_coroutine_threadsafe_task_cancelledHRunCoroutineThreadsafeTests.test_run_coroutine_threadsafe_task_cancelled?  sX     4**4:w5566II((0 7666s   A11B	c                  a  R pS P                   P                  RV 3R l4      p\        P                  ! 4       pS P                   P	                  V4       S P                  S P                   P                  S P                   P                  4       4       S P                   P                  V4       S P                  \        4      ;_uu_ 4       pS P                   P                  V4       RRR4       S P                  \        VP                  4      ^4       VP                  w  w  rVpS P                  VR,          XP                  4       R#   + '       g   i     Lk; i)zbTest coroutine submission from a thread to an event loop
when the task factory raise an exception.c                     \         hr   )	NameError)rQ   rV   s   &&r   task_factoryfRunCoroutineThreadsafeTests.test_run_coroutine_threadsafe_task_factory_exception.<locals>.task_factoryK  s    Or   Nc                  (   < S P                  R R7      # )T)r  r  r,   s   r   rb   bRunCoroutineThreadsafeTests.test_run_coroutine_threadsafe_task_factory_exception.<locals>.<lambda>O  s    $++4+8r   r   )rQ   r  r  rE  r(  r   rg   get_task_factoryr|   r  r~   rm   r  call_args_listr  r   )r-   r  r   r  r  rQ   r'   r  s   f       r   4test_run_coroutine_threadsafe_task_factory_exceptionPRunCoroutineThreadsafeTests.test_run_coroutine_threadsafe_task_factory_exceptionG  s   	 ii''8: **,		''1 			22		224	6		""<0 y))[II((- * 	X445q9"*"4"4-{/D/DE *)s   E

E	r[   )FF)FFNF)r4   r5   r6   r7   __doc__re   r  r  r  r  r  r  r  r8   r9   r  r  s   @@r   r  r    s7     9'
-"$;
)1F Fr   r  c                   D   a a ] tR tRt oV 3R ltV 3R ltR tRtVtV ;t	# )
SleepTestsid  c                   < \         SV `  4        \        P                  ! 4       V n        V P                  V P                  4       R # r   r  ri   s   &r   re   SleepTests.setUpe  r  r   c                f   < V P                   P                  4        R V n         \        SV `  4        R # r   rQ   rI   rd   tearDownri   s   &r   r  SleepTests.tearDownj  #    			r   c                   a aa ^ oV3R loVVV 3R lpS P                   P                  V! 4       4       S P                  S^4       R# )r   c                    < SV ,          oR # r   r   )r  r   s   &r   
inc_result.SleepTests.test_sleep_zero.<locals>.inc_resultr  s    cMFr   c                     <"   SP                   P                  S^4       SP                  S^ 4       \        P                  ! ^ ^
R7      G Rj  xL
 p SP                  S^4       S! V 4       R#  L 5i)r  r   N)rQ   r  rm   r   r   )r  r  r   r-   s    r   rV   (SleepTests.test_sleep_zero.<locals>.corov  sY     II
A.VQ'a33CVQ'sO 4s   A
A0A.!A0N)rQ   r~   rm   )r-   rV   r  r   s   f @@r   test_sleep_zeroSleepTests.test_sleep_zeroo  s8    		 			$$TV,$r   r[   )
r4   r5   r6   r7   re   r  r  r8   r9   r  r  s   @@r   r  r  d  s     '

% %r   r  c                   >   a a ] tR tRt oV 3R ltV 3R ltRtVtV ;t# )CompatibilityTestsi  c                   < \         SV `  4        \        P                  ! 4       V n        V P                  V P                  4       R # r   r  ri   s   &r   re   CompatibilityTests.setUp  r  r   c                f   < V P                   P                  4        R V n         \        SV `  4        R # r   r  ri   s   &r   r  CompatibilityTests.tearDown  r  r   r[   )	r4   r5   r6   r7   re   r  r8   r9   r  r  s   @@r   r  r    s     '
 r   r  __main__r  )>r  rV  r  r  r   r  r  r1  r  rI  r   unittestr   r   r   r   r   test.test_asyncior   r  r   r   test.support.script_helperr   test.support.warnings_helperr	   r   r   r    r(   r*   r=   rO   rn  rp  
skipUnlessr	  TestCaser  r  r  r  r  r  r  r  r  r  r  r  r  r"  r&  r*  r:  rk  r  r  r  r  r4   r  r   r   r   <module>r     s       	 	  	 
         1  7 80	
?(   Y*E Y*ExT7t2 2j 
WWj1 . .UH-57*-$--*7*< 
WWj1 . .UH-57 I-1D1D I 7I 
WUH-57I=*2E2E I 7I 
WWj1578=*2E2E 8 78 
WUH-57I=**=*= I7I 
WWj1578=**=*= 8788M>&//8 8M:3F3F 8 8 
WUH-57&,, &7&0~6 ~6B8:..0J 8 
WU$6757	M*--/I 	M7	M= =<3-z/B/B 3 
WUH- 7 7U$5657>,j.A.A >7>8z** 80c3 c3LY()<)< Y(xyE?J,?,? yEx_F*"5"5 _FD%$$ %:,,  zMMO r   