+
    Bi                       ^ RI t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
 ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIt]P                  RD9  d   ^ RI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
I#H$t$ ^ RI#H%t% ^ RI#H&t&H't'H(t( R t)R t*R t+ ! R R4      t, ! R R]PZ                  4      t. ! R R].4      t/ ! R R]P`                  4      t1 ! R R]PZ                  4      t2 ! R R]Pf                  4      t4 ! R R]Pj                  4      t6 ! R R4      t7 ! R  R!4      t8]P                  R8X  d/    ! R" R#]7] Pr                  4      t: ! R$ R%]7]8] Pr                  4      t;M^ RI<t<]=! ]<R&4      '       d    ! R' R(]7]8] Pr                  4      t>]=! ]<R)4      '       d    ! R* R+]7]8] Pr                  4      t?]=! ]<R,4      '       d    ! R- R.]7]8] Pr                  4      t@ ! R/ R#]7]8] Pr                  4      t:R0 tA ! R1 R2] Pr                  4      tB ! R3 R4]Pr                  4      tC ! R5 R6]Pr                  4      tD ! R7 R8]Pr                  4      tE ! R9 R:4      tF ! R; R<]F]Pr                  4      tG ^ RIHtH ! R= R>]F]Pr                  4      tI ! R? R@]Pr                  4      tJ ! RA RB]Pr                  4      tK]LRC8X  d   ]P                  ! 4        R# R#   ] d    Rt ELi ; i  ] d     L_i ; i)E    N)mockwin32)
coroutines)events)selector_events)_cleanup_tests)utils)support)socket_helper)threading_helper)	ALWAYS_EQLARGESTSMALLESTc                  D    \         P                  P                  R 4       R # N)asyncior   _set_event_loop_policy     4/usr/lib/python3.14/test/test_asyncio/test_events.pytearDownModuler   (   s    NN))$/r   c                     \         P                  P                  R 4      '       d   R# \         P                  R8w  d   R# \        P                  ! 4       ^ ,          p \	        \        \        V P                  R4      4      4      p V R8  # )aixTdarwinF.)
      )sysplatform
startswithmac_vertuplemapintsplit)versions    r   broken_unix_getsocknamer'   ,   sa    
||u%%		! #GCW]]3/01GWr   c                      R  p \         P                  ! \        P                  ! 4       4      ;_uu_ 4       p\        P                  ! V4       VP                  V ! 4       4      uuRRR4       #   + '       g   i     R# ; i)c                     "   R # 5i)hellor   r   r   r   doit8_test_get_event_loop_new_process__sub_proc.<locals>.doit8   s        N)
contextlibclosingr   new_event_loopset_event_looprun_until_complete)r+   loops     r   *_test_get_event_loop_new_process__sub_procr4   7   sR     
		G224	5	5t$&&tv. 
6	5	5	5s   ,A,,A=	c                   8   a  ] tR t^@t o R tR tR tR tRtV t	R# )CoroLikec                    R # r   r   )selfvs   &&r   sendCoroLike.sendA       r   c                    R # r   r   r8   excs   &*r   throwCoroLike.throwD   r<   r   c                    R # r   r   r8   s   &r   closeCoroLike.closeG   r<   r   c                    R # r   r   rC   s   &r   	__await__CoroLike.__await__J   r<   r   r   N)
__name__
__module____qualname____firstlineno__r:   r@   rD   rG   __static_attributes____classdictcell____classdict__s   @r   r6   r6   @   s      r   r6   c                   P   a  ] tR t^Nt o RtRtR	R ltR tR tR t	R t
R tRtV tR# )
MyBaseProtoNc                    R V n         RV n        ^ V n        Ve-   VP                  4       V n        VP                  4       V n        R # R # )NINITIAL)	transportstatenbytescreate_future	connecteddoner8   r3   s   &&r   __init__MyBaseProto.__init__R   sB    
!//1DN**,DI r   c                b    V P                   V9  d   \        R V P                   : RV: 24      hR# zstate: z, expected: NrV   AssertionErrorr8   expecteds   &*r   _assert_stateMyBaseProto._assert_stateZ   s/    ::X% 74::.XL!QRR &r   c                    Wn         V P                  R 4       RV n        V P                  '       d   V P                  P	                  R4       R# R# rT   	CONNECTEDNrU   rd   rV   rY   
set_resultr8   rU   s   &&r   connection_madeMyBaseProto.connection_made^   s<    "9% 
>>>NN%%d+ r   c                l    V P                  R 4       V ;P                  \        V4      ,          un        R# rh   Nrd   rW   lenr8   datas   &&r   data_receivedMyBaseProto.data_receivede   s"    ;'s4y r   c                6    V P                  R 4       RV n        R# )rh   EOFN)rd   rV   rC   s   &r   eof_receivedMyBaseProto.eof_receivedi   s    ;'
r   c                    V P                  R R4       RV n        V P                  '       d   V P                  P                  R4       R# R# )rh   rw   CLOSEDNrd   rV   rZ   rj   r>   s   &&r   connection_lostMyBaseProto.connection_lostm   s9    ;.
999II  & r   )rY   rZ   rW   rV   rU   r   )rI   rJ   rK   rL   rY   rZ   r\   rd   rl   rt   rx   r}   rM   rN   rO   s   @r   rR   rR   N   s3     ID-S,!' 'r   rR   c                   2   a a ] tR t^tt oV 3R ltRtVtV ;t# )MyProtoc                H   < \         SV `  V4       VP                  R 4       R# )s%   GET / HTTP/1.0
Host: example.com

N)superrl   write)r8   rU   	__class__s   &&r   rl   MyProto.connection_madeu   s    	*FGr   r   rI   rJ   rK   rL   rl   rM   rN   __classcell__r   rP   s   @@r   r   r   t   s     H Hr   r   c                   L   a  ] tR t^zt o RtR	R ltR tR tR tR t	R t
RtV tR# )
MyDatagramProtoNc                X    R V n         ^ V n        Ve   VP                  4       V n        R# R# rT   N)rV   rW   rX   rZ   r[   s   &&r   r\   MyDatagramProto.__init__}   s+    
**,DI r   c                b    V P                   V8w  d   \        R V P                   : RV: 24      hR# r_   r`   rb   s   &&r   rd   MyDatagramProto._assert_state   /    ::! 74::.XL!QRR "r   c                B    Wn         V P                  R 4       RV n        R# )rT   INITIALIZEDNrU   rd   rV   rk   s   &&r   rl   MyDatagramProto.connection_made   s    "9%"
r   c                l    V P                  R 4       V ;P                  \        V4      ,          un        R# r   Nrp   r8   rs   addrs   &&&r   datagram_received!MyDatagramProto.datagram_received   s"    =)s4y r   c                (    V P                  R 4       R# r   )rd   r>   s   &&r   error_receivedMyDatagramProto.error_received   s    =)r   c                    V P                  R 4       RV n        V P                  '       d   V P                  P                  R4       R# R# )r   r{   Nr|   r>   s   &&r   r}   MyDatagramProto.connection_lost   s7    =)
999II  & r   rZ   rW   rV   rU   r   )rI   rJ   rK   rL   rZ   r\   rd   rl   r   r   r}   rM   rN   rO   s   @r   r   r   z   s.     D-S#
!*' 'r   r   c                   L   a  ] tR t^t o RtR	R ltR tR tR tR t	R t
RtV tR# )
MyReadPipeProtoNc                h    R .V n         ^ V n        RV n        Ve   VP                  4       V n        R# R# r   )rV   rW   rU   rX   rZ   r[   s   &&r   r\   MyReadPipeProto.__init__   s4    [
**,DI r   c                b    V P                   V8w  d   \        R V P                   : RV: 24      hR# r_   r`   rb   s   &&r   rd   MyReadPipeProto._assert_state   r   r   c                l    Wn         V P                  R .4       V P                  P                  R4       R# rg   )rU   rd   rV   appendrk   s   &&r   rl   MyReadPipeProto.connection_made   s)    "I;'

+&r   c                p    V P                  R R.4       V ;P                  \        V4      ,          un        R# rg   rp   rr   s   &&r   rt   MyReadPipeProto.data_received   s'    I{34s4y r   c                b    V P                  R R.4       V P                  P                  R4       R# )rT   rh   rw   N)rd   rV   r   rC   s   &r   rx   MyReadPipeProto.eof_received   s'    I{34

% r   c                   R V P                   9  d   V P                   P                  R 4       V P                  . RO4       V P                   P                  R4       V P                  '       d   V P                  P	                  R4       R# R# )rw   r{   N)rT   rh   rw   )rV   r   rd   rZ   rj   r>   s   &&r   r}   MyReadPipeProto.connection_lost   sa    

"JJe$:;

(#999II  & r   r   r   )rI   rJ   rK   rL   rZ   r\   rd   rl   rt   rx   r}   rM   rN   rO   s   @r   r   r      s.     D-S'
!!' 'r   r   c                   @   a  ] tR t^t o RtRR ltR tR tR tRt	V t
R# )MyWritePipeProtoNc                X    R V n         RV n        Ve   VP                  4       V n        R# R# r   )rV   rU   rX   rZ   r[   s   &&r   r\   MyWritePipeProto.__init__   s+    
**,DI r   c                b    V P                   V8w  d   \        R V P                   : RV: 24      hR# r_   r`   rb   s   &&r   rd   MyWritePipeProto._assert_state   r   r   c                B    Wn         V P                  R 4       RV n        R# rg   r   rk   s   &&r   rl    MyWritePipeProto.connection_made   s    "9% 
r   c                    V P                  R 4       RV n        V P                  '       d   V P                  P                  R4       R# R# rh   r{   Nr|   r>   s   &&r   r}    MyWritePipeProto.connection_lost   s7    ;'
999II  & r   )rZ   rV   rU   r   )rI   rJ   rK   rL   rZ   r\   rd   rl   r}   rM   rN   rO   s   @r   r   r      s$     D-S!
' 'r   r   c                   J   a  ] tR t^t o R tR tR tR tR tR t	R t
RtV tR	# )
MySubprocessProtocolc                b   R V n         RV n        VP                  4       V n        VP                  4       V n        \        ^4       Uu/ uF  q"VP                  4       bK  	  upV n        ^R^R/V n        RV n        ^\        P                  ! 4       ^\        P                  ! 4       /V n        R# u upi )rT   Nr   )rV   rU   rX   rY   	completedrangedisconnectsrs   
returncoder   Eventgot_data)r8   r3   fds   && r   r\   MySubprocessProtocol.__init__   s    
++-++-?DQxHx 2 2 44xHQ$	GMMOGMMO- Is   B,c                b    V P                   V8w  d   \        R V P                   : RV: 24      hR# r_   r`   rb   s   &&r   rd   "MySubprocessProtocol._assert_state   r   r   c                x    Wn         V P                  R 4       RV n        V P                  P	                  R4       R# rg   ri   rk   s   &&r   rl   $MySubprocessProtocol.connection_made   s.    "9% 
!!$'r   c                l    V P                  R 4       RV n        V P                  P                  R4       R# r   )rd   rV   r   rj   r>   s   &&r   r}   $MySubprocessProtocol.connection_lost   s)    ;'
!!$'r   c                    V P                  R 4       V P                  V;;,          V,          uu&   V P                  V,          P                  4        R# ro   )rd   rs   r   set)r8   r   rs   s   &&&r   pipe_data_received'MySubprocessProtocol.pipe_data_received   s7    ;'		"br   c                    V P                  R 4       V'       d%   V P                  V,          P                  V4       R# V P                  V,          P                  V4       R# ro   )rd   r   set_exceptionrj   )r8   r   r?   s   &&&r   pipe_connection_lost)MySubprocessProtocol.pipe_connection_lost   sE    ;'R ..s3R ++C0r   c                f    V P                  R 4       V P                  P                  4       V n        R# ro   )rd   rU   get_returncoder   rC   s   &r   process_exited#MySubprocessProtocol.process_exited   s$    ;'..779r   )r   rY   rs   r   r   r   rV   rU   N)rI   rJ   rK   rL   r\   rd   rl   r}   r   r   r   rM   rN   rO   s   @r   r   r      s.     	-S((
 
1: :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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]P,                  ! ]! ]R4      R4      R 4       t]P,                  ! ]! ]R4      R4      ]P,                  ! ]! ]R4      R4      R 4       4       t]P,                  ! ]! ]R4      R4      ]P,                  ! ]! ]R4      R4      R 4       4       tRcR ltR t]P>                  R 4       t RR / 3R! lt!RdR" lt"RdR# lt#]PH                  ! ]%R J R$4      R% 4       t&]P>                  ]PH                  ! ]%R J R$4      R& 4       4       t'R' t(]PR                  R( 4       t*]PR                  R) 4       t+R* t,ReR+ lt-]PH                  ! ]%R J R$4      R, 4       t.R- t/]0Pb                  ! R.4      R/ 4       t2R0 t3R1 t4R2 t5R3 t6]P,                  ! ]! ]7R44      R54      R6 4       t8R7 t9]P>                  R8 4       t:]P,                  ! ]! ]7R94      R:4      R; 4       t;RfR< lt<RfR= lt=RfR> lt>]PH                  ! ]%R J R$4      R? 4       t?]P>                  ]PH                  ! ]%R J R$4      R@ 4       4       t@]PH                  ! ]%R J R$4      RA 4       tA]P>                  ]PH                  ! ]%R J R$4      RB 4       4       tB]PH                  ! ]%R J R$4      RC 4       tC]P>                  ]PH                  ! ]%R J R$4      RD 4       4       tD]PH                  ! ]%R J R$4      RE 4       tERF tFRG tG]P,                  ! ]P                  RH4      RI 4       tI]PR                  RJ 4       tJRK tKRL tL]P,                  ! ]P                  RH4      RM 4       tMRN tNRO tORP tP]P,                  ! ]QP                  RQ8g  RR4      RS 4       tS]P,                  ! ]QP                  RQ8g  RR4      RT 4       tT]P,                  ! ]QP                  RQ8g  RR4      ]P,                  ! ]! ]URU4      RV4      RW 4       4       tV]P,                  ! ]QP                  RQ8g  RR4      RX 4       tW]P,                  ! ]QP                  RQ8g  RR4      RY 4       tX]P,                  ! ]QP                  RQ8g  RR4      ]P,                  ! ]! ]URU4      RV4      ]YP                  ! ^
^4      RZ 4       4       4       t[]P,                  ! ]QP                  RQ8g  RR4      ]P,                  ! ]! ]URU4      RV4      ]YP                  ! ^
^4      R[ 4       4       4       t\R\ t]R] t^R^ t_R_ t`R` taRa tbRbtcVtdV ;te# )gEventLoopTestsMixini  c                   < \         SV `  4        V P                  4       V n        V P	                  V P                  4       R # r   )r   setUpcreate_event_loopr3   r1   r8   r   s   &r   r   EventLoopTestsMixin.setUp  s.    **,	DII&r   c                   < V P                   P                  4       '       g!   \        P                  ! V P                   4       V P	                  4        \
        P                  ! 4        \        SV `!  4        R # r   )	r3   	is_closed
test_utilsrun_briefly
doCleanupsr
   
gc_collectr   tearDownr   s   &r   r   EventLoopTestsMixin.tearDown  sI    yy""$$""499-r   c                   a a R  oVV 3R lpS P                  \        R4      ;_uu_ 4        S P                  \        S P                  P
                  V! 4       4       RRR4       R#   + '       g   i     R# ; i)c                  N   "   \         P                  ! ^ 4      G Rj  xL
  R#  L5i)r   Nr   sleepr   r   r   coro1BEventLoopTestsMixin.test_run_until_complete_nesting.<locals>.coro1  s     --"""s   %#%c                     <"   SP                  SP                  P                  4       4       SP                  P                  S ! 4       4       R # 5ir   )
assertTruer3   
is_runningr2   )r   r8   s   r   coro2BEventLoopTestsMixin.test_run_until_complete_nesting.<locals>.coro2  s3     OODII0023II((1s   AAzcoroutine \S+ was never awaitedN)assertWarnsRegexRuntimeWarningassertRaisesRuntimeErrorr3   r2   )r8   r   r   s   f @r   test_run_until_complete_nesting3EventLoopTestsMixin.test_run_until_complete_nesting  sa    	#	2 "".
 
 dii::EGE	
 
 
 
s   1A&&A7	c                *   R pV P                   P                  4       pV P                   P                  \        P                  ! V4      4       V P                   P                  4       V,
          pV P                  W1\        P                  ,
          4       R# 皙?N)r3   timer2   r   r   assertGreaterEqualr   	CLOCK_RES)r8   delayt0dts   &   r   test_run_until_complete+EventLoopTestsMixin.test_run_until_complete&  s`    YY^^		$$W]]5%9:YY^^"J,@,@$@Ar   c                x   a  V 3R  lpV! 4       pS P                  \        S P                  P                  V4       R# )c                     <"   S P                   P                  4        \        P                  ! R 4      G Rj  xL
  R#  L5ir   )r3   stopr   r   rC   s   r   cb?EventLoopTestsMixin.test_run_until_complete_stopped.<locals>.cb/  s&     IINN--$$$s   4A >A N)r   r   r3   r2   )r8   r  tasks   f  r   test_run_until_complete_stopped3EventLoopTestsMixin.test_run_until_complete_stopped-  s0    	% t,))66	>r   c                   a a . oVV 3R  lpS P                   P                  RVR4       S P                   P                  4        S P                  SR.4       R# )c                 ^   < SP                  V 4       SP                  P                  4        R # r   r   r3   r  argresultsr8   s   &r   callback5EventLoopTestsMixin.test_call_later.<locals>.callback9  s    NN3IINNr   r   zhello worldN)r3   
call_laterrun_foreverassertEqualr8   r  r  s   f @r   test_call_later#EventLoopTestsMixin.test_call_later6  sG    	 			S(M:		=/2r   c                   a a . oVV 3R  lpS P                   P                  VRR4       S P                   P                  4        S P                  SR.4       R# )c                 `   < SP                  W34       SP                  P                  4        R # r   r  )arg1arg2r  r8   s   &&r   r  4EventLoopTestsMixin.test_call_soon.<locals>.callbackD  s    NND<(IINNr   r*   worldN)r*   r  )r3   	call_soonr  r  r  s   f @r   test_call_soon"EventLoopTestsMixin.test_call_soonA  sI    	 			Hgw7		#5"67r   c                  a aaa . o\         P                  ! 4       oVV 3R  loVVV 3R lpSP                  4        \         P                  ! VR7      pVP	                  4        S;_uu_ 4        S P
                  P                  SR4       S P
                  P                  4        RRR4       VP                  4        S P                  SRR.4       R#   + '       g   i     L6; i)c                    < SP                  V 4       \        S4      ^8  d   SP                  P                  4        R# R#    Nr   rq   r3   r  r  s   &r   r  ?EventLoopTestsMixin.test_call_soon_threadsafe.<locals>.callbackP  .    NN37|q 		  !r   c                  `   < SP                   P                  S R 4       SP                  4        R# r*   N)r3   call_soon_threadsaferelease)r  lockr8   s   r   run_in_threadDEventLoopTestsMixin.test_call_soon_threadsafe.<locals>.run_in_threadU  s     II**8W=LLNr   targetr  Nr*   )
	threadingLockacquireThreadstartr3   r  r  joinr  )r8   r.  tr  r-  r  s   f  @@@r   test_call_soon_threadsafe-EventLoopTestsMixin.test_call_soon_threadsafeL  s    ~~	!
	 	M2		TII'2II!!#  	
7G"45	 Ts   ,7CC!	c                R  a aaaa . o\         P                  ! 4       o\         P                  ! 4       oVVV3R  loVVVV 3R lp\         P                  ! VR7      pVP                  4        S P                  P                  4        VP                  4        S P                  SR.4       R# )c                    < SP                  4        SP                  V 4       \        P                  ! ^4       SP                  4        R#    Nr   r   r   r   r  callback_finishedcallback_startedr  s   &r   r  \EventLoopTestsMixin.test_call_soon_threadsafe_handle_block_check_cancelled.<locals>.callbackh  2      "NN3JJqM!!#r   c                  z  < SP                   P                  SR 4      p SP                  V \        P                  4       SP                  4        SP                  V P                  4       4       SP                  SP                  4       4       SP                   P                  SP                   P                  4       R# r*  )r3   r+  assertIsInstancer   _ThreadSafeHandlewaitassertFalse	cancelledr   is_setr  handler  rA  rB  r8   s    r   r.  aEventLoopTestsMixin.test_call_soon_threadsafe_handle_block_check_cancelled.<locals>.run_in_threadn  s    YY33HgFF!!&&*B*BC!!# V--/0OO-4467II**499>>:r   r0  r*   Nr2  r   r5  r6  r3   r  r7  r  r8   r.  r8  r  rA  rB  r  s   f  @@@@r   6test_call_soon_threadsafe_handle_block_check_cancelledJEventLoopTestsMixin.test_call_soon_threadsafe_handle_block_check_cancelledc  w    $??,%OO-	$	; 	; M2					7),r   c                R  a aaaa . o\         P                  ! 4       o\         P                  ! 4       oVVV3R  loVVVV 3R lp\         P                  ! VR7      pVP                  4        S P                  P                  4        VP                  4        S P                  SR.4       R# )c                    < SP                  4        SP                  V 4       \        P                  ! ^4       SP                  4        R# r=  r?  r@  s   &r   r  YEventLoopTestsMixin.test_call_soon_threadsafe_handle_block_cancellation.<locals>.callback  rD  r   c                  \  < SP                   P                  SR 4      p SP                  V \        P                  4       SP                  4        V P                  4        SP                  SP                  4       4       SP                   P                  SP                   P                  4       R# r*  )
r3   r+  rF  r   rG  rH  cancelr   rK  r  rL  s    r   r.  ^EventLoopTestsMixin.test_call_soon_threadsafe_handle_block_cancellation.<locals>.run_in_thread  sv    YY33HgFF!!&&*B*BC!!# MMOOO-4467II**499>>:r   r0  r*   NrO  rP  s   f  @@@@r   3test_call_soon_threadsafe_handle_block_cancellationGEventLoopTestsMixin.test_call_soon_threadsafe_handle_block_cancellation  rS  r   c                  a aaaaa . o\         P                  ! 4       o\         P                  ! 4       o\        P                  P	                  4       oVVVVV 3R  loVVVVV 3R lp\         P
                  ! VR7      pVP                  4        S P                  P                  4        VP                  4        S P                  SR.4       R# )c                    < SP                  4        SP                  4       pVP                  4        SP                  V 4       SP                  4        SP                  P                  4        R # r   )r   resultrX  r   r3   r  )r  rM  rA  rB  futr  r8   s   & r   r  YEventLoopTestsMixin.test_call_soon_threadsafe_handle_cancel_same_thread.<locals>.callback  sI      "ZZ\FMMONN3!!#IINNr   c                    < SP                   P                  SR 4      p SP                  V 4       SP                  V \        P
                  4       SP                  4        SP                  V P                  4       4       SP                  SP                  4       4       SP                   P                  SP                   P                  4       R# r*  )r3   r+  rj   rF  r   rG  rH  r   rJ  rK  r  )rM  r  rA  rB  r_  r8   s    r   r.  ^EventLoopTestsMixin.test_call_soon_threadsafe_handle_cancel_same_thread.<locals>.run_in_thread  s    YY33HgFFNN6"!!&&*B*BC!!# OOF,,./OO-4467II**499>>:r   r0  r*   N)r2  r   
concurrentfuturesFuturer5  r6  r3   r  r7  r  )r8   r.  r8  r  rA  rB  r_  r  s   f  @@@@@r   3test_call_soon_threadsafe_handle_cancel_same_threadGEventLoopTestsMixin.test_call_soon_threadsafe_handle_cancel_same_thread  s    $??,%OO-  '')	 			; 		; M2					7),r   c                  a aaaa . o\         P                  ! 4       o\         P                  ! 4       oVVV 3R  loVVVV 3R lpS P                  P                  SP                  4       \         P
                  ! VR7      pVP                  4        S P                  P                  4        VP                  4        S P                  S. 4       S P                  SP                  4       4       R# )c                 ~   < SP                  V 4       SP                  4        SP                  P                  4        R # r   )r   r   r3   r  )r  rA  r  r8   s   &r   r  ZEventLoopTestsMixin.test_call_soon_threadsafe_handle_cancel_other_thread.<locals>.callback  s)    NN3!!#IINNr   c                    < SP                   P                  SR 4      p SP                  V \        P                  4       V P                  4        SP                  V P                  4       4       SP                  SP                  4       4       SP                  4        SP                   P                  SP                   P                  4       R# r*  )r3   r+  rF  r   rG  rX  r   rJ  rI  rK  r   r  )rM  r  rA  evr8   s    r   r.  _EventLoopTestsMixin.test_call_soon_threadsafe_handle_cancel_other_thread.<locals>.run_in_thread  s    YY33HgFF!!&&*B*BCMMOOOF,,./.5578FFHII**499>>:r   r0  N)r2  r   r3   r  rH  r5  r6  r  r7  r  rI  rK  )r8   r.  r8  r  rA  rl  r  s   f  @@@@r   4test_call_soon_threadsafe_handle_cancel_other_threadHEventLoopTestsMixin.test_call_soon_threadsafe_handle_cancel_other_thread  s    __%OO-	
	; 	; 			BGG$M2					"%*1134r   c                   a a . oVV 3R  lpS P                   P                  VR4       S P                   P                  VR4       S P                   P                  4        S P	                  SRR.4       R# )c                    < SP                  V 4       \        S4      ^8  d   SP                  P                  4        R# R# r$  r&  r  s   &r   r  KEventLoopTestsMixin.test_call_soon_threadsafe_same_thread.<locals>.callback  r(  r   r*   r  N)r3   r+  r  r  r  r  s   f @r   %test_call_soon_threadsafe_same_thread9EventLoopTestsMixin.test_call_soon_threadsafe_same_thread  s\    	!
 			&&x9		Hg.		7G"45r   c                    R  pV P                   P                  RVR4      pV P                   P                  V4      w  r4V P                  VR4       V P	                  V\
        P                  ! 4       4       R# )c                 0    V \         P                  ! 4       3# r   )r2  	get_ident)r  s   &r   run5EventLoopTestsMixin.test_run_in_executor.<locals>.run  s    ,,.//r   Nyo)r3   run_in_executorr2   r  assertNotEqualr2  rw  )r8   rx  f2res	thread_ids   &    r   test_run_in_executor(EventLoopTestsMixin.test_run_in_executor  s^    	0YY&&tS$755b9d#Iy':':'<=r   c                  a R oV3R lpR pV P                   P                  RV4      pVP                  4        V P                   P                  V P                   P	                  4       4       V P                   P                  4        WP                   n        WP                   n        \        P                  ! R4       V P                  S4       R# )Fc                     < R oR# TNr   )argscalleds   *r   patched_call_soonJEventLoopTestsMixin.test_run_in_executor_cancel.<locals>.patched_call_soon  s    Fr   c                  2    \         P                  ! R 4       R# )g?N)r   r   r   r   r   rx  <EventLoopTestsMixin.test_run_in_executor_cancel.<locals>.run  s    JJtr   Ng?)r3   r{  rX  r2   shutdown_default_executorrD   r  r+  r   r   rI  )r8   r  rx  r}  r  s   &   @r   test_run_in_executor_cancel/EventLoopTestsMixin.test_run_in_executor_cancel  s    		 YY&&tS1
				$$		335	7		/		):		&

3 r   c                  a aa \         P                  ! 4       w  opSP                  R 4       \        4       oVVV 3R lpS P                  P                  SP                  4       V4       S P                  P                  VP                  R4       \        P                  ! S P                  V3R l4       S P                  P                  VP                  R4       \        P                  ! S P                  V3R l4       S P                  P                  VP                  4       S P                  P                  S P                  P                  4       S P                  P                  4        S P                  SR4       R# )Fc                    <  SP                  R 4      p T '       d   SP                  T 4       R# SP                  SP                  P                  SP                  4       4      4       SP                  4        R#   \         d     R# i ; i)   N)recvBlockingIOErrorextendr   r3   remove_readerfilenorD   )rs   
bytes_readrr8   s    r   reader8EventLoopTestsMixin.test_reader_callback.<locals>.reader  sh    vvd|
 !!$'		 7 7
 CD	 #  s   A9 9BBs   abcc                      < \        S 4      ^8  #    rq   r  s   r   <lambda>:EventLoopTestsMixin.test_reader_callback.<locals>.<lambda>      J10Dr   s   defc                      < \        S 4      ^8  # )   r  r  s   r   r  r    r  r   s   abcdefN)socket
socketpairsetblocking	bytearrayr3   
add_readerr  r  r:   r   	run_untilrD   r  r  r  )r8   wr  r  r  s   f  @@r   test_reader_callback(EventLoopTestsMixin.test_reader_callback  s      "1	e[
	 			QXXZ0		AFFF+TYY(DE		AFFF+TYY(DE		AGG$		DIINN+		Y/r   c                z  a a \         P                  ! 4       w  poSP                  R 4       V V3R lpRpS P                  P	                  SP                  4       W#4       S P                  P                  4        S P                  S P                  P                  SP                  4       4      4       S P                  S P                  P                  SP                  4       4      4       SP                  4        VP                  \        V4      ^,          4      pVP                  4        S P                  WC4       R# )Fc                 ^   < SP                  V 4       SP                  P                  4        R # r   )r:   r3   r  )rs   r8   r  s   &r   writer8EventLoopTestsMixin.test_writer_callback.<locals>.writer"  s    FF4LIINNr   Ns   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)r  r  r  r3   
add_writerr  r  r   remove_writerrI  rD   r  rq   r  )r8   r  r  rs   readr  s   f    @r   test_writer_callback(EventLoopTestsMixin.test_writer_callback  s      "1	e	 		QXXZ6				//
;<00<=		vvc$i!m$		$r   SIGKILLz
No SIGKILLc                z  a ^ oV3R lpV P                  \        V P                  P                  RV4       V P                  \        V P                  P                  R4       V P                  \
        V P                  P                  \        P                  ^,           V4       V P                  \
        V P                  P                  \        P                  ^,           4       V P                  \
        V P                  P                  ^ V4       V P                  \
        V P                  P                  ^ 4       V P                  \
        V P                  P                  RV4       V P                  \
        V P                  P                  R4       V P                  \        V P                  P                  \        P                  V4       V P                  V P                  P	                  \        P                  4      4       V P                  P                  \        P                  V4       \        P                  ! \        P                  ! 4       \        P                  4       \        P                   ! V P                  V3R l4       V P#                  V P                  P	                  \        P                  4      4       V P%                  \        P&                  ! \        P                  4      \        P(                  4       V P                  V P                  P	                  \        P                  4      4       R# )r   c                     < S ^,          o R# r=  r   caughts   r   
my_handler?EventLoopTestsMixin.test_add_signal_handler.<locals>.my_handler6  s    aKFr   boomc                     < S # r   r   r  s   r   r  =EventLoopTestsMixin.test_add_signal_handler.<locals>.<lambda>U  s    r   N)r   	TypeErrorr3   add_signal_handlerremove_signal_handler
ValueErrorsignalNSIGr   r  rI  SIGINToskillgetpidr   r  r   r  	getsignaldefault_int_handlerr8   r  r  s   & @r   test_add_signal_handler+EventLoopTestsMixin.test_add_signal_handler2  s    	
 	tyy33VZ	Ityy66	@		44fkk!m	 			77Q	H		44a	E		77	<		44b*	F		77	=$))66	 	88HI		$$V]]J?
		V]]+TYY7 			77FG))&--833	5 	88GHr   SIGALRMz
No SIGALRM	setitimerzneed signal.setitimer()c                t  a a ^ oVV 3R lpS P                   P                  \        P                  V4       \        P                  ! \        P
                  R^ 4       S P                   P                  ^<S P                   P                  4       S P                   P                  4        S P                  S^4       R# )r   c                  N   < S ^,          o SP                   P                  4        R# r=  )r3   r  )r  r8   s   r   r  LEventLoopTestsMixin.test_signal_handling_while_selecting.<locals>.my_handlere  s    aKFIINNr   {Gz?N
r3   r  r  r  r  ITIMER_REALr  r  r  r  r  s   f @r   $test_signal_handling_while_selecting8EventLoopTestsMixin.test_signal_handling_while_selecting^  s}    
 	
 			$$V^^Z@++T15		R0		#r   c                  a aa Ro^ oVV V3R lpS P                   P                  ! \        P                  V.SO5!   \        P                  ! \        P
                  R^ 4       S P                   P                  ^<S P                   P                  4       S P                   P                  4        S P                  S^4       R# )*   c                  r   < S^,          oSP                  V S4       SP                  P                  4        R# r=  )r  r3   r  )r  r  r8   	some_argss   *r   r  AEventLoopTestsMixin.test_signal_handling_args.<locals>.my_handlerx  s*    aKFT9-IINNr   r   N)r  r  )r8   r  r  r  s   f @@r   test_signal_handling_args-EventLoopTestsMixin.test_signal_handling_argsq  s     		 			$$V^^ZL)L++S!4		R0		#r   Tc                   V P                   P                  V4      w  r4V P                  V\        P                  4       V P                  V\        P
                  4       V P                  VP                  V4       V'       d!   V P                  VP                  R 4      4       V P                   P                  VP                  4       V P                  VP                  ^ 4       VP                  4        R# )socknameN)r3   r2   rF  r   	TransportProtocolassertIsrU   assertIsNotNoneget_extra_inforZ   assertGreaterrW   rD   )r8   connection_futcheck_socknametrprs   &&&  r   _basetest_create_connection/EventLoopTestsMixin._basetest_create_connection  s    --n=b'"3"34b'"2"23bllB'  !2!2:!>?		$$RWW-299a(

r   c                   a  \         P                  ! 4       ;_uu_ 4       pS P                  P                  ! V 3R  l.VP                  O5!  pS P                  V4       RRR4       R#   + '       g   i     R# ; i)c                  0   < \        S P                  R 7      # r3   r   r3   rC   s   r   r  <EventLoopTestsMixin.test_create_connection.<locals>.<lambda>      TYY/r   N)r   run_test_serverr3   create_connectionaddressr  )r8   httpdconn_futs   f  r   test_create_connection*EventLoopTestsMixin.test_create_connection  sV    ''))Uyy22/A27--AH,,X6 *)))s   >A''A8	c                  a  \        4       '       * p\        P                  ! 4       ;_uu_ 4       pS P                  P	                  V 3R  lVP
                  4      pS P                  W14       RRR4       R#   + '       g   i     R# ; i)c                  0   < \        S P                  R 7      # r  r  rC   s   r   r  AEventLoopTestsMixin.test_create_unix_connection.<locals>.<lambda>  r  r   N)r'   r   run_test_unix_serverr3   create_unix_connectionr  r  )r8   r  r  r  s   f   r   test_create_unix_connection/EventLoopTestsMixin.test_create_unix_connection  s\     566,,..%yy77/@H,,XF /...s   <A44B	Nc                   V'       d!   V P                  VP                  R 4      4       V'       d#   V P                  VVP                  R4      4       M V P                  VP                  R4      4       V P                  VVP                  R4      4       VP                  R4      pV P                  V\        4       V P                  \        V4      ^V4       V P                  V^ ,          \        4       V P                  V^,          \        4       V P                  V^,          \        4       VP                  R4      pV P                  V4       V P                  VP                  4       VP                  R4      4       V P                  VP                  4       VP                  R4      4       V P                  VP                  4       VP                  R4      4       V P                  VP                  4       VP                  R4      4       R# )r  peernamepeercertcipher
ssl_objectcompressionN)r  r  r  rF  r"   rq   strr$   r	  r  getpeercert)r8   clientr  r  r  r  sslobjs   &&&&&  r   check_ssl_extra_info(EventLoopTestsMixin.check_ssl_extra_info  s     !6!6z!BCX#22:>@   !6!6z!BC..z:	< &&x0fe,Va0fQi-fQi-fQi- &&|4V$++-..}=	?..x8	:++-..z:	<++-..}=	?r   c                   V P                   P                  V4      w  rEV P                  V\        P                  4       V P                  V\        P
                  4       V P                  R VP                  P                  P                  4       9   4       V P                  WBV4       V P                   P                  VP                  4       V P                  VP                  ^ 4       VP                  4        R# )sslN)r3   r2   rF  r   r  r  r   r   rI   lowerr  rZ   r  rW   rD   )r8   r  r  r  r  r  s   &&&&  r   _basetest_create_ssl_connection3EventLoopTestsMixin._basetest_create_ssl_connection  s     --n=b'"3"34b'"2"23!6!6!<!<!>>?!!"h?		$$RWW-299a(

r   c           	     B  a  V! \         P                  ! 4       R 7      pS P                  WSV4       \        \        R4      '       d   \        P
                  P                  3RRRRRR/V 3R lllp\        P                  ! RVR7      ;_uu_ 4       pV! R	R 7      pS P                  WSV4       S P                  VP                  ^4       RRR4       S P                  \        P                  4      ;_uu_ 4       pV! R	R 7      p\         P                  ! 4       ;_uu_ 4        S P                  WSV4       RRR4       RRR4       S P                  XP                  P                  R
4       R#   + '       g   i     L; i  + '       g   i     LS; i  + '       g   i     L^; i)r  PurposecafileNcapathcadatac                   < SP                  V \        P                  P                  4       \        P
                  ! 4       # r   )r  r  r  SERVER_AUTHr   dummy_ssl_context)purposer  r  r  r8   s   &$$$r   _dummy_ssl_create_contextREventLoopTestsMixin._test_create_ssl_connection.<locals>._dummy_ssl_create_context  s.       #++*A*AB!3355r   zssl.create_default_context)side_effectTCERTIFICATE_VERIFY_FAILED)r   r  r  hasattrr  r  r  r   patchr  
call_countr   SSLErrordisable_logger	exceptionreason)	r8   r  r  r  r  r  r  mcms	   f&&&&    r   _test_create_ssl_connection/EventLoopTestsMixin._test_create_ssl_connection  sG   $)E)E)GH,,X-5	7 3	""25++2I2I 6156>B6156 6 8(AC CFG,644X5=?  q1C s||,,(T2H**,,44X5=? - - 	,,.IJ!C C -, -,s0   8E(6'FE;	0F(E8	;FFF	zNo ssl modulec                0  a  \         P                  ! R R7      ;_uu_ 4       p\        P                  ! S P                  P
                  V 3R l.VP                  O5!  pS P                  WVP                  R7       RRR4       R#   + '       g   i     R# ; i)Tuse_sslc                  0   < \        S P                  R 7      # r  r  rC   s   r   r  @EventLoopTestsMixin.test_create_ssl_connection.<locals>.<lambda>  r  r   r  N)r   r  	functoolspartialr3   r  r  r,  )r8   r  r  s   f  r   test_create_ssl_connection.EventLoopTestsMixin.test_create_ssl_connection  ss    ''55 ) 1 1		++/!  !  ,,U6;mm - E 6555s   ABB	c           	     R  a  \        4       '       * p\        P                  ! R R7      ;_uu_ 4       p\        P                  ! S P
                  P                  V 3R lVP                  RR7      pS P                  W#VVP                  R7       RRR4       R#   + '       g   i     R# ; i)Tr/  c                  0   < \        S P                  R 7      # r  r  rC   s   r   r  EEventLoopTestsMixin.test_create_ssl_unix_connection.<locals>.<lambda>  r  r   	127.0.0.1)server_hostnamer3  N)	r'   r   r   r4  r5  r3   r  r  r,  )r8   r  r  r  s   f   r   test_create_ssl_unix_connection3EventLoopTestsMixin.test_create_ssl_unix_connection  s~    
 566,,T::e ) 1 1		00/ +!-
 ,,U-;6;mm - E ;:::s   ABB&	c                  a  \         P                  ! 4       ;_uu_ 4       p\        P                  ! 4       pS P                  P
                  ! V 3R  l.VP                  O5RVP                  ^ ,          V3/ pS P                  P                  V4      w  rEVP                  P                  R4      ^,          pS P                  W&4       VP                  4        RRR4       R#   + '       g   i     R# ; i)c                  0   < \        S P                  R 7      # r  r  rC   s   r   r  GEventLoopTestsMixin.test_create_connection_local_addr.<locals>.<lambda>  r  r   
local_addrr  N)r   r  r   find_unused_portr3   r  r  r2   rU   r  r  rD   )r8   r  portfr  r  rc   s   f      r   !test_create_connection_local_addr5EventLoopTestsMixin.test_create_connection_local_addr  s    ''))U 113D		++/EE,1MM!,<d+CEA YY11!4FB||22:>qAHT,HHJ *)))s   B7C  C1	c                  a aa \         P                  ! 4       p\         P                  ! 4       oS P                  P                  oVV3R  lpVS P                  n        S P                  P	                  V 3R lRVRS3R7      pS P                  \        4      ;_uu_ 4        S P                  P                  V4       RRR4       R#   + '       g   i     R# ; i)c                    <"   VS8X  dG   \         P                  \         P                  ^ RR3\         P                  \         P                  ^ RR3.# S! W.VO5/ VB G Rj  xL
 #  L5i)r    N::1r   r   r   r;  r   )r  AF_INET6SOCK_STREAMAF_INEThostrD  r  kwargsgetaddrinfo_origport2s   &&*,r   getaddrinfo`EventLoopTestsMixin.test_create_connection_local_addr_skip_different_family.<locals>.getaddrinfo  sf     u}&*<*<aEUV););QDTUW W)$FtFvFFFFs   AA' A%!A'c                  0   < \        S P                  R 7      # r  r  rC   s   r   r  ]EventLoopTestsMixin.test_create_connection_local_addr_skip_different_family.<locals>.<lambda>(      G+r   	localhostrB  Nr   rC  r3   rV  r  r   OSErrorr2   r8   port1rV  rE  rT  rU  s   f   @@r   7test_create_connection_local_addr_skip_different_familyKEventLoopTestsMixin.test_create_connection_local_addr_skip_different_family  s     ..0..09900	G !,		II''+K+? ( A w''II((+ ('''   CC	c                  a aa \         P                  ! 4       p\         P                  ! 4       oS P                  P                  oVV3R  lpVS P                  n        S P                  P	                  V 3R lRVRS3R7      pS P                  \        4      ;_uu_ 4        S P                  P                  V4       RRR4       R#   + '       g   i     R# ; i)c                    <"   VS8X  d%   \         P                  \         P                  ^ RR3.# S! W.VO5/ VB G Rj  xL
 #  L5i)r   rJ  NrK  )r  rN  rO  rQ  s   &&*,r   rV  YEventLoopTestsMixin.test_create_connection_local_addr_nomatch_family.<locals>.getaddrinfo5  sG     u}&*<*<aEUVWW)$FtFvFFFFs   ;AAAc                  0   < \        S P                  R 7      # r  r  rC   s   r   r  VEventLoopTestsMixin.test_create_connection_local_addr_nomatch_family.<locals>.<lambda>=  rZ  r   r[  r\  Nr]  r_  s   f   @@r   0test_create_connection_local_addr_nomatch_familyDEventLoopTestsMixin.test_create_connection_local_addr_nomatch_family.  s     ..0..09900	G
 !,		II''+K+? ( A w''II((+ ('''rc  c           	     n  a  \         P                  ! 4       ;_uu_ 4       pS P                  P                  ! V 3R  l.VP                  O5RVP                  / pS P                  \        4      ;_uu_ 4       pS P                  P                  V4       RRR4       S P                  XP                  P                  \        P                  4       S P                  \        VP                  4      VP                  P                  4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)c                  0   < \        S P                  R 7      # r  r  rC   s   r   r  NEventLoopTestsMixin.test_create_connection_local_addr_in_use.<locals>.<lambda>F  r  r   rB  N)r   r  r3   r  r  r   r^  r2   r  r(  errno
EADDRINUSEassertInr
  strerror)r8   r  rE  r+  s   f   r   (test_create_connection_local_addr_in_use<EventLoopTestsMixin.test_create_connection_local_addr_in_useC  s    ''))U		++/::+0==:A ""7++r		,,Q/ ,R\\//1A1ABMM#emm,bll.C.CD *) ,+	 *))s%   AD#5D	A5D#D D##D4	c                $  aa	a
aaaa V P                   o ! V
V3R  lR\        4      p\        P                  ! R^R7      pVP	                  4       o	RoRoRo
V	VVV3R lp\
        P                  ! VRR7      pVP                  4        VP                  4       w  rxV! SR	7      oSSn         SP                  SP                  V3R
 lWqR7      4       SP                  4        SP                  P                  4        VP                  4        \        P                  ! V4       V P!                  VP#                  4       4       V P%                  SP&                  R4       V P%                  SP(                  \+        S4      4       V P%                  SS
4       R# )c                   D   <a a ] tR tRt oV V3R ltV V3R ltRtVtV ;t# )AEventLoopTestsMixin.test_connect_accepted_socket.<locals>.MyProtoiP  c                \   < \         SV `  V4       SP                  SP                  4       R # r   )r   r}   r  r  )r8   r?   r   r3   s   &&r   r}   QEventLoopTestsMixin.test_connect_accepted_socket.<locals>.MyProto.connection_lostR  s     ',tyy)r   c                \   < \         SV `  V4       V P                  P                  S4       R # r   )r   rt   rU   r   )r8   rs   r   expected_responses   &&r   rt   OEventLoopTestsMixin.test_connect_accepted_socket.<locals>.MyProto.data_receivedV  s#    %d+$$%67r   r   )	rI   rJ   rK   rL   r}   rt   rM   rN   r   )r   rP   rz  r3   s   @@r   r   rv  P  s     *8 8r   r   )backlogs	   test dataNs   rogerc                  .  <  \         P                   ! 4       p Se   SP                  V 4      p V P                  S4       V P                  S4       V P	                  ^c4      oV P                  4        R #   \         d   p\        RT4        R p?R # R p?ii ; i)Nz8Failure in client thread in test_connect_accepted_socket)r  wrap_socketconnectsendallr  rD   	Exceptionprint)csockr?   r   
client_sslmessageresponses     r   r  @EventLoopTestsMixin.test_connect_accepted_socket.<locals>.clienta  sz    )&2259Ed#g& ::b> N s   A-A2 2B=BBT)r1  daemonr  c                     < S # r   r   protos   r   r  BEventLoopTestsMixin.test_connect_accepted_socket.<locals>.<lambda>x  s    r   r  r{   rM  )r3   rR   r  create_servergetsocknamer2  r5  r6  acceptr2   connect_accepted_socketr  rU   rD   r   join_threadrI  is_aliver  rV   rW   rq   )r8   
server_sslr  r   lsockr  threadconn_r   rz  r3   r  r  r  s   &&f      @@@@@@r   test_connect_accepted_socket0EventLoopTestsMixin.test_connect_accepted_socketM  sB   yy	8 	8k 	8 $$%5qA  "$	 	 !!=,,.T"
(( ) 7	8 	$$V,*+h/s7|4#45r   c                |    \         P                  ! 4       p\         P                  ! 4       pV P                  W4       R # r   )r   simple_server_sslcontextsimple_client_sslcontextr  )r8   server_contextclient_contexts   &  r    test_ssl_connect_accepted_socket4EventLoopTestsMixin.test_ssl_connect_accepted_socket  s,    #<<>#<<>)).Ir   c                r   \         P                   ! 4       pV P                  VP                  4       V P                  P	                  \
        V\        P                  R 7      pV P                  \        R4      ;_uu_ 4        V P                  P                  V4       RRR4       R#   + '       g   i     R# ; i))ssl_handshake_timeoutz1ssl_handshake_timeout is only meaningful with sslN)r  
addCleanuprD   r3   r  r   r
   LOOPBACK_TIMEOUTassertRaisesRegexr  r2   )r8   sockcoros   &  r   9test_connect_accepted_socket_ssl_timeout_for_plain_socketMEventLoopTestsMixin.test_connect_accepted_socket_ssl_timeout_for_plain_socket  s    }}

#yy00T1I1I 1 K##CE E II((.E E E Es   ?B%%B6	zasyncio.base_events.socketc                *  a aa V3R  loVV 3R lp\        V4      pS\        P                  8X  d2   V Uu. uF  qf^P3NK  	  upVP                  4       P                  n        M2V Uu. uF  qf^P^ ^ 3NK
  	  upVP                  4       P                  n        VS P
                  n        \        P                  ! 4       S P
                  n	        \        P                  ! 4       S P
                  n
        S P
                  P                  V 3R lV^P4      pS P
                  P                  V4      pS P                  VP                  4       VP                   U	u0 uF  qP                  4       ^ ,          kK  	  p
p	S P!                  W4       R# u upi u upi u up	i )c                    <"   S\         P                  8X  d   S\         P                  ^RW33.# S\         P                  ^RW^ ^ 33.# 5i)r  rJ  )r  rP  rO  )rR  rD  r  kwfamilys   &&*,r   rV  EEventLoopTestsMixin.create_server_multiple_hosts.<locals>.getaddrinfo  sO     '!3!3QTLIJJ!3!3QTA<NOPPs   AA	c                  F   < SP                   P                  S! V / VB 4      # r   )r3   create_task)r  kwdsrV  r8   s   *,r   getaddrinfo_taskJEventLoopTestsMixin.create_server_multiple_hosts.<locals>.getaddrinfo_task  s"    99((d)Cd)CDDr   c                  .   < \        S P                  4      # r   r  rC   s   r   r  BEventLoopTestsMixin.create_server_multiple_hosts.<locals>.<lambda>  s    GDII,>r   N)r   r  rP  getsockbynamer!  r3   rV  r   Mock_start_serving_stop_servingr  r2   r  rD   socketsr  )r8   r  hosts	mock_sockr  unique_hostsrR  rE  serverr  server_hostsrV  s   ff&&       @r   create_server_multiple_hosts0EventLoopTestsMixin.create_server_multiple_hosts  s9   	Q	E 5zV^^#'3<5'3tr
|<5I,,8 .:<;-9Tr1a \<;I,,8 0		#'99;		 "&))+		II##$>rJ--a0%<BNNKND**,Q//NK4<5<; Ls   F&FFc                J    V P                  \        P                  . RO4       R# )1.2.3.4N)r  z5.6.7.8r  )r  r  rP  rC   s   &r   &test_create_server_multiple_hosts_ipv4:EventLoopTestsMixin.test_create_server_multiple_hosts_ipv4  s    ))&..*K	Mr   c                J    V P                  \        P                  . RO4       R# )rL  N)rL  z::2rL  )r  r  rN  rC   s   &r   &test_create_server_multiple_hosts_ipv6:EventLoopTestsMixin.test_create_server_multiple_hosts_ipv6  s    ))&//*?	Ar   c                  a \        V P                  4      oV P                  P                  V3R  lR^ 4      pV P                  P                  V4      pV P	                  \        VP                  4      ^4       VP                  ^ ,          pVP                  4       w  rEV P	                  VR4       \        P                  ! 4       pVP                  RV34       VP                  R4       V P                  P                  SP                  4       V P	                  RSP                  4       \        P                  ! V P                  V3R l4       V P	                  ^SP                  4       V P!                  SP"                  P%                  R4      4       V P	                  RSP"                  P%                  R4      ^ ,          4       SP"                  P'                  4        V P                  P                  SP(                  4       V P	                  RSP                  4       VP'                  4        VP'                  4        R	# )
c                     < S # r   r   r  s   r   r  8EventLoopTestsMixin.test_create_server.<locals>.<lambda>      Er   0.0.0.0r;     xxxrh   c                  "   < S P                   ^ 8  # r   rW   r  s   r   r  r        q0@r   r  r  r{   N)r   r3   r  r2   r  rq   r  r  r  r  r  rY   rV   r   r  rW   r  rU   r  rD   rZ   )r8   rE  r  r  rR  rD  r  r  s   &      @r   test_create_server&EventLoopTestsMixin.test_create_server  s   		"II##M9a@--a0V^^,a0~~a %%'
y)T*+v		$$U__5ekk2TYY(@AELL) 	U__;;JGH77
CAF	H 			$$UZZ05;;/ 	 	r   c                V  a \        V P                  4      oV P                  P                  V3R  lR^ 4      pV P                  P                  V4      pV P	                  \        VP                  4      ^4       VP                  ^ ,          pV P                  V\        P                  P                  4       VP                  4       w  rEV P	                  VR4       VP                  4       pV P                  VP                  4       V P                  V\        P                  4       V P!                  VP#                  4       4       V P%                  \&        4      ;_uu_ 4        VP)                  ^4       RRR4       VP)                  ^ 4       V P	                  VP+                  4       ^ 4       V P%                  \&        4      ;_uu_ 4        VP-                  R4       RRR4       VP-                  R4       VP                  4        R#   + '       g   i     L; i  + '       g   i     LF; i)c                     < S # r   r   r  s   r   r  ?EventLoopTestsMixin.test_create_server_trsock.<locals>.<lambda>  r  r   r  NTF)r   r3   r  r2   r  rq   r  rF  r   trsockTransportSocketr  dupr  rD   r  rI  get_inheritabler   r  
settimeout
gettimeoutr  )r8   rE  r  r  rR  rD  r  r  s   &      @r   test_create_server_trsock-EventLoopTestsMixin.test_create_server_trsock  sv   		"II##M9a@--a0V^^,a0~~a dGNN$B$BC%%'
y)hhj		"c6==1--/0z**OOA +*A.z**T" + +* +*s    HHH	H(	SO_REUSEPORTzNo SO_REUSEPORTc                  a \        V P                  4      oV P                  P                  V3R  lR^ 4      pV P                  P                  V4      pV P	                  \        VP                  4      ^4       VP                  ^ ,          pV P                  VP                  \        P                  \        P                  4      4       VP                  4        \        P                  ! V P                  4       \        V P                  4      oV P                  P                  V3R lR^ RR7      pV P                  P                  V4      pV P	                  \        VP                  4      ^4       VP                  ^ ,          pV P                  VP                  \        P                  \        P                  4      4       VP                  4        R# )c                     < S # r   r   r  s   r   r  CEventLoopTestsMixin.test_create_server_reuse_port.<locals>.<lambda>      Er   r  c                     < S # r   r   r  s   r   r  r    r  r   T)
reuse_portN)r   r3   r  r2   r  rq   r  rI  
getsockoptr  
SOL_SOCKETr  rD   r   r   r   )r8   rE  r  r  r  s   &   @r   test_create_server_reuse_port1EventLoopTestsMixin.test_create_server_reuse_port  sN   		"II##9a)--a0V^^,a0~~a OO!!6#6#68	9 	tyy)		"II##9aD $ :--a0V^^,a0~~a OO!!6#6#68	9 	r   c                   a \         P                  ! 4       oV P                  V3R  l4       V P                  P                  ! VS3/ VB pV P                  P                  V4      pVS3# )c                  ~   < \         P                  P                  S 4      ;'       d    \         P                  ! S 4      # r   )r  pathexistsunlink)r  s   r   r  7EventLoopTestsMixin._make_unix_server.<locals>.<lambda>  s%    t 4 H H4 Hr   )r   gen_unix_socket_pathr  r3   create_unix_serverr2   )r8   factoryrS  rE  r  r  s   &&,  @r   _make_unix_server%EventLoopTestsMixin._make_unix_server  sW    ..0HIII(($A&A--a0t|r   c                2  a \        V P                  R 7      oV P                  V3R l4      w  rV P                  \	        VP
                  4      ^4       \        P                  ! \        P                  4      pVP                  V4       VP                  R4       V P                  P                  SP                  4       V P                  RSP                  4       \        P                  ! V P                  V3R l4       V P                  ^SP                  4       SP                   P#                  4        V P                  P                  SP$                  4       V P                  RSP                  4       VP#                  4        VP#                  4        R# )r  c                     < S # r   r   r  s   r   r  =EventLoopTestsMixin.test_create_unix_server.<locals>.<lambda>  s    er   r  rh   c                  "   < S P                   ^ 8  # r  r  r  s   r   r  r  "  r  r   r{   N)r   r3   r  r  rq   r  r  AF_UNIXr  r  r2   rY   rV   r   r  rW   rU   rD   rZ   )r8   r  r  r  r  s   &   @r   test_create_unix_server+EventLoopTestsMixin.test_create_unix_server  s   TYY'--m<V^^,a0v~~.tv		$$U__5ekk2TYY(@AELL) 			$$UZZ05;;/ 	 	r   r  zNo UNIX Socketsc           	       a \        V P                  R 7      o\        P                  ! 4       pT;_uu_ 4        V P                  P                  V3R lRVR7      pV P	                  \
        R4      ;_uu_ 4        V P                  P                  V4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r  c                     < S # r   r   r  s   r   r  OEventLoopTestsMixin.test_create_unix_server_path_socket_error.<locals>.<lambda>7  s    Ur   z/testr  z3path and sock can not be specified at the same timeN)r   r3   r  r  r  r  r2   )r8   r  rE  r  s   &  @r   )test_create_unix_server_path_socket_error=EventLoopTestsMixin.test_create_unix_server_path_socket_error2  s    TYY'}}T		,,]G$,OA''
);< < 		,,Q/< T< < TTs$   AB98B&	B9&B61B99C
	c                    \         P                  ! \         P                  4      pV;P                  \         P                  ,          un        VP                  W4       V# r   )r  
SSLContextPROTOCOL_TLS_SERVERoptionsOP_NO_SSLv2load_cert_chain)r8   certfilekeyfile
sslcontexts   &&& r   _create_ssl_context'EventLoopTestsMixin._create_ssl_context=  s?    ^^C$;$;<
coo-""85r   c                   V P                  W#4      pV P                  P                  VR ^ VR7      pV P                  P                  V4      pVP                  ^ ,          pVP                  4       w  rV P                  VR 4       WhV	3# )r;  r  )r  r3   r  r2   r  r  r  )
r8   r  r	  r
  r  rE  r  r  rR  rD  s
   &&&&      r   _make_ssl_server$EventLoopTestsMixin._make_ssl_serverC  s|    --h@
II##G[!#L--a0~~a %%'
{+T!!r   c                H    V P                  W#4      pV P                  WR 7      # )r  )r  r  )r8   r  r	  r
  r  s   &&&& r   _make_ssl_unix_server)EventLoopTestsMixin._make_ssl_unix_serverN  s&    --h@
%%g%>>r   c                  a \        V P                  R 7      oV P                  V3R l\        P                  \        P
                  4      w  rpV P                  P                  \        W#\        P                  ! 4       R7      pV P                  P                  V4      w  rVVP                  R4       V P                  P                  SP                  4       V P                  RSP                  4       \        P                  ! V P                  V3R l4       V P                  ^SP                  4       V P!                  WRV3R7       SP"                  P%                  4        V P                  P                  SP&                  4       V P                  RSP                  4       VP%                  4        VP%                  4        R# )	r  c                     < S # r   r   r  s   r   r  <EventLoopTestsMixin.test_create_server_ssl.<locals>.<lambda>V  r  r   r  r  rh   c                  "   < S P                   ^ 8  # r  r  r  s   r   r  r  `  r  r   r3  r{   N)r   r3   r  r   ONLYCERTONLYKEYr  rR   r  r2   r   rY   r  rV   r  rW   r  rU   rD   rZ   )r8   r  rR  rD  f_cr  r  r  s   &      @r   test_create_server_ssl*EventLoopTestsMixin.test_create_server_sslR  sD   TYY'!22:..
0B0BDd ii))+t.8.J.J.L * NYY11#6
V		$$U__5ekk2TYY(@AELL) 	!!&$<!@ 			$$UZZ05;;/ 	 	r   c                `  a \        V P                  R 7      oV P                  V3R l\        P                  \        P
                  4      w  rV P                  P                  \        V\        P                  ! 4       RR7      pV P                  P                  V4      w  rEVP                  R4       V P                  P                  SP                  4       V P                  RSP                  4       \        P                  ! V P                  V3R l4       V P                  ^SP                  4       SP                   P#                  4        V P                  P                  SP$                  4       V P                  RSP                  4       VP#                  4        VP#                  4        R# )	r  c                     < S # r   r   r  s   r   r  AEventLoopTestsMixin.test_create_unix_server_ssl.<locals>.<lambda>w  r  r   rJ  r  r<  r  rh   c                  "   < S P                   ^ 8  # r  r  r  s   r   r  r    r  r   r{   N)r   r3   r  r   r  r  r  rR   r  r2   r   rY   r  rV   r  rW   rU   rD   rZ   )r8   r  r  r  r  r  r  s   &     @r   test_create_unix_server_ssl/EventLoopTestsMixin.test_create_unix_server_sslr  s0    TYY'11:..
0B0BD ii..:#?#?#A /   YY11#6
V		$$U__5ekk2TYY(@AELL) 			$$UZZ05;;/ 	 	r   c                  a \        V P                  R 7      oV P                  V3R l\        P                  4      w  rp\
        P                  ! \
        P                  4      pV;P                  \
        P                  ,          un        \
        P                  Vn        \        VR4      '       d   RVn        V P                  P                  \         W#VR7      p\        P                   P#                  V P                  R4      ;_uu_ 4        \        P$                  ! 4       ;_uu_ 4        V P'                  \
        P(                  R4      ;_uu_ 4        V P                  P+                  V4       RRR4       RRR4       \        P,                  ! V P                  4       RRR4       V P/                  SP0                  4       VP3                  4        R#   + '       g   i     Lm; i  + '       g   i     Lx; i  + '       g   i     Lc; i)r  c                     < S # r   r   r  s   r   r  JEventLoopTestsMixin.test_create_server_ssl_verify_failed.<locals>.<lambda>  r  r   check_hostnameTr  call_exception_handler(?i)certificate.verify.failedN)r   r3   r  r   SIGNED_CERTFILEr  r  PROTOCOL_TLS_CLIENTr  r  CERT_REQUIREDverify_moder#  r'  r  r   r$  objectr'  r  r&  r2   r   assertIsNonerU   rD   )r8   r  rR  rD  sslcontext_clientr  r  s   &     @r   $test_create_server_ssl_verify_failed8EventLoopTestsMixin.test_create_server_ssl_verify_failed  sd   TYY'!22:557d  NN3+B+BC!!S__4!(+(9(9%$&677/3, ii))'4.? * AZZtyy*BCC**,,++CLL,KM MII005M - ""499- D 	%//*M M -, DC<   G:*)G'	G/G'	7(G:G$G'	'G72G::H
	c                  a \        V P                  R 7      oV P                  V3R l\        P                  4      w  r\
        P                  ! \
        P                  4      pV;P                  \
        P                  ,          un        \
        P                  Vn        \        VR4      '       d   RVn        V P                  P                  \         VVRR7      p\        P                   P#                  V P                  R4      ;_uu_ 4        \        P$                  ! 4       ;_uu_ 4        V P'                  \
        P(                  R4      ;_uu_ 4        V P                  P+                  V4       RRR4       RRR4       \        P,                  ! V P                  4       RRR4       V P/                  SP0                  4       VP3                  4        R#   + '       g   i     Lm; i  + '       g   i     Lx; i  + '       g   i     Lc; i)	r  c                     < S # r   r   r  s   r   r  OEventLoopTestsMixin.test_create_unix_server_ssl_verify_failed.<locals>.<lambda>  r  r   r'  Tinvalidr   r(  r)  N)r   r3   r  r   r*  r  r  r+  r  r  r,  r-  r#  r'  r  r   r$  r.  r'  r  r&  r2   r   r/  rU   rD   )r8   r  r  r0  r  r  s   &    @r   )test_create_unix_server_ssl_verify_failed=EventLoopTestsMixin.test_create_unix_server_ssl_verify_failed  sh    TYY'11:557  NN3+B+BC!!S__4!(+(9(9%$&677/3, ii..w3D?H / J ZZtyy*BCC**,,++CLL,KM MII005M - ""499- D 	%//*M M -, DCr3  c                d  a \        V P                  R 7      oV P                  V3R l\        P                  4      w  rp\
        P                  ! \
        P                  4      pV;P                  \
        P                  ,          un        \
        P                  Vn        VP                  \        P                  R7       \        VR4      '       d   RVn        V P                  P!                  \         W#VR7      p\"        P$                  ! R\"        P&                  4      p\(        P*                  P-                  V P                  R4      ;_uu_ 4        \        P.                  ! 4       ;_uu_ 4        V P1                  \
        P2                  V4      ;_uu_ 4        V P                  P5                  V4       RRR4       RRR4       RRR4       V P7                  SP8                  4       VP;                  4        R#   + '       g   i     LM; i  + '       g   i     LX; i  + '       g   i     Lc; i)	r  c                     < S # r   r   r  s   r   r  IEventLoopTestsMixin.test_create_server_ssl_match_failed.<locals>.<lambda>  r  r   r  r'  Tr  z(
            IP address mismatch, certificate is not valid for '127.0.0.1'   # OpenSSL
            |
            CERTIFICATE_VERIFY_FAILED                                       # AWS-LC
        )r(  N)r   r3   r  r   r*  r  r  r+  r  r  r,  r-  load_verify_locations
SIGNING_CAr#  r'  r  recompileXr   r$  r.  r'  r  CertificateErrorr2   r/  rU   rD   )r8   r  rR  rD  r0  r  regexr  s   &      @r   #test_create_server_ssl_match_failed7EventLoopTestsMixin.test_create_server_ssl_match_failed  s   TYY'!22:557d  NN3+B+BC!!S__4!(+(9(9%//(( 	0 	*$&677/3, ii))'4.? * A 

  dd	
 ZZtyy*BCC**,,++C,@,@%HHII005 I - D 	%//* IH -, DCs<   H/)H	G94H	<H9H	H	HHH/	c                :  a \        V P                  R 7      oV P                  V3R l\        P                  4      w  r\
        P                  ! \
        P                  4      pV;P                  \
        P                  ,          un        \
        P                  Vn        VP                  \        P                  R7       \        VR4      '       d   RVn        V P                  P!                  \         VVRR7      pV P                  P#                  V4      w  rVV P                  P#                  SP$                  4       SP&                  P)                  4        VP)                  4        VP)                  4        V P                  P#                  SP*                  4       R# )r  c                     < S # r   r   r  s   r   r  JEventLoopTestsMixin.test_create_unix_server_ssl_verified.<locals>.<lambda>  r  r   r=  r'  Tr[  r   N)r   r3   r  r   r*  r  r  r+  r  r  r,  r-  r>  r?  r#  r'  r  r2   rY   rU   rD   rZ   )r8   r  r  r0  r  r  r  r  s   &      @r   $test_create_unix_server_ssl_verified8EventLoopTestsMixin.test_create_unix_server_ssl_verified  s(    TYY'11:557  NN3+B+BC!!S__4!(+(9(9%//z7L7L/M$&677/3, ii..w3D?J / L YY11#6
		$$U__5 			$$UZZ0r   c                  a \        V P                  R 7      oV P                  V3R l\        P                  4      w  rp\
        P                  ! \
        P                  4      pV;P                  \
        P                  ,          un        \
        P                  Vn        VP                  \        P                  R7       \        VR4      '       d   RVn        V P                  P!                  \         W#VRR7      pV P                  P#                  V4      w  rgV P                  P#                  SP$                  4       V P'                  WbV3\        P(                  R7       SP*                  P-                  4        VP-                  4        VP-                  4        V P                  P#                  SP.                  4       R# )	r  c                     < S # r   r   r  s   r   r  EEventLoopTestsMixin.test_create_server_ssl_verified.<locals>.<lambda>  r  r   r=  r'  Tr[  r   )r  r  N)r   r3   r  r   r*  r  r  r+  r  r  r,  r-  r>  r?  r#  r'  r  r2   rY   r  PEERCERTrU   rD   rZ   )	r8   r  rR  rD  r0  r  r  r  r  s	   &       @r   test_create_server_ssl_verified3EventLoopTestsMixin.test_create_server_ssl_verified	  sN   TYY'!22:557d  NN3+B+BC!!S__4!(+(9(9%//z7L7L/M$&677/3, ii))'4.?:E * G YY11#6
		$$U__5 	!!&$<+5+>+> 	" 	@ 			$$UZZ0r   c                v  a	 V P                   P                  4       o	 ! V	3R  lR\        4      p\        P                  ! R4      pV P                   P	                  WR7      pV P                   P                  V4      pVP                  ^ ,          pV P                  VP                  4       VP                  4       4       VP                  4       w  rgV P                  VR4       \        P                  ! 4       pVP                  RV34       VP                  R4       VP                  4        VP                  4        R# )c                   6   <a a ] tR tRt oV V3R ltRtVtV ;t# )@EventLoopTestsMixin.test_create_server_sock.<locals>.TestMyProtoi*  c                H   < \         SV `  V4       SP                  V 4       R # r   r   rl   rj   )r8   rU   r   r  s   &&r   rl   PEventLoopTestsMixin.test_create_server_sock.<locals>.TestMyProto.connection_made+  s    '	2  &r   r   r   )r   rP   r  s   @@r   TestMyProtorT  *  s     ' 'r   rX  r  r   r;  r  Nr  r   )r3   rX   r   r  r  r2   r  r  r  r  r  r:   rD   )
r8   rX  sock_obrE  r  r  rR  rD  r  r  s
   &        @r   test_create_server_sock+EventLoopTestsMixin.test_create_server_sock'  s    		'')	'' 	'
 &&~6II##K#>--a0~~a (89%%'
y)T*+Fr   c                f   \         P                  ! R4      pV P                  P                  \        VR7      pV P                  P	                  V4      pVP
                  ^ ,          pVP                  4       w  rVV P                  P                  \        WVR7      pV P                  \        4      ;_uu_ 4       pV P                  P	                  V4       RRR4       V P                  XP                  P                  \        P                  4       VP                  4        R#   + '       g   i     LV; i)r  r   rR  rD  NrY  )r  r  r3   r   r2   r  r  r   r^  r  r(  rn  ro  rD   )r8   rZ  rE  r  r  rR  rD  r+  s   &       r   test_create_server_addr_in_use2EventLoopTestsMixin.test_create_server_addr_in_use>  s    &&~6II##G'#:--a0~~a %%'
II##G$#Bw''2II((+ (++U-=-=>	 ('s   6D  D0	zIPv6 not supported or enabledc                  a	 V P                   P                  4       o	 ! V	3R  lR\        4      p^ p  \        P                  ! 4       pV P                   P                  VRVR7      pV P                   P                  V4      p \        P                  ! 4       pTP                  RT34       TP                  R4       T P                   P                  S	4      pTP                  P                  4        TP                  4        T P                   P                  4       o	\        P                  ! \        P                   4      pTP                  RT34       TP                  R4       T P                   P                  S	4      pTP                  P                  4        TP                  4        TP                  4        R#   \         dH   pTP                  \        P                  8X  d#   T^,          pT P                  ^T4        Rp?EK  h Rp?ii ; i)c                   6   <a a ] tR tRt oV V3R ltRtVtV ;t# )FEventLoopTestsMixin.test_create_server_dual_stack.<locals>.TestMyProtoiQ  c                H   < \         SV `  V4       SP                  V 4       R # r   rV  )r8   rU   r   f_protos   &&r   rl   VEventLoopTestsMixin.test_create_server_dual_stack.<locals>.TestMyProto.connection_madeR  s    '	2""4(r   r   r   )r   rP   re  s   @@r   rX  rc  Q  s     ) )r   rX  Nr^  r;  r  rL  )r3   rX   r   r   rC  r  r2   r^  rn  ro  r   r  r  r:   rU   rD   rN  )
r8   rX  	try_countrD  rE  r  exr  r  re  s
   &        @r   test_create_server_dual_stack1EventLoopTestsMixin.test_create_server_dual_stackM  s   ))))+	)' 	)
 	$557II++Kd+N55a8 T*+F		,,W5))))+v/t}%F		,,W51  88u///NI++Ay9s   AF8 8H
:HHH
c                
   V P                   P                  \        R ^ 4      pV P                   P                  V4      pVP                  ^ ,          pVP                  4       w  rE\        P                  ! 4       pVP                  RV34       VP                  R4       VP                  4        VP                  4        \        P                  ! 4       pV P                  \        VP                  RV34       VP                  4        R# )r  r;  r  N)r3   r  r   r2   r  r  r  r  r:   rD   r   ConnectionRefusedError)r8   rE  r  r  rR  rD  r  s   &      r   test_server_close%EventLoopTestsMixin.test_server_closev  s    II##GY:--a0~~a %%'
T*+F"FNN[$4G	Ir   c                  a a
a  ! V 3R  lR\         4      pS P                  P                  W1VR7      pS P                  P                  V4      w  poVP	                  R4      p\
        P                  ! V\
        P                  \
        P                  ,          4      w  rxS P                  V\        P                  4       S P                  SV4       S P                  RSP                  4       S P                  SP                  V4       S P                  P                  V 3R lWx3R7      pS P                  P                  V4      w  p	o
S P                  V	\        P                  4       S P                  S
\         4       S P                  RS
P                  4       S P                  S
P                  V	4       V	P!                  R4       \"        P$                  ! S P                  V3R l4       S P                  ^SP&                  4       \"        P$                  ! S P                  V
3R	 l4       S P                  ^S
P&                  4       S P)                  V	P	                  R4      4       V	P+                  4        S P                  P                  S
P,                  4       S P                  R
S
P                  4       SP                  P+                  4        R# )c                   B   <a a ] tR tRt oV V3R ltV 3R ltRtVtV ;t# )OEventLoopTestsMixin._test_create_datagram_endpoint.<locals>.TestMyDatagramProtoi  c                <   < \         SV `  SP                  R 7       R# )r  N)r   r\   r3   )
inner_selfr   r8   s   &r   r\   XEventLoopTestsMixin._test_create_datagram_endpoint.<locals>.TestMyDatagramProto.__init__  s     dii 0r   c                l   < \         SV `  W4       V P                  P                  R V,           V4       R# )s   resp:N)r   r   rU   sendto)r8   rs   r   r   s   &&&r   r   aEventLoopTestsMixin._test_create_datagram_endpoint.<locals>.TestMyDatagramProto.datagram_received  s(    )$5%%htmT:r   r   )	rI   rJ   rK   rL   r\   r   rM   rN   r   )r   rP   r8   s   @@r   TestMyDatagramProtorq    s     1; ;r   rx  )rB  r  r  r   c                  0   < \        S P                  R 7      # r  r   r3   rC   s   r   r  DEventLoopTestsMixin._test_create_datagram_endpoint.<locals>.<lambda>      O3r   )remote_addrr  c                     < S P                   # r   r  )r  s   r   r  r{    	    r   c                     < S P                   # r   r  )r  s   r   r  r{    r  r   r{   N)r   r3   create_datagram_endpointr2   r  r  getnameinfoNI_NUMERICHOSTNI_NUMERICSERVrF  r   r  r  rV   r  rU   rv  r   r  rW   r  rD   rZ   )r8   rB  r  rx  r  s_transportr  rR  rD  rU   r  r  s   f&&       @@r   _test_create_datagram_endpoint2EventLoopTestsMixin._test_create_datagram_endpoint  s"   	;/ 	; yy11v 2 G"ii::4@V--j9''f++F,A,AAC
 	k7+<+<=f&9:5f&&4yy113 2 & !II88>	6i):):;fo65f&&	2 TYY(=>FMM*TYY(=> 	FMM* 	Y55jAB 			$$V[[16<<0 r   c                F    V P                  R\        P                  4       R# )r;  NrM  )r  r  rP  rC   s   &r   test_create_datagram_endpoint1EventLoopTestsMixin.test_create_datagram_endpoint  s    ++,<fnnMr   c                F    V P                  R\        P                  4       R# )rL  N)rL  r   )r  r  rN  rC   s   &r   "test_create_datagram_endpoint_ipv66EventLoopTestsMixin.test_create_datagram_endpoint_ipv6  s    ++JHr   c                  a  R pRpS P                   P                  S P                   P                  ! VR\        P                  / 4      pV FB  w  rErgp \        P                  ! WEVR7      pVP                  R4       VP                  V4        M	  S P                  R4       S P                   P                  V 3R lVR7      p	S P                   P                  V	4      w  rS P                  V
\        P                  4       S P                  V\        4       V
P                  4        S P                   P                  VP                  4       R #     EK  ; i)Ntype)r  r  r  FzCan not create socket.c                  0   < \        S P                  R 7      # r  rz  rC   s   r   r  HEventLoopTestsMixin.test_create_datagram_endpoint_sock.<locals>.<lambda>  r|  r   r   rM  )r3   r2   rV  r  
SOCK_DGRAMr  bindfailr  rF  r   r  r   rD   rZ   )r8   r  local_addressinfosr  r  r  cnamer  rE  r  r  s   f           r   "test_create_datagram_endpoint_sock6EventLoopTestsMixin.test_create_datagram_endpoint_sock  s   (		,,II!!8%+%6%689 49/F%}}FUK  '		'"  49 II./II..3$ / @--a0b'"3"34b/2

		$$RWW-s   :EEc                  a V P                   o ! V3R  lR\        P                  4      pR pV! 4       pSP                  SP	                  WR7      4      w  rEVP                  4       pV! 4       pSP                  SP	                  WR7      4      w  rVP                  4       p
V! 4       pSP                  SP	                  WR7      4      w  rVP                  4       pVP                  4        VP                  RV
R7       V P                  SP                  V	P                  4       4      R4       VP                  RVR7       V P                  SP                  VP                  4       4      R4       VP                  RVR7       SP                  \        P                  ! ^ 4      4       VP                  RVR7       V P                  SP                  VP                  4       4      R4       VP                  4        VP                  4        R	# )
c                   8   <a  ] tR tRt o RtR tV3R ltRtV tR# )QEventLoopTestsMixin.test_datagram_send_to_non_listening_address.<locals>.Protocoli  Nc                <    V P                   P                  V4       R # r   )_received_datagramrj   r   s   &&&r   r   cEventLoopTestsMixin.test_datagram_send_to_non_listening_address.<locals>.Protocol.datagram_received  s    ''2248r   c                   <"   SP                  4       V n        \        P                  ! V P                  ^
4      G Rj  xL
 pRV n        V#  L5i)r   N)rX   r  r   wait_for)r8   r^  r3   s   & r   wait_for_datagram_receivedlEventLoopTestsMixin.test_datagram_send_to_non_listening_address.<locals>.Protocol.wait_for_datagram_received  sE     *.*<*<*>'&//0G0GLL*.' Ms   :AAA)r  )	rI   rJ   rK   rL   r  r   r  rM   rN   )rP   r3   s   @r   r  r    s     !%9 r   r  c                      \         P                   ! \         P                  \         P                  4      p V P                  R 4       V P	                  R4       V # )FrM  )r  rP  r  r  r  r   s    r   create_socketVEventLoopTestsMixin.test_datagram_send_to_non_listening_address.<locals>.create_socket  s<    ==1B1BCDU#II&'Kr   r      a)r      b   c   dN)r3   r   DatagramProtocolr2   r  r  abortrv  r  r  r   rD   )r8   r  r  socket_1transport_1
protocol_1addr_1socket_2transport_2
protocol_2addr_2socket_3transport_3
protocol_3addr_3r3   s   &              @r   +test_datagram_send_to_non_listening_address?EventLoopTestsMixin.test_datagram_send_to_non_listening_address  s    yy	w// 		 !?"&"9"9))()B#
 %%' ?"&"9"9))()B#
 %%' !?"&"9"9))()B#
 %%'4f-00113
	 	4f-00113
	
 	4f-a 01 	4f-00113
	 	r   c                   V P                  4       p\        V\        P                  4      '       g"   VP	                  4        V P                  R 4       V P                  ^VP                  4       VP	                  4        V P                  ^ VP                  4       V P                  VP                  4       V P                  VP                  4       R# )z#loop is not a BaseSelectorEventLoopN)r   
isinstancer   BaseSelectorEventLooprD   skipTestr  _internal_fdsr/  _csock_ssockr[   s   & r   test_internal_fds%EventLoopTestsMixin.test_internal_fds$  s    %%'$ E EFFJJLMM?@D../

D../$++&$++&r   r   zDon't support pipes for Windowsc                  a aa \        S P                  R 7      o\        P                  ! 4       w  r\        P
                  ! VRR4      oVVV 3R lpS P                  P                  V! 4       4       \        P                  ! VR4       \        P                  ! S P                  V3R l4       S P                  ^SP                  4       \        P                  ! VR4       \        P                  ! S P                  V3R l4       S P                  RR	.SP                  4       S P                  ^SP                  4       \        P                  ! V4       S P                  P                  SP                  4       S P                  . ROSP                  4       S P                  SP                   P#                  R
4      4       R# )r  rbr  c                  8  <"   SP                   P                  V3R  lS4      G Rj  xL
 w  rSP                  VS4       SP                  V SP                  4       SP	                  RR.SP
                  4       SP	                  ^ SP                  4       R#  Lp5i)c                     < S # r   r   r  s   r   r  EEventLoopTestsMixin.test_read_pipe.<locals>.connect.<locals>.<lambda>:  s    r   NrT   rh   r3   connect_read_piper  rU   r  rV   rW   )r8  ppipeobjr  r8   s     r   r  3EventLoopTestsMixin.test_read_pipe.<locals>.connect8  sx     44w( (DAMM!U#MM!U__-i5u{{CQ-(   $BBA1B   1c                  "   < S P                   ^8  # r>  r  r  s   r   r  4EventLoopTestsMixin.test_read_pipe.<locals>.<lambda>C      0Ar      2345c                  "   < S P                   ^8  # r   r  r  s   r   r  r  G  r  r   rT   rh   pipeNrT   rh   rw   r{   )r   r3   r  r  ioopenr2   r   r   r  r  rW   rV   rD   rZ   r  rU   r  )r8   rpipewpiper  r  r  s   f   @@r   test_read_pipe"EventLoopTestsMixin.test_read_pipe0  s,     TYY/wwy''%t,	. 			$$WY/
TYY(ABELL)
 TYY(AB)[15;;?ELL)
		$$UZZ05u{{	D 	U__;;FCDr   c                  aaaa	a
 V P                  4       o\        SR 7      o\        SR 7      o
\        P                  ! 4       w  r\
        P                  ! VRR4      o\
        P                  ! VRRRR7      o	VVVV	V
3R lpSP                  V! 4       4      w  rESP                  4        V P                  R\        V4      4       V P                  R\        V4      4       SP                  4        S	P                  4        RVn        RVn        R# )	r  r  r  r  zutf-8)encodingc                     <"   SP                  V3R  lS4      G Rj  xL
 w  rSP                  V3R lS4      G Rj  xL
 w  r!W3#  L) L5i)c                     < S # r   r   
read_protos   r   r  SEventLoopTestsMixin.test_unclosed_pipe_transport.<locals>.connect.<locals>.<lambda>`  s    
r   Nc                     < S # r   r   write_protos   r   r  r  b  s    r   )r  connect_write_pipe)read_transportr  write_transportr3   r  rpipeobjwpipeobjr  s      r   r  AEventLoopTestsMixin.test_unclosed_pipe_transport.<locals>.connect^  sS     &*&<&<"H'. !.N'+'>'>#X(/ "/O!22	!."/s   AAAA	
A	Ar  N)r   r   r   r  r  r  r  r2   rD   rp  repr_pipe)r8   r  r  r  r  r  r3   r  r  r  r  s   &     @@@@@r   test_unclosed_pipe_transport0EventLoopTestsMixin.test_unclosed_pipe_transportR  s     %%'$$/
&D1wwy775$-775#tg>	3 	3 +/*A*A')*L'

 	fd>23fd?34 	# $r   openptyzneed os.openpty()c                  a aa \        S P                  R 7      o\        P                  ! 4       w  r\        P
                  ! VR^ 4      oVVV 3R lpS P                  P                  V! 4       4       \        P                  ! VR4       \        P                  ! S P                  V3R l4       S P                  ^SP                  4       \        P                  ! VR4       \        P                  ! S P                  V3R l4       S P                  RR.SP                  4       S P                  ^SP                  4       \        P                  ! V4       SP                  P                  4        S P                  P                  SP                  4       S P                  . ROSP                  4       S P!                  SP                  P#                  R	4      4       R
# )r  r  c                  8  <"   SP                   P                  V3R  lS4      G Rj  xL
 w  rSP                  VS4       SP                  V SP                  4       SP	                  RR.SP
                  4       SP	                  ^ SP                  4       R#  Lp5i)c                     < S # r   r   r  s   r   r  KEventLoopTestsMixin.test_read_pty_output.<locals>.connect.<locals>.<lambda>~  s    Ur   NrT   rh   r  )r8  r  master_read_objr  r8   s     r   r  9EventLoopTestsMixin.test_read_pty_output.<locals>.connect}  s{     44]5DF FDAMM!U#MM!U__-i5u{{CQ-Fr  r  c                     < S P                   # r   r  r  s   r   r  :EventLoopTestsMixin.test_read_pty_output.<locals>.<lambda>  s	    r   r  c                  "   < S P                   ^8  # r  r  r  s   r   r  r    r  r   rT   rh   r  Nr  )r   r3   r  r  r  r  r2   r   r   r  r  rW   rV   rD   rU   rZ   r  r  )r8   masterslaver  r  r  s   f   @@r   test_read_pty_output(EventLoopTestsMixin.test_read_pty_outputt  s<     TYY/

''&$2	. 			$$WY/
TYY(<=ELL)
 TYY(AB)[15;;?ELL)
		$$UZZ05u{{	D 	U__;;FCDr   c                Z  aaaa	 \         P                  ! 4       w  o	p\        P                  ! VR R4      p\	        V P
                  R7      oV P
                  P                  V3R lV4      pV P
                  P                  V4      w  rEV P                  VS4       V P                  VSP                  4       V P                  RSP                  4       VP                  R4       \        4       oV	3R lo\        P                  ! V P
                  VV3R l4       V P                  RS4       VP                  R4       \        P                  ! V P
                  VV3R	 l4       V P                  R
S4       V P                  RSP                  4       \         P                   ! S	4       V P#                  SP                  P%                  R4      4       SP                  P!                  4        V P
                  P                  SP&                  4       V P                  RSP                  4       R# )wbr  r  c                     < S # r   r   r  s   r   r  5EventLoopTestsMixin.test_write_pipe.<locals>.<lambda>      ur   rh   r  c                 X   < \         P                  ! SR 4      pW,          p \        V 4      # r  r  r  rq   )rs   chunkr  s   & r   r  3EventLoopTestsMixin.test_write_pipe.<locals>.reader  s$    GGE4(EMDt9r   c                     < S! S 4      ^8  # r  r   rs   r  s   r   r  r        t0Ar   r  c                     < S! S 4      ^8  # r  r   r  s   r   r  r    r  r      12345r  r{   N)r  r  r  r  r   r3   r  r2   r  rU   r  rV   r   r  r   r  rD   r  r  rZ   )
r8   r  r  r  rU   r  rs   r  r  r  s
   &     @@@@r   test_write_pipe#EventLoopTestsMixin.test_write_pipe  s~    wwyu''%t, dii0))..}gFyy33G<	ai1ekk2{	
 	TYY(ABt$ TYY(AB4(ekk2
 	U__;;FCD 			$$UZZ05;;/r   c                0  a \         P                  ! 4       w  rVP                  R 4       \        P                  ! VP                  4       RR4      p\        V P                  R7      oV P                  P                  V3R lV4      pV P                  P                  V4      w  rVV P                  VS4       V P                  VSP                  4       V P                  RSP                  4       VP                  R4       V P                  P                  V P                  P                  VR4      4      pV P                  RV4       VP!                  4        V P                  P                  SP"                  4       V P                  RSP                  4       R# )	Fr  r  r  c                     < S # r   r   r  s   r   r  IEventLoopTestsMixin.test_write_pipe_disconnect_on_close.<locals>.<lambda>  r  r   rh   r  r{   N)r  r  r  r  r  detachr   r3   r  r2   r  rU   r  rV   r   	sock_recvrD   rZ   )	r8   rsockwsockr  r  rU   r  rs   r  s	   &       @r   #test_write_pipe_disconnect_on_close7EventLoopTestsMixin.test_write_pipe_disconnect_on_close  s    ((*% ''%,,.$5 dii0))..}gFyy33G<	ai1ekk2yy++DII,?,?t,LMt$		$$UZZ05;;/r   c                  aaaa	 \         P                  ! 4       w  op\        P                  ! VR ^ 4      p\	        V P
                  R7      oV P
                  P                  V3R lV4      pV P
                  P                  V4      w  rEV P                  VS4       V P                  VSP                  4       V P                  RSP                  4       VP                  R4       \        4       oV3R lo	\        P                  ! V P
                  VV	3R l\         P"                  R7       V P                  RS4       VP                  R4       \        P                  ! V P
                  VV	3R	 l\         P"                  R7       V P                  R
S4       V P                  RSP                  4       \         P$                  ! S4       V P'                  SP                  P)                  R4      4       SP                  P%                  4        V P
                  P                  SP*                  4       V P                  RSP                  4       R# )r  r  c                     < S # r   r   r  s   r   r  4EventLoopTestsMixin.test_write_pty.<locals>.<lambda>  r  r   rh   r  c                 X   < \         P                  ! SR 4      pW,          p \        V 4      # r  r  rs   r	  r  s   & r   r  2EventLoopTestsMixin.test_write_pty.<locals>.reader  $    GGFD)EMDt9r   c                     < S! S 4      ^8  # r  r   r  s   r   r  r    r  r   timeoutr  c                     < S! S 4      ^8  # r  r   r  s   r   r  r    r  r   r  r  r{   N)r  r  r  r  r   r3   r  r2   r  rU   r  rV   r   r  r   r  r
   SHORT_TIMEOUTrD   r  r  rZ   )
r8   r  slave_write_objr  rU   r  rs   r  r  r  s
   &     @@@@r   test_write_pty"EventLoopTestsMixin.test_write_pty  s    

''%q1 dii0))..}oNyy33G<	ai1ekk2{	
 	TYY(A%,%:%:	<t$ TYY(A%,%:%:	<4(ekk2
 	U__;;FCD 			$$UZZ05;;/r   c                
  a
aaaa \         P                  ! 4       w  op\         P                  ! V4      p\        P                  ! V4       \
        P                  ! VR ^ 4      p\        V P                  R7      oV P                  P                  V3R lV4      pV P                  P                  V4      w  rVV P                  VS4       V P                  VSP                  4       V P                  RR.SP                  4       V P                  ^ SP                  4       \
        P                  ! VR^ 4      p\!        V P                  R7      oV P                  P#                  V3R lV4      pV P                  P                  V4      w  rV P                  VS4       V P                  V	SP                  4       V P                  RSP                  4       \%        4       o
V3R loV	P'                  R4       \(        P*                  ! V P                  V
V3R	 l\,        P.                  R
7       V P                  RS
4       V P                  RR.SP                  4       V P                  RSP                  4       \         P&                  ! SR4       \(        P*                  ! V P                  V3R l\,        P.                  R
7       V P                  RR.SP                  4       V P                  ^SP                  4       V P                  RSP                  4       V	P'                  R4       \(        P*                  ! V P                  V
V3R l\,        P.                  R
7       V P                  RS
4       V P                  RR.SP                  4       V P                  RSP                  4       \         P&                  ! SR4       \(        P*                  ! V P                  V3R l\,        P.                  R
7       V P                  RR.SP                  4       V P                  ^SP                  4       V P                  RSP                  4       \         P0                  ! S4       VP1                  4        V P                  P                  SP2                  4       V P                  . ROSP                  4       V	P1                  4        V P                  P                  SP2                  4       V P                  RSP                  4       R# )r  r  c                     < S # r   r   r  s   r   r  <EventLoopTestsMixin.test_bidirectional_pty.<locals>.<lambda>  s    :r   rT   rh   r  c                     < S # r   r   r  s   r   r  r,    s    [r   c                 X   < \         P                  ! SR 4      pW,          p \        V 4      # r  r  r  s   & r   r  :EventLoopTestsMixin.test_bidirectional_pty.<locals>.reader#  r!  r   r  c                     < S! S 4      ^8  # r  r   r  s   r   r  r,  )  r  r   r#  r  c                  "   < S P                   ^8  # r  r  r  s   r   r  r,  0      
0A0AQ0Fr   r  c                     < S! S 4      ^8  # r  r   r  s   r   r  r,  7  r  r   r  s   bcdec                  "   < S P                   ^8  # r  r  r  s   r   r  r,  >  r2  r   r{   Nr  )r  r  r  ttysetrawr  r  r   r3   r  r2   r  rU   r  rV   rW   r   r  r  r   r   r  r
   r&  rD   rZ   )r8   
read_slavewrite_slaveslave_read_objread_connectr  r  r'  write_connectr  rs   r  r  r  r  s   &         @@@@@r   test_bidirectional_pty*EventLoopTestsMixin.test_bidirectional_pty  s     ZZ\
ffZ(

:T15$$))4
yy223E3AC II88Fa$nj&:&:;)[1:3C3CDJ--. ''+tQ7&DII6		445H5DF!YY99-Ha%o{'<'<=k&7&78{	
 	d#TYY(A%,%:%:	<t$)[1:3C3CDk&7&78
TYY(F%,%:%:	<)[1:3C3CDJ--.k&7&78g&TYY(A%,%:%:	<4()[1:3C3CDk&7&78
!TYY(F%,%:%:	<)[1:3C3CDJ--.k&7&78
		$$Z__55z7G7G	I 			$$[%5%56;#4#45r   c                  a a \         P                  ! 4       w  rVP                  R 4       S P                  P	                  S P                  P                  V^4      4      o\        SRR4      pVe   S P                  VP                  4       VV 3R lpS P                  P	                  V! 4       4      pS P                  P                  4        S P                  VP                  4       R4       S P                  \        P                  SP                  4       Ve   S P                  VP                  4       S P                  P!                  V4       VP#                  4        VP#                  4        R# )FovNc                  $  <"    SP                   P                  SP                  4       SG R j  xL
  R p SP                   P                  4        V #  L"  \        P                   d    Rp  L7i ; i  SP                   P                  4        i ; i5i)NrJ  )r3   r  rX  r   CancelledErrorr  )r~  rE  r8   s    r   main:EventLoopTestsMixin.test_prompt_cancellation.<locals>.mainW  sq     !		##AHH- 		 J )) "!"
 		 sH   B*A AA A1 BA A.+A1 -A..A1 1BBrJ  )r  r  r  r3   r  r  getattrr   pendingr  r  r^  r   r   rA  rI  r  rD   )r8   r  r  r?  rB  r8  rE  s   f     @r   test_prompt_cancellation,EventLoopTestsMixin.test_prompt_cancellationO  s      "	eII!!$))"5"5a";<Qd#>OOBJJ'
	 II!!$&)		[1'00!((;>RZZ(		"				r   c                  a a VV 3R  lpS P                   P                  o^ S P                   n        VS P                   n        R pS P                   P                  V! 4       4       S P	                  S P                   P                  ^RS P                   P
                  RS P                   P                  P                  P                  /4       R# )c                  \   < SP                   ;P                  ^,          un        S ! 4        R# r=  )r3   _run_once_counter)orig_run_oncer8   s   r   	_run_once<EventLoopTestsMixin.test_timeout_rounding.<locals>._run_oncep  s    II''1,'Or   c                  N  "   \         P                  ! R 4      G Rj  xL
  \         P                  ! R4      G Rj  xL
  \         P                  ! R4      G Rj  xL
  \         P                  ! R4      G Rj  xL
  \         P                  ! R4      G Rj  xL
  R#  L~ Lb LF L* L5i)r  Ng-C6?gư>g:0yE>g|=r   r   r   r   rH  7EventLoopTestsMixin.test_timeout_rounding.<locals>.waitx  sp     --%%%--%%%--%%%--%%%--&&&	 &%%%&sU   B%BB%BB%BB%6B!7B%B#B%B%B%!B%#B%clock_resolutionselectorN)	r3   rL  rJ  r2   assertLessEqual_clock_resolution	_selectorr   rI   )r8   rL  rH  rK  s   f  @r   test_timeout_rounding)EventLoopTestsMixin.test_timeout_roundingo  s    	 		++&'		#'			' 			$$TV,
 	TYY88"!<!<,,66??A	Br   c                   V P                  4       pR  p\        P                  ! 4       w  r4V P                  VP                  4       V P                  VP                  4       VP                  W24       VP                  WB4       VP	                  4        V P                  VP                  V4      4       V P                  VP                  V4      4       R# )c                      R # r   r   r   r   r   r  CEventLoopTestsMixin.test_remove_fds_after_closing.<locals>.<lambda>      4r   N)
r   r  r  r  rD   r  r  rI  r  r  r8   r3   r  r  r  s   &    r   test_remove_fds_after_closing1EventLoopTestsMixin.test_remove_fds_after_closing  s    %%'  "  $$

++A./++A./r   c                   V P                  4       pR  p\        P                  ! 4       w  r4V P                  VP                  4       V P                  VP                  4       VP	                  4        V P                  \        4      ;_uu_ 4        VP                  W24       RRR4       V P                  \        4      ;_uu_ 4        VP                  WB4       RRR4       R#   + '       g   i     LI; i  + '       g   i     R# ; i)c                      R # r   r   r   r   r   r  @EventLoopTestsMixin.test_add_fds_after_closing.<locals>.<lambda>  rZ  r   N)	r   r  r  r  rD   r   r   r  r  r[  s   &    r   test_add_fds_after_closing.EventLoopTestsMixin.test_add_fds_after_closing  s    %%'  "  

|,,OOA( -|,,OOA( -, -,,,,s   C!C4!C1	4D	c                   a  V 3R  lpV! S P                   4      pS P                  \        4      ;_uu_ 4        S P                   P                  V4       RRR4       R#   + '       g   i     R# ; i)c                 D   <"   SP                   P                  4        R # 5ir   )r3   rD   r3   r8   s   &r   
close_loopEEventLoopTestsMixin.test_close_running_event_loop.<locals>.close_loop  s     IIOOs    N)r3   r   r   r2   )r8   rf  r  s   f  r   test_close_running_event_loop1EventLoopTestsMixin.test_close_running_event_loop  sJ    	 $))$|,,II((. -,,,s   AA.	c                H   V P                   P                  4        R  pR pV! 4       pV P                  VP                  4       V P                  \        4      ;_uu_ 4        V P                   P                  4        RRR4       V P                  \        4      ;_uu_ 4        V P                   P                  4       pV P                   P                  V4       RRR4       V P                  \        4      ;_uu_ 4        V P                   P                  V4       RRR4       V P                  \        4      ;_uu_ 4        V P                   P                  V4       RRR4       V P                  \        4      ;_uu_ 4        V P                   P                  RV4       RRR4       V P                  \        4      ;_uu_ 4        V P                   P                  V P                   P                  4       R,           V4       RRR4       V P                  \        4      ;_uu_ 4        V P                   P                  V4       RRR4       V P                  \        4      ;_uu_ 4        V P                   P                  \        P                   V4       RRR4       V P                  \        4      ;_uu_ 4        V P                   P#                  RV4      P%                  4       p\'        V4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL8; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELc; i  + '       g   i     EL6; i  + '       g   i     L; i  + '       g   i     R# ; i)c                     "   R # 5ir   r   r   r   r   test,EventLoopTestsMixin.test_close.<locals>.test  s     r-   c                      R # Fr   r   r   r   r  0EventLoopTestsMixin.test_close.<locals>.<lambda>  s    ur   Ng      ?g        )r3   rD   r  r   r   r  rX   r2   r  r+  r  call_atr   r  r  r  SIGTERMr{  rG   next)r8   rl  funcr  r_  its   &     r   
test_closeEventLoopTestsMixin.test_close  s?   			 v

# |,,II!!# -|,,))))+CII((- - |,,II% -|,,II**40 -|,,II  d+ -|,,IIdiinn.3T: -|,,II!!$' -|,,II((> - |,,**46@@BBH -,+ -,,,,, -,,,,,,,,,,,,,,,, -,,sl    K1 6L;L<L-=M?<M M)!+M=16N1L	L	L*	-L>	M	M&	)M:	=N	N!	r  )Tr  )NNr   )frI   rJ   rK   rL   r   r   r   r  r	  r  r   r9  rQ  rZ  rf  rn  rs  r  r  r  r  unittest
skipUnlessr#  r  r  r  r  r  r  r   skip_unless_bind_unix_socketr  r  r  r,  skipIfr  r6  r=  rF  skip_if_tcp_blackholera  ri  rr  r  r  r  r   r$  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r"  r1  r8  rE  rJ  rP  r[  r_  IPV6_ENABLEDri  rm  r  r  r  r  r  r  r   r   r  r  r  r  r  r  r
   requires_mac_verr(  r<  rF  rU  r\  ra  rh  rv  rM   rN   r   r   s   @@r   r   r     s    '
E$B>	3	86.-8-8-@5<6>!(08%( 3\B)I C)IV 3\B524$4 C$  3\B524$4 C$"	7 //G 0G ;?&*R?@
#KJ __SD[/2E 3E //__SD[/2E 3 0E	 ((, ),* ((, ),(E46l __SD[/2J 3J/ 
ZZ,-5 .56MA"H. 8:KL M2 // 06 35FG0 H0	"? __SD[/2 3> //__SD[/2 3 0: __SD[/2 38 //__SD[/2 3 08 __SD[/2 3B //__SD[/21 3 012 __SD[/21 31:. 335TU& V&P (( )$.!`N 335TUI VI.4HT
' 0:<E<E@ 0:<%<%@ 0:<Y/1DEE F<EB 0:<#0<#0J 0:<0<0* 0:<Y/1DE b!$%0 % F<%0N 0:<Y/1DE b!$D6 % F<D6L@B2
0
)/" "r   r   c                     a  ] tR tRt o R tR t]P                  ! 4       R 4       t]P                  ! 4       R 4       t	]P                  ! 4       R 4       t
]P                  ! 4       R 4       t]P                  ! 4       R 4       t]P                  ! 4       R	 4       t]P                  ! 4       R
 4       t]P                   ! ]P$                  R8H  R4      ]P                  ! 4       R 4       4       t]P                  ! 4       R 4       t]P                  ! 4       R 4       t]P                  ! 4       R 4       t]P                  ! 4       R 4       t]P                  ! 4       R 4       t]P                  ! 4       R 4       tRtV tR# )SubprocessTestsMixini  c                    \         P                  R 8X  d   V P                  V\        4       R# V P	                  \
        P                  ) V4       R# r   N)r   r   rF  r$   r  r  rr  r8   r   s   &&r   check_terminated%SubprocessTestsMixin.check_terminated  6    <<7"!!*c2 fnn_j9r   c                    \         P                  R 8X  d   V P                  V\        4       R# V P	                  \
        P                  ) V4       R# r  )r   r   rF  r$   r  r  r  r  s   &&r   check_killed!SubprocessTestsMixin.check_killed  r  r   c                   \         P                  P                  \         P                  P                  \        4      R 4      pV P
                  P                  \        P                  ! \        V P
                  4      \        P                  V4      pV P
                  P                  V4      w  r4V P                  V\        4       V P
                  P                  VP                  4       V P                  RVP                   4       VP#                  ^ 4      pVP%                  R4       V P
                  P                  VP&                  ^,          P)                  4       4       \*        P,                  ! 4       ;_uu_ 4        VP/                  4        RRR4       V P
                  P                  VP0                  4       V P3                  VP4                  4       V P                  RVP6                  ^,          4       R#   + '       g   i     Lu; i)echo.pyrh      Python The WinnerN)r  r  r7  dirname__file__r3   subprocess_execr4  r5  r   r   
executabler2   rF  rY   r  rV   get_pipe_transportr   r   rH  r   r'  rD   r   r  r   rs   r8   progr  transpr  stdins   &     r   test_subprocess_exec)SubprocessTestsMixin.test_subprocess_exec  sR   ww||BGGOOH5yA))++!))*>		J. 		44W=e%9:		$$U__5ekk2))!,()		$$U^^A%6%;%;%=>&&((LLN )		$$U__5%**+-uzz!}=	 )(s   =G;;H	c                :   \         P                  P                  \         P                  P                  \        4      R 4      pV P
                  P                  \        P                  ! \        V P
                  4      \        P                  V4      pV P
                  P                  V4      w  r4V P                  V\        4       V P
                  P                  VP                  4       V P                  RVP                   4       VP#                  ^ 4      pVP%                  R4       V P
                  P                  VP&                  ^,          P)                  4       4       VP&                  ^,          P+                  4        V P                  RVP,                  ^,          4       VP%                  R4       V P
                  P                  VP&                  ^,          P)                  4       4       V P                  RVP,                  ^,          4       \.        P0                  ! 4       ;_uu_ 4        VP3                  4        RRR4       V P
                  P                  VP4                  4       V P7                  VP8                  4       R#   + '       g   i     LR; i)r  rh   s   Python s
   The Winnerr  N)r  r  r7  r  r  r3   r  r4  r5  r   r   r  r2   rF  rY   r  rV   r  r   r   rH  clearrs   r   r'  rD   r   r  r   r  s   &     r   test_subprocess_interactive0SubprocessTestsMixin.test_subprocess_interactive  s   ww||BGGOOH5yA))++!))*>		J. 		44W=e%9:		$$U__5ekk2))!,J		$$U^^A%6%;%;%=>q!UZZ]3M"		$$U^^A%6%;%;%=>-uzz!}=&&((LLN )		$$U__5%**+ )(s   /J

J	c                   V P                   P                  \        P                  ! \        V P                   4      R 4      pV P                   P                  V4      w  r#V P                  V\        4       V P                   P                  VP                  4       VP                  ^ 4      P                  4        V P                   P                  VP                  4       V P                  ^ VP                  4       T P                  \        ;QJ d4    R VP                  P!                  4        4       F  '       d   K   RM)	  RM%! R VP                  P!                  4        4       4      4       V P                  VP"                  ^,          P%                  R4      R4       V P                  VP"                  ^,          R4       VP                  4        R# )zecho Pythonc              3   @   "   T F  qP                  4       x  K  	  R # 5ir   )rZ   ).0rE  s   & r   	<genexpr>=SubprocessTestsMixin.test_subprocess_shell.<locals>.<genexpr>  s     I.HFFHH.Hs   FTs   
s   Pythonr   N)r3   subprocess_shellr4  r5  r   r2   rF  rY   r  rD   r   r  r   r   allr   valuesrs   rstripr8   r  r  r  s   &   r   test_subprocess_shell*SubprocessTestsMixin.test_subprocess_shell  s9   )),,!))*>		J%' 		44W=e%9:		$$U__5!!!$**,		$$U__5E,,-Ie.?.?.F.F.HIIe.?.?.F.F.HIIJA--g6	BA,r   c                   V P                   P                  \        P                  ! \        V P                   4      R RRRR7      pV P                   P                  V4      w  r#V P                  V\        4       V P                   P                  VP                  4       V P                  ^VP                  4       VP                  4        R# exit 7N)r  stdoutstderrr3   r  r4  r5  r   r2   rF  r   r  r   rD   r  s   &   r   test_subprocess_exitcode-SubprocessTestsMixin.test_subprocess_exitcode   s    )),,!))*>		J T$ - H 		44W=e%9:		$$U__5E,,-r   c                r   V P                   P                  \        P                  ! \        V P                   4      R RRRR7      pV P                   P                  V4      w  r#V P                  V\        4       V P                  VP                  ^ 4      4       V P                  VP                  ^4      4       V P                  VP                  ^4      4       V P                   P                  VP                  4       V P                  ^VP                  4       V P                  VP                  4       4       R# r  )r3   r  r4  r5  r   r2   rF  r/  r  r   r  r   rD   r  s   &   r   "test_subprocess_close_after_finish7SubprocessTestsMixin.test_subprocess_close_after_finish,  s    )),,!))*>		J T$ - H 		44W=e%9:&33A67&33A67&33A67		$$U__5E,,-&,,.)r   c                   \         P                  P                  \         P                  P                  \        4      R 4      pV P
                  P                  \        P                  ! \        V P
                  4      \        P                  V4      pV P
                  P                  V4      w  r4V P                  V\        4       V P
                  P                  VP                  4       VP                  4        V P
                  P                  VP                   4       V P#                  VP$                  4       VP'                  4        R# r  N)r  r  r7  r  r  r3   r  r4  r5  r   r   r  r2   rF  rY   r  r   r  r   rD   r8   r  r  r  r  s   &    r   test_subprocess_kill)SubprocessTestsMixin.test_subprocess_kill;  s    ww||BGGOOH5yA))++!))*>		J. 		44W=e%9:		$$U__5		$$U__5%**+r   c                   \         P                  P                  \         P                  P                  \        4      R 4      pV P
                  P                  \        P                  ! \        V P
                  4      \        P                  V4      pV P
                  P                  V4      w  r4V P                  V\        4       V P
                  P                  VP                  4       VP                  4        V P
                  P                  VP                   4       V P#                  VP$                  4       VP'                  4        R# r  )r  r  r7  r  r  r3   r  r4  r5  r   r   r  r2   rF  rY   	terminater   r  r   rD   r  s   &    r   test_subprocess_terminate.SubprocessTestsMixin.test_subprocess_terminateL  s    ww||BGGOOH5yA))++!))*>		J. 		44W=e%9:		$$U__5		$$U__5e../r   r   zDon't have SIGHUPc                   \         P                   ! \         P                  \         P                  4      p \        P                  P                  \        P                  P                  \        4      R 4      pV P                  P                  \        P                  ! \        V P                  4      \        P                  V4      pV P                  P                  V4      w  rEV P!                  V\        4       V P                  P                  VP"                  4       VP%                  \         P                  4       V P                  P                  VP&                  4       V P)                  \         P                  ) VP*                  4       VP-                  4        \         P                   ! \         P                  V4       R#   \         P                   ! \         P                  T4       i ; ir  )r  SIGHUPSIG_DFLr  r  r7  r  r  r3   r  r4  r5  r   r   r  r2   rF  rY   send_signalr   r  r   rD   )r8   old_handlerr  r  r  r  s   &     r   test_subprocess_send_signal0SubprocessTestsMixin.test_subprocess_send_signal]  s%    mmFMM6>>B	677<< 99EDii//%--.BDIINNND2G
 !II88AMF!!%)=>II((9v}}-II((9fmm^U-=-=>LLNMM&--5FMM&--5s   E&G 'G)c                F   \         P                  P                  \         P                  P                  \        4      R 4      pV P
                  P                  \        P                  ! \        V P
                  4      \        P                  V4      pV P
                  P                  V4      w  r4V P                  V\        4       V P
                  P                  VP                  4       VP                  ^ 4      pVP!                  R4       V P
                  P                  VP"                  4       VP%                  4        V P'                  RVP(                  ^,          4       V P+                  VP(                  ^,          R4       V P'                  ^ VP,                  4       R# )echo2.py   test   OUT:tests   ERR:testN)r  r  r7  r  r  r3   r  r4  r5  r   r   r  r2   rF  rY   r  r   r   rD   r  rs   assertStartsWithr   r  s   &     r   test_subprocess_stderr+SubprocessTestsMixin.test_subprocess_stderrw  s   ww||BGGOOH5zB))++!))*>		J. 		44W=e%9:		$$U__5))!,G		$$U__5ejjm4ejjm[9E,,-r   c                   \         P                  P                  \         P                  P                  \        4      R 4      pV P
                  P                  \        P                  ! \        V P
                  4      \        P                  V\        P                  R7      pV P
                  P                  V4      w  r4V P                  V\        4       V P
                  P                  VP                   4       VP#                  ^ 4      pV P%                  VP#                  ^4      4       V P'                  VP#                  ^4      4       VP)                  R4       V P
                  P                  VP*                  4       V P-                  VP.                  ^,          R4       V P1                  RVP.                  ^,          4       VP3                  4        V P1                  ^ VP4                  4       R# )r  )r  r  s   OUT:testERR:testr   N)r  r  r7  r  r  r3   r  r4  r5  r   r   r  
subprocessSTDOUTr2   rF  rY   r  r  r/  r   r   r  rs   r  rD   r   r  s   &     r   )test_subprocess_stderr_redirect_to_stdout>SubprocessTestsMixin.test_subprocess_stderr_redirect_to_stdout  sV   ww||BGGOOH5zB))++!))*>		JZ5F5F , H
 		44W=e%9:		$$U__5))!,V66q9:&33A67G		$$U__5ejjm-@Aejjm,E,,-r   c                   \         P                  P                  \         P                  P                  \        4      R 4      pV P
                  P                  \        P                  ! \        V P
                  4      \        P                  V4      pV P
                  P                  V4      w  r4V P                  V\        4       V P
                  P                  VP                  4       VP                  ^ 4      pVP                  ^4      pVP!                  R4       V P
                  P                  VP"                  ^,          P%                  4       4       V P'                  RVP(                  ^,          4       VP+                  4        V P
                  P                  VP,                  ^,          4       VP!                  R4       V P
                  P                  VP"                  ^,          P%                  4       4       \        P.                  R8w  d%   V P'                  RVP(                  ^,          4       M#V P'                  RVP(                  ^,          4       \0        P2                  ! 4       ;_uu_ 4        VP+                  4        RRR4       V P
                  P                  VP4                  4       V P7                  VP8                  4       R#   + '       g   i     LR; i)zecho3.pyr  r  r  r   s   ERR:BrokenPipeErrors   ERR:OSErrorN)r  r  r7  r  r  r3   r  r4  r5  r   r   r  r2   rF  rY   r  r   r   rH  r  rs   rD   r   r   r   r'  r   r  r   )r8   r  r  r  r  r  r  s   &      r   #test_subprocess_close_client_stream8SubprocessTestsMixin.test_subprocess_close_client_stream  s   ww||BGGOOH5zB))++!))*>		J. 		44W=e%9:		$$U__5))!,**1-G		$$U^^A%6%;%;%=>ejjm4		$$U%6%6q%9:F		$$U^^A%6%;%;%=><<7"3UZZ]C ^UZZ];&&((LLN )		$$U__5%**+ )(s   8KK#	c           	        V P                   P                  \        P                  ! \        V P                   4      R RRRRR7      pV P                   P                  V4      w  r#V P                  V\        4       V P                   P                  VP                  4       V P                  ^VP                  4       VP                  4        R# )r  NT)r  r  r  start_new_sessionr  r  s   &   r   "test_subprocess_wait_no_same_group7SubprocessTestsMixin.test_subprocess_wait_no_same_group  s     )),,!))*>		J T$*. - 0 		44W=e%9:		$$U__5E,,-r   c                8  a  V 3R  lpS P                  \        4      ;_uu_ 4        S P                  P                  V! RR7      4       RRR4       S P                  \        4      ;_uu_ 4        S P                  P                  V! RR7      4       RRR4       S P                  \        4      ;_uu_ 4        S P                  P                  V! RR7      4       RRR4       R#   + '       g   i     L; i  + '       g   i     Lm; i  + '       g   i     R# ; i)c                  |   <"   SP                   P                  ! \        P                  R 3/ V B G Rj  xL
  R#  L5ipwdN)r3   r  r   SubprocessProtocol)r  r8   s   ,r   r  GSubprocessTestsMixin.test_subprocess_exec_invalid_args.<locals>.connect  s6     ))++**  s   0<:<Tuniversal_newlinesN   bufsizeshellr   r  r3   r2   r8   r  s   f r   !test_subprocess_exec_invalid_args6SubprocessTestsMixin.test_subprocess_exec_invalid_args  s    	
 z**II((D)IJ +z**II(()>? +z**II((t)<= +*	 +******s#   #C"-#C55#D"C2	5D	D	c                  a  R
V 3R llpS P                  \        4      ;_uu_ 4        S P                  P                  V! RR.4      4       R R R 4       S P                  \        4      ;_uu_ 4        S P                  P                  V! RR7      4       R R R 4       S P                  \        4      ;_uu_ 4        S P                  P                  V! RR7      4       R R R 4       S P                  \        4      ;_uu_ 4        S P                  P                  V! RR	7      4       R R R 4       R #   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R # ; i)Nc                    <"   V '       g   R p SP                   P                  ! \        P                  V 3/ VB G Rj  xL
  R#  L5ir  )r3   r  r   r  )cmdr  r8   s   &,r   r  HSubprocessTestsMixin.test_subprocess_shell_invalid_args.<locals>.connect  s>     )),,**  s   :AAAlsz-lTr  r  r  Fr  r   r  r  s   f r   "test_subprocess_shell_invalid_args7SubprocessTestsMixin.test_subprocess_shell_invalid_args  s    	 z**II(($)>? +z**II((D)IJ +z**II(()>? +z**II((u)=> +* +********s/   $D-0#E 8#E #E&-D=	 E	E#	&E7	r   N)rI   rJ   rK   rL   r  r  r
   requires_subprocessr  r  r  r  r  r  r  rx  r{  r   r   r  r  r  r  r  r  r  rM   rN   rO   s   @r   r  r    s    ::   "> #>*   ", #,6   " #    "	 #	   "* #*   " #    " #  __S\\W,.AB  "6 # C60   ". #.*   ". #.0   " , # ,D   "
 #
   "> #>   "? #?r   r  c                   &   a  ] tR tRt o R tRtV tR# )SelectEventLoopTestsi  c                ,    \         P                  ! 4       # r   )r   SelectorEventLooprC   s   &r   r   &SelectEventLoopTests.create_event_loop      ,,..r   r   NrI   rJ   rK   rL   r   rM   rN   rO   s   @r   r  r    s     	/ 	/r   r  c                   D   a  ] tR tRt o R tR tR tR tR tR t	Rt
V tR	# )
ProactorEventLoopTestsi 	  c                ,    \         P                  ! 4       # r   )r   ProactorEventLooprC   s   &r   r   (ProactorEventLoopTests.create_event_loop	  r  r   c                .    \         P                  ! R 4      hz(IocpEventLoop does not have add_reader()rx  SkipTestrC   s   &r   r  +ProactorEventLoopTests.test_reader_callback	      ##$NOOr   c                .    \         P                  ! R 4      hr  r  rC   s   &r   test_reader_callback_cancel2ProactorEventLoopTests.test_reader_callback_cancel
	  r   r   c                .    \         P                  ! R 4      hz(IocpEventLoop does not have add_writer()r  rC   s   &r   r  +ProactorEventLoopTests.test_writer_callback	  r   r   c                .    \         P                  ! R 4      hr  r  rC   s   &r   test_writer_callback_cancel2ProactorEventLoopTests.test_writer_callback_cancel	  r   r   c                .    \         P                  ! R 4      hr  r  rC   s   &r   r\  4ProactorEventLoopTests.test_remove_fds_after_closing	  r   r   r   N)rI   rJ   rK   rL   r   r  r  r  r  r\  rM   rN   rO   s   @r   r  r   	  s.     	/	P	P	P	P	P 	Pr   r  KqueueSelectorc                      a a ] tR tRt oR t]P                  ! ^
^	4      ]P                  ! ]	P                  P                  R4      R4      V 3R l4       4       t]P                  ! ^
^	4      V 3R l4       tRtVtV ;t# )KqueueEventLoopTestsi	  c                T    \         P                  ! \        P                  ! 4       4      # r   )r   r  	selectorsr  rC   s   &r   r   &KqueueEventLoopTests.create_event_loop	  s!    00,,.0 0r   openbsdztest hangs on OpenBSDc                $   < \         SV `  4        R # r   )r   r  r   s   &r   r  )KqueueEventLoopTests.test_read_pty_output#	  s     ,.r   c                $   < \         SV `  4        R # r   )r   r(  r   s   &r   r(  #KqueueEventLoopTests.test_write_pty-	  s    &(r   r   )rI   rJ   rK   rL   r   r
   r~  rx  r{  r   r   r    r  r(  rM   rN   r   r   s   @@r   r  r  	  sx     0 %%b!, __S\\44Y?46/6 -
/
 %%b!,) -) )r   r  EpollSelectorc                   &   a  ] tR tRt o R tRtV tR# )EPollEventLoopTestsi2	  c                T    \         P                  ! \        P                  ! 4       4      # r   )r   r  r  r  rC   s   &r   r   %EPollEventLoopTests.create_event_loop6	  s    001H1H1JKKr   r   Nr  rO   s   @r   r  r  2	  s     L Lr   r  PollSelectorc                   &   a  ] tR tRt o R tRtV tR# )PollEventLoopTestsi:	  c                T    \         P                  ! \        P                  ! 4       4      # r   )r   r  r  r  rC   s   &r   r   $PollEventLoopTests.create_event_loop>	  s    001G1G1IJJr   r   Nr  rO   s   @r   r  r  :	  s     K Kr   r  c                   &   a  ] tR tRt o R tRtV tR# )r  iB	  c                T    \         P                  ! \        P                  ! 4       4      # r   )r   r  r  SelectSelectorrC   s   &r   r   r  F	  s    ,,Y-E-E-GHHr   r   Nr  rO   s   @r   r  r  B	  s     	I 	Ir   c                      R # r   r   )r  rS  s   *,r   noopr%  J	  s    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# )HandleTestsiN	  c                   < \         SV `  4        \        P                  ! 4       V n        R V P                  P
                  n        R# r  )r   r   r   r  r3   	get_debugreturn_valuer   s   &r   r   HandleTests.setUpP	  s+    IIK	+/		(r   c                ^   R  pRp\         P                  ! WV P                  4      pV P                  VP                  V4       V P                  VP
                  V4       V P                  VP                  4       4       VP                  4        V P                  VP                  4       4       R# )c                      V # r   r   r  s   *r   r  )HandleTests.test_handle.<locals>.callbackV	      Kr   Nr   )
r   Handler3   r  	_callback_argsrI  rJ  rX  r   )r8   r  r  hs   &   r   test_handleHandleTests.test_handleU	  su    	 NN84995akk8,aggt$'	
&r   c           
        R  p\         P                  ! 4       V n        \         P                  ! 4       V P                  n        \        P
                  ! VRV P                  4      pVP                  4        V P                  P                  P                  R\        P                  ! R4      R\         P                  RVRVP                  /4       R# )c                      \        4       hr   )r  r   r   r   r  :HandleTests.test_callback_with_exception.<locals>.callbackc	  s
    ,r   r  zException in callback.*r(  rM  source_tracebackNr   )r   r  r3   r(  r   r1  _runassert_called_withr   MockPatternANY_source_traceback)r8   r  r4  s   &  r   test_callback_with_exception(HandleTests.test_callback_with_exceptionb	  s    	 IIK	+/99;		(NN8R3			((;;z--.GHa 3 3	=
 	r   c                ~    \         P                  ! 4       p\        P                  ! R  RV P                  4      pW!R&   R# )c                      R # r   r   r   r   r   r  1HandleTests.test_handle_weakref.<locals>.<lambda>u	  s    4r   r4  Nr   )weakrefWeakValueDictionaryr   r1  r3   )r8   wdr4  s   &  r   test_handle_weakrefHandleTests.test_handle_weakrefs	  s-    ((*NN<TYY73r   c                D   R V P                   P                  n        \        P                  ! \
        RV P                   4      p\        P                  ! \
        4      w  r#V P                  \        V4      RV: RV: R24       VP                  4        V P                  \        V4      R4       \        P                  ! \
        4      p\        P                  ! VRV P                   4      pV P                  \        V4      RV: RV: R24       \        P                  ! \
        ^^4      p\        P                  ! VRV P                   4      pR\        P                   ! V4      : RV: R2pV P#                  \        V4      V4       \        P                  ! \
        ^R7      p\        P                  ! VRV P                   4      pR\        P                   ! V4      : RV: R2pV P#                  \        V4      V4       \$        P&                  p\        P(                  ! V4      p\        P                  ! V4      w  r#\        P                  ! VRV P                   4      pRpR	V R
2pRV R\        P                   ! V4       RV R2pV P#                  \        V4      V4       R# )Fz<Handle noop() at :>z<Handle cancelled>z^<Handle noop\(\)\(\) at >$xz*<function HandleTests.test_handle_repr .*>zfunctools.partialmethod\(z\)\(\)z	^<Handle z at Nr>  r%  r   r  r%  r  )r3   r)  r*  r   r1  r%  r   get_function_sourcer  r  rX  types	coroutiner4  r5  r@  escapeassertRegexr'  test_handle_reprpartialmethod)r8   r4  filenamelinenor  rD  methodcb_regexs   &       r   rW  HandleTests.test_handle_reprx	  s   +0		( NN43%99$?a#V-	.
 	

a,	. __T"NN2r499-a#V-	.
 tQ*NN2tTYY/IIh'1a%( tq)NN2vtyy1IIh'1a%( --$$V,%99&ANN2r499-@/z@XJd299X+>*?qKa%(r   c                H   R V P                   P                  n        \        p\        P
                  ! 4       P                  ^,           p\        P                  ! \        RV P                   4      p\        P                  ! \        4      w  rEV P                  \        V4      RV: RV: RV: RV: R2	4       VP                  4        V P                  \        V4      RV: RV: RV: RV: R2	4       VP                  4        V P                  \        V4      RV: RV: RV: RV: R2	4       \        P                   ! \        ^^4      p\        P
                  ! 4       P                  ^,           p\        P                  ! VRV P                   4      pR\"        P$                  ! V4      : RV: R\"        P$                  ! V4      : RV: R2	pV P'                  \        V4      V4       \        P                   ! \        ^R7      p\        P
                  ! 4       P                  ^,           p\        P                  ! VRV P                   4      pR	\"        P$                  ! V4      : RV: R\"        P$                  ! V4      : RV: R2	pV P'                  \        V4      V4       R
# )Tz<Handle noop(1, 2) at rK   created at rL  z <Handle cancelled noop(1, 2) at z^<Handle noop\(1, 2\)\(3\) at rM  rN  z ^<Handle noop\(x=1\)\(2, 3\) at NrP  r  rQ  )r3   r)  r*  r  r   	_getframef_linenor   r1  r%  r   rR  r  r  rX  r4  r5  r@  rU  rV  )r8   create_filenamecreate_linenor4  rY  rZ  r  rD  s   &       r   test_handle_repr_debug"HandleTests.test_handle_repr_debug	  s   +/		( #0014NN43%99$?a#V_mM	N
 	

G-A	B 	

G-A	B tQ*0014NN2tTYY/IIh'IIo.? 	a%( tq)0014NN2vtyy1IIh'IIo.? 	a%(r   c                n  a  \         P                  ! 4       pVP                  R 4       S P                  V4       V 3R lpVP	                  \
        4      pV! V4       VP                  \
        4      pV! V4       VP                  ^ \
        4      pV! V4       VP                  ^ \
        4      pV! V4       R# )Tc                    < \         P                  ! ^4      P                  ^,
          pSP                  V P                  \
        4       SP                  V P                  R,          R,          \        VR34       R# )r>  :Nr  Ntest_handle_source_tracebackNr  )r   r`  ra  rF  r?  listr  r  )r4  rZ  r8   s   & r   check_source_tracebackHHandleTests.test_handle_source_traceback.<locals>.check_source_traceback	  s`    ]]1%..2F!!!"5"5t<Q004R8&$<>?r   N)r   r0   	set_debugr1   r  r%  r+  r  )r8   r3   rj  r4  s   f   r   rh  (HandleTests.test_handle_source_traceback	  s    %%'tD!	? NN4 q! %%d+q! OOAt$q! OOAt$q!r   c                   \        4       pR Vn        V P                  \        P                  ! V4      4       V P                  \        P                  ! V4      R4       RVn        V P                  \        P                  ! V4      R4       RVn	        V P                  \        P                  ! V4      R4       R;Vn        Vn        V P                  \        P                  ! V4      R4       \        4       pRVn        V P                  \        P                  ! V4      R	4       \        4       pR Vn        RVn
        V P                  \        P                  ! V4      R4       R# )
AAAzAAA()BBBzBBB()TzBBB() runningNz%<CoroLike without __name__>() runningr6   z
CoroLike())r6   rI   r   r   iscoroutiner  r   _format_coroutinerK   
cr_runningcr_code)r8   r  s   & r   +test_coroutine_like_object_debug_formatting7HandleTests.test_coroutine_like_object_debug_formatting	  s   
 z++D1255d;WE!55d;WE55d;_M,00)55d;@	B z& 	55d;\Jz!55d;WEr   r  )rI   rJ   rK   rL   r   r5  r@  rH  rW  rd  rh  ru  rM   rN   r   r   s   @@r   r'  r'  N	  s6     0
'"
-)^*)X":F Fr   r'  c                   V   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VtV ;t# )

TimerTestsi
  c                X   < \         SV `  4        \        P                  ! 4       V n        R # r   )r   r   r   r  r3   r   s   &r   r   TimerTests.setUp
  s    IIK	r   c                    \         P                  ! 4       p\        P                  ! VR  R\        P
                  ! 4       4      pV P                  \        V4      \        V4      4       R# )c                      R # ro  r   r   r   r   r  &TimerTests.test_hash.<locals>.<lambda>
      er   Nr   )r   	monotonicr   TimerHandler   r  r  hashr8   whenr4  s   &  r   	test_hashTimerTests.test_hash
  sE    ~~mR $		-a$t*-r   c                    \         P                  ! 4       p\        P                  ! VR  R\        P
                  ! 4       4      pV P                  WP                  4       4       R# )c                      R # ro  r   r   r   r   r  &TimerTests.test_when.<locals>.<lambda>
  r~  r   Nr   )r   r  r   r  r   r  r  r  r  s   &  r   	test_whenTimerTests.test_when
  sA    ~~mR $		-vvx(r   c                   R  pRp\         P                  ! 4       p\        P                  ! W1V\        P
                  ! 4       4      pV P                  VP                  V4       V P                  VP                  V4       V P                  VP                  4       4       VP                  4        V P                  VP                  4       4       V P                  VP                  4       V P                  VP                  4       R# )c                      V # r   r   r.  s   *r   r  'TimerTests.test_timer.<locals>.callback#
  r0  r   N)r>  r%  r  )r   r  r   r  r   r  r  r2  r3  rI  rJ  rX  r   r/  )r8   r  r  r  r4  s   &    r   
test_timerTimerTests.test_timer"
  s    	 ~~diikBakk8,aggt$' 	

&!++&!''"r   c                X   R V P                   P                  n        \        P                  ! ^{\
        RV P                   4      p\        P                  ! \
        4      pV P                  \        V4      RV,          4       VP                  4        V P                  \        V4      R4       R# )Fz&<TimerHandle when=123 noop() at %s:%s>z <TimerHandle cancelled when=123>Nr   )r3   r)  r*  r   r  r%  r   rR  r  r  rX  )r8   r4  srcs   &  r   test_timer_reprTimerTests.test_timer_repr4
  s    +0		( T2tyy9,,T2a@3F	H 	

a:	<r   c                   R V P                   P                  n        \        p\        P
                  ! 4       P                  ^,           p\        P                  ! ^{\        RV P                   4      p\        P                  ! \        4      w  rEV P                  \        V4      RV: RV: RV: RV: R2	4       VP                  4        V P                  \        V4      RV: RV: RV: RV: R2	4       R# )Tz <TimerHandle when=123 noop() at rK  r_  rL  z*<TimerHandle cancelled when=123 noop() at Nr   )r3   r)  r*  r  r   r`  ra  r   r  r%  r   rR  r  r  rX  )r8   rb  rc  r4  rY  rZ  s   &     r   test_timer_repr_debug TimerTests.test_timer_repr_debugB
  s    +/		( #0014T2tyy9%99$?a $V_mM	N 	

a $V_mM	Nr   c                   R  p\         P                  ! 4       p\        P                  ! W!RV P                  4      p\        P                  ! W!RV P                  4      pV P                  \        4      ;_uu_ 4        V P                  W44       RRR4       V P                  \        4      ;_uu_ 4        V P                  WC4       RRR4       V P                  \        4      ;_uu_ 4        V P                  W44       RRR4       V P                  \        4      ;_uu_ 4        V P                  WC4       RRR4       V P                  \        4      ;_uu_ 4        V P                  W44       RRR4       V P                  W44       V P                  WC4       V P                  W44       V P                  WC4       V P                  W44       VP                  4        V P                  \        4      ;_uu_ 4        V P                  W44       RRR4       V P                  W44       \        P                  ! W!RV P                  4      p\        P                  ! VR,           VRV P                  4      pV P                  \        4      ;_uu_ 4        V P                  WC4       RRR4       V P                  \        4      ;_uu_ 4        V P                  WC4       RRR4       V P                  \        4      ;_uu_ 4        V P                  W44       RRR4       V P                  \        4      ;_uu_ 4        V P                  W44       RRR4       V P                  \        4      ;_uu_ 4        V P                  W44       RRR4       V P                  W44       V P                  WC4       V P                  W44       V P                  WC4       V P                  W44       \        P                  ! VRV P                  4      pV P                  \         VP#                  V4      4       V P                  \         VP%                  V4      4       V P                  \&        4      ;_uu_ 4        VR8   RRR4       V P                  \&        4      ;_uu_ 4        VR8   RRR4       V P                  \&        4      ;_uu_ 4        VR8*   RRR4       V P                  \&        4      ;_uu_ 4        VR8   RRR4       V P                  \        4      ;_uu_ 4        V P                  VR4       RRR4       V P                  \        4      ;_uu_ 4        V P                  V\(        4       RRR4       V P                  \        4      ;_uu_ 4        V P                  V\*        4       RRR4       V P                  \        4      ;_uu_ 4        V P                  V\*        4       RRR4       V P                  \        4      ;_uu_ 4        V P                  V\,        4       RRR4       V P                  \        4      ;_uu_ 4        V P                  V\,        4       RRR4       V P                  VR4       V P                  V\(        4       V P                  V\*        4       V P                  V\*        4       V P                  V\,        4       V P                  V\,        4       R#   + '       g   i     ELL; i  + '       g   i     EL); i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL8; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELr; i  + '       g   i     ELO; i  + '       g   i     EL,; i  + '       g   i     ELT; i  + '       g   i     EL=; i  + '       g   i     EL&; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELs; i  + '       g   i     ELK; i  + '       g   i     EL#; i)c                      V # r   r   r.  s   *r   r  2TimerTests.test_timer_comparison.<locals>.callbackX
  r0  r   Ng      $@r   )r   r  r   r  r3   r   ra   
assertLessr  r|  rR  r   r  rX  r1  r  NotImplemented__eq____ne__r  r   r   r   )r8   r  r  h1h2h3s   &     r   test_timer_comparison TimerTests.test_timer_comparisonW
  sy   	 ~~  TYY?  TYY?~..OOB# /~..OOB# /~..r& /~..r& /~..' / 	R$R$'' 
		~..R$ /B#  TYY?  hDIIF~..OOB# /~..  ( /~..r& /~..##B+ /~..R$ / 	2"R$'B#^^Hb$))4nbiim4nbiim4y))G *y))G *y))"H *y))"H *~..R$ /~..I. /~..r7+ /~..##B0 /~..OOB) /~..  X. / 	B#Y'G$R)H-2x(O /.............. /.. /.............. *)))))))))))..................s   :[1[#([7\\2\3]=]4]/+^"^^+^?0__'_;>`:`#6`72a.a[ 	#[4	7\	\	\0	3]	]	],	/^ 	^	^(	+^<	?_	_$	'_8	;`	` 	#`4	7a	a	a0	r  )rI   rJ   rK   rL   r   r  r  r  r  r  r  rM   rN   r   r   s   @@r   rx  rx  
  s0      .)#$<N*O) O)r   rx  c                   ,   a  ] tR tRt o R tR tRtV tR# )AbstractEventLoopTestsi
  c                   \         P                  ! 4       p\        P                  ! 4       pV P	                  \
        VP                  4       V P	                  \
        VP                  R 4       V P	                  \
        VP                  4       V P	                  \
        VP                  4       V P	                  \
        VP                  4       V P	                  \
        VP                  4       V P	                  \
        VP                  R 4       V P	                  \
        VP                  R R 4       V P	                  \
        VP                  W4       V P	                  \
        VP                  R 4       V P	                  \
        VP                   4       V P	                  \
        VP"                  R 4       V P	                  \
        VP$                  V4       V P	                  \
        VP&                  ^V4       V P	                  \
        VP(                  ^4       V P	                  \
        VP*                  ^V4       V P	                  \
        VP,                  ^4       V P	                  \
        VP.                  ^V4       V P	                  \
        VP0                  ^4       V P	                  \
        VP0                  ^4       V P	                  \
        VP2                  V4       V P	                  \
        VP4                  V4       V P	                  \
        VP6                  V4       V P	                  \
        VP8                  4       V P	                  \
        VP:                  V4       R # r   )r   r  r   AbstractEventLoopr   NotImplementedErrorr  r2   r  r   r   rD   r  r  rq  r  r   r+  set_default_executorr  r  r  r  r  r  set_exception_handlerdefault_exception_handlerr(  r)  rl  )r8   rE  r3   s   &  r   test_not_implemented+AbstractEventLoopTests.test_not_implemented
  s   IIK((*!1!1	3!8!8$	@	,	2	1	-!1!14	9$	>q	5	7	,!:!:D	B!:!:A	?!Q	8!3!3Q	8!Q	8!3!3Q	8!8!8!Q	@!;!;Q	@!;!;Q	@!;!;Q	@!?!?	D!<!<a	A	1	4r   c                   a  V 3R  lp\         P                  ! 4       pVP                  V! 4       4       VP                  4        R# )c                  Z  <"   \         P                  ! 4       p \        P                  ! 4       pSP	                  \
        4      ;_uu_ 4        VP                  W 4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP                  RR4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP                  R4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP                  V 4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP                  V 4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP                  V 4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP                  V ^
4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP                  V ^
4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP                  V ^
4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP                  W 4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP!                  V 4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP#                  W 4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP%                  W 4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP'                  V \         P(                  P*                  4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP-                  V \         P(                  P*                  4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP/                  V \         P(                  4      G R j  xL
  R R R 4       SP	                  \
        4      ;_uu_ 4        VP1                  V 4      G R j  xL
  R R R 4       R #  ELD  + '       g   i     ELK; i EL  + '       g   i     EL"; i EL  + '       g   i     EL; i EL  + '       g   i     EL; i EL  + '       g   i     EL; i EL{  + '       g   i     EL; i ELR  + '       g   i     ELY; i EL)  + '       g   i     EL0; i EL   + '       g   i     EL; i EL  + '       g   i     EL; i EL  + '       g   i     EL; i EL  + '       g   i     EL; i EL`  + '       g   i     ELg; i EL  + '       g   i     EL&; i EL  + '       g   i     EL; i EL  + '       g   i     EL; i EL  + '       g   i     R # ; i5i)Nr[    )r[  r  )r   r  r   r  r   r  r{  rV  r  r  r  r  r  sock_recv_intosock_sendallsock_connectsock_acceptsock_sendfilesendfiler  sentinelr  r  r  r  )rE  r3   r8   s     r   inner@AbstractEventLoopTests.test_not_implemented_async.<locals>.inner
  sB    		A,,.D""#677**1000 8""#677&&{D999 8""#677&&':;;; 8""#677,,Q/// 8""#677((+++ 8""#67733A666 8""#677nnQ+++ 8""#677))!R000 8""#677''2... 8""#677''--- 8""#677&&q))) 8""#677((... 8""#677mmA))) 8""#677,,Q0B0BCCC 8""#677--a1C1CDDD 8""#677++At}}=== 8""#677**1--- 87? 1 877 : 877 < 877 0 877 , 877 7 877 , 877 1 877 / 877 . 877 * 877 / 877 * 877 D 877 E 877 > 877 . 877s  AX+R' R$!R'%%X+
R> R;!R>%%X+
SS S$%X+	S,S)S,#%X+TT T"%X+TTT!%X+T1T.T1!%X+UUU!%X+UUU!%X+U6U3U6 %X+VV
V%X+V$V!V$%X+V;V8V;%X+.W0W1W5%X+.W)W&	W)%X+2$X W=X %X+ XXX
X+$R''R8	2	X+;R>>S			X+SS&	 	X+)S,,S=	7	X+ TT		X+TT+	%	X+.T11U	<	X+UU		X+UU0	*	X+3U66V		X+
VV		X+!V$$V5	/	X+8V;;W		X+WW#		X+&W))W:	4	X+=X  X		X+XX(	"	X+N)r   r0   r2   rD   )r8   r  r3   s   f  r   test_not_implemented_async1AbstractEventLoopTests.test_not_implemented_async
  s2    %	.N %%'(

r   r   N)rI   rJ   rK   rL   r  r  rM   rN   rO   s   @r   r  r  
  s     44l+ +r   r  c                      a  ] tR tRt o R tR tR tR tR tR t	]
P                  ! R4      R	 4       tR
 tR tR tR tRtV tR# )PolicyTestsi  c                    V P                  \        R 4      ;_uu_ 4        \        P                  ! 4       pV P	                  V\        P                  4       RRR4       R#   + '       g   i     R# ; i)z/'asyncio.AbstractEventLoopPolicy' is deprecatedN)r   DeprecationWarningr   AbstractEventLoopPolicyrF  r8   policys   & r   +test_abstract_event_loop_policy_deprecation7PolicyTests.test_abstract_event_loop_policy_deprecation  sZ    """$UW W446F!!&'*I*IJW W W W   6AA0	c                    V P                  \        R 4      ;_uu_ 4        \        P                  ! 4       pV P	                  V\        P                  4       RRR4       R#   + '       g   i     R# ; i)z.'asyncio.DefaultEventLoopPolicy' is deprecatedN)r   r  r   DefaultEventLoopPolicyrF  r  s   & r   *test_default_event_loop_policy_deprecation6PolicyTests.test_default_event_loop_policy_deprecation  sZ    """$TV V335F!!&'*H*HIV V V Vr  c                   \         P                  P                  4       pV P                  \        VP
                  4       V P                  \        VP                  \        4       4       V P                  \        VP                  4       R # r   )	r   r   _AbstractEventLoopPolicyr   r  get_event_loopr1   r.  r0   r  s   & r   test_event_loop_policy"PolicyTests.test_event_loop_policy  s]    88:-v/D/DE-v/D/DfhO-v/D/DEr   c                V   \         P                  ! 4       pV P                  VP                  P                  4       V P                  \        4      ;_uu_ 4        VP                  4       pR R R 4       V P                  VP                  P                  4       R #   + '       g   i     L7; ir   )r   r  r/  _local_loopr   r   r  r8   r  r3   s   &  r   test_get_event_loopPolicyTests.test_get_event_loop#  sm    224&----.|,,((*D -&----. -,s   BB(	c           	        \         P                  ! 4       p\        P                  P	                  VR VP
                  R7      ;_uu_ 4       pV P                  \        4      ;_uu_ 4        VP                  4       pRRR4       VP                  4        RRR4       R#   + '       g   i     L*; i  + '       g   i     R# ; i)r1   )wrapsN)
r   r  r   r$  r.  r1   r   r   r  assert_not_called)r8   r  m_set_event_loopr3   s   &   r   0test_get_event_loop_does_not_call_set_event_loop<PolicyTests.test_get_event_loop_does_not_call_set_event_loop+  s    224ZZ(++  - -0@""<00,,. 1 ..0- - 10	- - -s$   
B.(B	9B.B+&B..B?	c                    \         P                  ! 4       pVP                  R 4       V P                  \        VP
                  4       R # r   )r   r  r1   r   r   r  r  s   & r   "test_get_event_loop_after_set_none.PolicyTests.test_get_event_loop_after_set_none7  s4    224d#,(=(=>r   z'asyncio.events.threading.current_threadc                   a  V 3R  lp\         P                  ! VR7      pVP                  4        VP                  4        R# )c                  r   < \         P                  ! 4       p SP                  \        V P                  4       R # r   )r   r  r   r   r  )r  r8   s    r   rE  1PolicyTests.test_get_event_loop_thread.<locals>.f?  s'    668FlF,A,ABr   r0  N)r2  r5  r6  r7  )r8   m_current_threadrE  ths   f&  r   test_get_event_loop_thread&PolicyTests.test_get_event_loop_thread<  s-    	C Q'


	r   c                    \         P                  ! 4       pVP                  4       pV P                  V\        P
                  4       VP                  4        R # r   )r   r  r0   rF  r   r  rD   r  s   &  r   test_new_event_loopPolicyTests.test_new_event_loopG  s=    224$$&dG$=$=>

r   c                   \         P                  ! 4       pVP                  4       pVP                  V4       V P	                  \
        VP                  \        4       4       VP                  4       pVP                  V4       V P                  W1P                  4       4       V P                  W!P                  4       4       VP                  4        VP                  4        R # r   )r   r  r0   r1   r   r  r.  r  r  assertIsNotrD   )r8   r  old_loopr3   s   &   r   test_set_event_loopPolicyTests.test_set_event_loopN  s    224((*h')V%:%:FHE$$&d#d1134#8#8#:;

r   c                D   V P                  \        R 4      ;_uu_ 4        \        P                  ! 4       pV P	                  V\        P
                  P                  4       V P                  V\        P                  ! 4       4       RRR4       R#   + '       g   i     R# ; i)-'asyncio.get_event_loop_policy' is deprecatedN)r   r  r   get_event_loop_policyrF  r   r  r  r  s   & r   test_get_event_loop_policy&PolicyTests.test_get_event_loop_policy\  su    """$SU U224F!!&'..*Q*QRMM&'"?"?"AB	U U U Us   A%BB	c                    V P                  \        R 4      ;_uu_ 4        V P                  \        \        P
                  \        4       4       RRR4       V P                  \        R4      ;_uu_ 4        \        P                  ! 4       pRRR4       \        P                  ! 4       pV P                  \        R 4      ;_uu_ 4        \        P
                  ! V4       RRR4       V P                  \        R4      ;_uu_ 4        V P                  V\        P                  ! 4       4       V P                  VX4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)z-'asyncio.set_event_loop_policy' is deprecatedNr  )r   r  r   r  r   set_event_loop_policyr.  r  r   r  r  r  )r8   
old_policyr  s   &  r   test_set_event_loop_policy&PolicyTests.test_set_event_loop_policyc  s;   """$SU U788&(DU
 """$SU U 668JU 224"""$SU U))&1U """$SU UMM&'"?"?"ABVZ0U UU U
U U
U UU U Us/   .E3EE)8E<E	E&	)E9	<F	r   N)rI   rJ   rK   rL   r  r  r  r  r  r  r   r$  r  r  r  r  r  rM   rN   rO   s   @r   r  r    s^     KJF/
1?
 
ZZ9: ;C1 1r   r  c                      a a ] tR tRt oRtRtRtRtRtRt	V 3R lt
V 3R lt]P                  R8w  d   R tR tR tR	 tR
tVtV ;t# )GetEventLoopTestsMixinix  Nc                @  < \         P                  V n        \         P                  V n        \         P
                  V n        \         P                  V n        \        P                  V n        \        P                  V n        \        V 4      P                  \         n        \        V 4      P                   \         n        \        V 4      P"                  \         n        \        V 4      P$                  \         n        \        V 4      P                  \        n        \        V 4      P                   \        n        \        V 4      P"                  \        n        \        V 4      P$                  \        n        \        V 4      P                  ;\        n
        \        P&                  n
        \        V 4      P                  ;\        n        \        P(                  n        \*        SV `Y  4        \        P.                  ! 4       V n        \        P2                  ! V P0                  4       R # r   )r   _get_running_loop_get_running_loop_saved_set_running_loop_set_running_loop_savedget_running_loopget_running_loop_savedr  get_event_loop_savedr   Task_Task_savedre  _Future_savedr  _get_running_loop_impl_set_running_loop_implget_running_loop_implget_event_loop_impltasksrd  r   r   r0   r3   r1   r   s   &r   r   GetEventLoopTestsMixin.setUp  sF   '-'?'?$'-'?'?$&,&=&=#$*$9$9!"<<$^^#':#D#D #':#D#D "&t*"B"B $T
 > >$(J$E$E!$(J$E$E!#':#C#C !%d!?!?,0JOO;w}})26t*2C2CC/**,	tyy)r   c                  <  \         SV `  4        V P                  P                  4        \        P
                  ! R 4       V P                  \        n        V P                  \        n
        V P                  \        n        V P                  \        n        V P                  \        n        V P                  \        n
        V P                  \        n        V P                  \        n        V P                  ;\        n        \        P"                  n        V P$                  ;\        n        \        P(                  n        R #   T P                  P                  4        \        P
                  ! R 4       T P                  \        n        T P                  \        n
        T P                  \        n        T P                  \        n        T P                  \        n        T P                  \        n
        T P                  \        n        T P                  \        n        T P                  ;\        n        \        P"                  n        T P$                  ;\        n        \        P(                  n        i ; ir   )r   r   r3   rD   r   r1   r  r   r  r  r  r  r  r  r  r  r   r  r  re  rd  r   s   &r   r   GetEventLoopTestsMixin.tearDown  s   	IGIIOO""4('+'C'CF$'+'C'CF$&*&A&AF#$($=$=F!(,(D(DG%(,(D(DG%'+'B'BG$%)%>%>G"040@0@@GL7==-6:6H6HHGNW__3 IIOO""4('+'C'CF$'+'C'CF$&*&A&AF#$($=$=F!(,(D(DG%(,(D(DG%'+'B'BG$%)%>%>G"040@0@@GL7==-6:6H6HHGNW__3s   D? ?D.I-r   c                   a  \         P                  ! 4        S P                  \        4       V 3R  lpS P	                  S P
                  P                  V! 4       4      R4       R# )c                  *  <"   \         P                  ! 4       R 8X  d   \         P                  ! R4      p MRp \        P                  P                  V R7      pSP                  P                  V\        4      G Rj  xL
 pVP                  4        V#  L5i)fork
forkserverN)
mp_context)
multiprocessingget_start_methodget_contextrc  rd  ProcessPoolExecutorr3   r{  r4   shutdown)r  poolr^  r8   s      r   rB  DGetEventLoopTestsMixin.test_get_event_loop_new_process.<locals>.main  s     "335?!0!<!<\!JJ!%J!))==#- > /#yy88D F FFs   A7B:B;Br*   N)r
   *skip_if_broken_multiprocessing_synchronizer  multiprocessing_cleanup_testsr  r3   r2   r8   rB  s   f r   test_get_event_loop_new_process6GetEventLoopTestsMixin.test_get_event_loop_new_process  sJ     >>@OO9: 		,,TV4r   c                T   a  V 3R  lpS P                   P                  V! 4       4       R# )c                    <"   \         P                  ! 4       p \        P                  ! \         P                  ! 4       4      ;_uu_ 4       p VP                  4        SP                  R 4       RRR4       SP                  \         P                  ! 4       V 4       R#   \         d     L<i ; i  + '       g   i     LH; i5i)zRuntimeError not raisedN)	r   r  r.   r/   r0   r  r  r   r  )running_loopr3   r8   s     r   rB  JGetEventLoopTestsMixin.test_get_running_loop_already_running.<locals>.main  s     "335L##G$:$:$<==9$$& II78 > MM'224lC $  >=sB   AC 
B-BB--/C B*'B-)B**B--B=	8C N)r3   r2   r  s   f r   %test_get_running_loop_already_running<GetEventLoopTestsMixin.test_get_running_loop_already_running  s    
	D 			$$TV,r   c                  a aa  ! R  R\         4      o ! V3R lR\        P                  4      p\        P                  P                  4       p \        P                  P                  V! 4       4       \        P                  ! 4       oS P                  S4      ;_uu_ 4        \        P                  ! 4        RRR4       \        P                  ! R4       S P                  S4      ;_uu_ 4        \        P                  ! 4        RRR4       S P                  \        R4      ;_uu_ 4        \        P                  ! 4        RRR4       S P                  \        P                  ! 4       R4       VV 3R lpSP!                  V! 4       4       \        P                  ! S4       S P                  S4      ;_uu_ 4        \        P                  ! 4        RRR4       \        P                  ! R4       S P                  S4      ;_uu_ 4        \        P                  ! 4        RRR4       \        P                  P                  V4       Se   SP#                  4        S P                  \        R4      ;_uu_ 4        \        P                  ! 4        RRR4       S P                  \        P                  ! 4       R4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL0; i  + '       g   i     L; i  \        P                  P                  T4       Se   SP#                  4        i i ; i  + '       g   i     L; i)c                       ] tR tRtRtR# )RGetEventLoopTestsMixin.test_get_event_loop_returns_running_loop.<locals>.TestErrori  r   N)rI   rJ   rK   rL   rM   r   r   r   	TestErrorr$    s    r   r%  c                   .   <a  ] tR tRt o V3R ltRtV tR# )OGetEventLoopTestsMixin.test_get_event_loop_returns_running_loop.<locals>.Policyi  c                   < Shr   r   )r8   r%  s   &r   r  ^GetEventLoopTestsMixin.test_get_event_loop_returns_running_loop.<locals>.Policy.get_event_loop  s    r   r   N)rI   rJ   rK   rL   r  rM   rN   )rP   r%  s   @r   Policyr'    s        r   r*  N
no runningc                     <"   SP                  \        P                  ! 4       S 4       SP                  \        P                  ! 4       S 4       SP                  \        P                  ! 4       S 4       R # 5ir   r  r   r  r  r  re  s   r   rt  MGetEventLoopTestsMixin.test_get_event_loop_returns_running_loop.<locals>.func  K     g446=g668$?g7794@   A2A5)r  r   r  r   r   _get_event_loop_policyr   r0   r   r  r1   r  r   r  r  r  r2   rD   )r8   r*  r  rt  r%  r3   s   f   @@r   (test_get_event_loop_returns_running_loop?GetEventLoopTestsMixin.test_get_event_loop_returns_running_loop  s3   		 		 Z66 	  ^^::<
	NN11&(;))+D""9--&&( .""4(""9--&&( . ''lCC((* DMM'335t<A
 ##DF+""4(""9--&&( .""4(""9--&&( . NN11*=

##L,??$$& @ 	g//148A .-- .-- DCC .-- .- NN11*=

   @?s   AL  J967L -K&L )K!?A9L 8K57L L	L 4M9K
		L K		L !K2	,	L 5L	 	L 	L	L 6MM%	c                  a a \         P                  P                  4       p \         P                  P                  \        P
                  ! 4       4       \         P                  ! 4       oS P                  SP                  4       S P                  \        R 4      ;_uu_ 4        \         P                  ! 4        RRR4       \         P                  ! R4       S P                  \        R 4      ;_uu_ 4        \         P                  ! 4        RRR4       VV 3R lpSP                  V! 4       4       \         P                  ! S4       S P                  \         P                  ! 4       S4       \         P                  ! R4       S P                  \        R 4      ;_uu_ 4        \         P                  ! 4        RRR4       \         P                  P                  V4       Se   SP                  4        S P                  \        R4      ;_uu_ 4        \         P                  ! 4        RRR4       S P                  \         P                   ! 4       R4       R#   + '       g   i     EL; i  + '       g   i     ELe; i  + '       g   i     L; i  \         P                  P                  T4       Se   SP                  4        i i ; i  + '       g   i     L; i)z
no currentNc                     <"   SP                  \        P                  ! 4       S 4       SP                  \        P                  ! 4       S 4       SP                  \        P                  ! 4       S 4       R # 5ir   r-  re  s   r   rt  NGetEventLoopTestsMixin.test_get_event_loop_returns_running_loop2.<locals>.func  r/  r0  r+  )r   r   r1  r   r   r  r0   r  rD   r  r   r  r1   r2   r  r  r  )r8   r  rt  r3   s   f  @r   )test_get_event_loop_returns_running_loop2@GetEventLoopTestsMixin.test_get_event_loop_returns_running_loop2  s   ^^::<
	NN11*2S2S2UV))+DOODJJ'''lCC&&( D ""4(''lCC&&( DA
 ##DF+""4(MM'002D9""4(''lCC&&( D NN11*=

##L,??$$& @ 	g//148; DCC DCC DC NN11*=

   @?sa   B J "I8<J 4I&
BJ I:4J KI#		J &I7	1	J :J
	J 6KK	)r  r  r  r  r  r  r3   )rI   rJ   rK   rL   r  r  r  r  r   re  r   r   r   r   r  r   r2  r7  rM   rN   r   r   s   @@r   r  r  x  sZ     !! DF*2I( ||w	2- -9^$9 $9r   r  c                       ] tR tRt]P
                  t]P                  t]P                  t
]P                  t]P                  P                  t]P"                  P$                  tRtR# )TestPyGetEventLoopi/  r   N)rI   rJ   rK   rL   r   _py__get_running_loopr  _py__set_running_loopr  _py_get_running_loopr  _py_get_event_loopr  r   r  _PyTaskr   rd  	_PyFuturere  rM   r   r   r   r:  r:  /  sP    #99#99"77 33==  D__&&Fr   r:  c                       ] tR tRt]P
                  t]P                  t]P                  t
]P                  t]P                  P                  t]P"                  P$                  tRtR# )TestCGetEventLoopi?  r   N)rI   rJ   rK   rL   r   _c__get_running_loopr  _c__set_running_loopr  _c_get_running_loopr  _c_get_event_loopr  r   r  _CTaskr   rd  _CFuturere  rM   r   r   r   rB  rB  ?  sP    !'!<!<!'!<!< & : :$66}}##))r   rB  c                   &   a  ] tR tRt o R tRtV tR# )
TestServeriI  c                h  a \         P                  ! 4       pV P                  VP                  4       \	        V4      oVP                  VP                  V3R  lR^ 4      4      pV P                  VP                  4       V4       VP                  4        VP                  VP                  4       4       R# )c                     < S # r   r   r  s   r   r  *TestServer.test_get_loop.<locals>.<lambda>O  s    Er   r  N)
r   r0   r  rD   r   r2   r  r  get_loopwait_closed)r8   r3   r  r  s   &  @r   test_get_loopTestServer.test_get_loopK  s    %%'

#((););M9VW)XY*D1 2 2 45r   r   N)rI   rJ   rK   rL   rP  rM   rN   rO   s   @r   rJ  rJ  I  s     6 6r   rJ  c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestAbstractServeriU  c                    V P                  \        4      ;_uu_ 4        \        P                  ! 4       P	                  4        R R R 4       R #   + '       g   i     R # ; ir   )r   r  r   AbstractServerrD   rC   s   &r   rv  TestAbstractServer.test_closeW  s8    233!!#))+ 4333   $AA	c                >   \         P                  ! 4       pV P                  VP                  4       V P	                  \
        4      ;_uu_ 4        VP                  \        P                  ! 4       P                  4       4       R R R 4       R #   + '       g   i     R # ; ir   )
r   r0   r  rD   r   r  r2   r   rU  rO  r[   s   & r   test_wait_closed#TestAbstractServer.test_wait_closed[  sa    %%'

#233##F$9$9$;$G$G$IJ 4333s   3BB	c                    V P                  \        4      ;_uu_ 4        \        P                  ! 4       P	                  4        R R R 4       R #   + '       g   i     R # ; ir   )r   r  r   rU  rN  rC   s   &r   rP   TestAbstractServer.test_get_loopb  s8    233!!#,,. 4333rW  r   N)	rI   rJ   rK   rL   rv  rY  rP  rM   rN   rO   s   @r   rS  rS  U  s     ,K/ /r   rS  __main__)r   vxworks)Nconcurrent.futuresrc  r.   r4  r  r  r  r   r@  r  r  r  ImportErrorr  r   r2  r   rS  rn  rx  r   rE  r5  r   r   r   r   multiprocessing.utilr   r  test.test_asyncior	   r   rl  r
   test.supportr   r   r   r   r   r   r'   r4   r6   r  rR   r   r  r   r   BaseProtocolr   r  r   r   r  TestCaser  r  r  r#  r  r  r  r%  r'  rx  r  r  r  r:  _asynciorB  rJ  rS  rI   rB  r   r   r   <module>rg     s      	  	  	    
       <<++    # P 1  & ) 5 50/ #''"" #'LHk H'g.. '@!'g&& !'H'w++ '2*:755 *:ZF FR6h? h?V	 <<7/2)22/P!4!5!+!4!4P, y*++	)#6#7#-#6#6	)0 y/**	L"5"6","5"5	L y.))	K!4!5!+!4!4	KI23)22I	F*%% FDV)"" V)rcX.. cLf1(## f1Rt9 t9n'/1B1B '*
*2H4E4E *	6"" 	6/** /$ zMMO qb  
CXa  		s#   K& K6 &	K32K36L ?L 