+
    Bi1                        ^ 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 ]P                  R8w  d   ]P                  ! R4      h^ RI
t
^ RIt^ RIt^ RIHt ^ RIHt R t ! R R	]P$                  4      t ! R
 R]P(                  4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t]R8X  d   ]P6                  ! 4        R# R# )    N)mockwin32zWindows only)windows_events)utilsc                  D    \         P                  P                  R 4       R # N)asyncioevents_set_event_loop_policy     </usr/lib/python3.14/test/test_asyncio/test_windows_events.pytearDownModuler      s    NN))$/r   c                   2   a  ] tR t^t o R tR tR tRtV tR# )
UpperProtoc                    . V n         R # r   )bufselfs   &r   __init__UpperProto.__init__   s	    r   c                    Wn         R # r   )trans)r   r   s   &&r   connection_madeUpperProto.connection_made   s    
r   c                   V P                   P                  V4       R V9   d_   V P                  P                  RP	                  V P                   4      P                  4       4       V P                  P                  4        R# R# )   
r   N)r   appendr   writejoinupperclose)r   datas   &&r   data_receivedUpperProto.data_received    sV    D=JJSXXdhh/5578JJ r   )r   r   N)	__name__
__module____qualname____firstlineno__r   r   r$   __static_attributes____classdictcell____classdict__s   @r   r   r      s      r   r   c                   2   a  ] tR t^'t o R tR tR tRtV tR# )WindowsEventsTestCasec                (    Wn         \        V4       R # r   )_unraisableprint)r   
unraisables   &&r   _unraisablehook%WindowsEventsTestCase._unraisablehook(   s     &jr   c                h    \         P                  V n        R V n        V P                  \         n        R # r   )sysunraisablehook_prev_unraisablehookr1   r4   r   s   &r   setUpWindowsEventsTestCase.setUp.   s&    $'$6$6!!11r   c                f    V P                   \        n        V P                  V P                  4       R # r   )r9   r7   r8   assertIsNoner1   r   s   &r   tearDownWindowsEventsTestCase.tearDown3   s$    !66$**+r   )r9   r1   N)	r&   r'   r(   r)   r4   r:   r>   r*   r+   r,   s   @r   r/   r/   '   s     2
, ,r   r/   c                   &   a  ] tR t^7t o R tRtV tR# )ProactorLoopCtrlCc                n   R  p\         P                  ! VR7      p\        P                  ! 4       p VP	                  VP
                  4       VP                  4        V P                  R4       V P                  V4       VP                  4        R#   \         d     L0i ; i  T P                  T4       i ; i)c                  z    \         P                  ! R 4       \        P                  ! \        P                  4       R# )g?N)timesleepsignalraise_signalSIGINTr   r   r   SIGINT_after_delay9ProactorLoopCtrlC.test_ctrl_c.<locals>.SIGINT_after_delay;   s    JJsO.r   targetz%should not fall through 'run_forever'N)	threadingThreadr	   new_event_loop	call_soonstartrun_foreverfailKeyboardInterrupt
close_loopr    )r   rI   threadloops   &   r   test_ctrl_cProactorLoopCtrlC.test_ctrl_c9   s    	/ !!);<%%'	"NN6<<(II=> OOD!	 ! 		 OOD!s#   <B BB! BB! !B4r   N)r&   r'   r(   r)   rX   r*   r+   r,   s   @r   rA   rA   7   s      r   rA   c                   &   a  ] tR t^Mt o R tRtV tR# )ProactorMultithreadingc                   aa R oR oVV3R lp\         P                  ! VR7      pVP                  4        VP                  4        V P	                  S4       R# )Fc                  N   "   \         P                  ! ^ 4      G Rj  xL
  R#  L5i)r   N)r	   rE   r   r   r   coroAProactorMultithreading.test_run_from_nonmain_thread.<locals>.coroQ   s     --"""s   %#%c                     < \         P                  ! 4       p V P                  S! 4       4       V P                  4        R oR# )TN)r	   rO   run_until_completer"   )rW   r^   finisheds    r   funcAProactorMultithreading.test_run_from_nonmain_thread.<locals>.funcT   s/    ))+D##DF+JJLHr   rK   N)rM   rN   rQ   r    
assertTrue)r   rc   rV   r^   rb   s   &  @@r   test_run_from_nonmain_thread3ProactorMultithreading.test_run_from_nonmain_threadN   sB    	#	 !!.!r   r   N)r&   r'   r(   r)   rf   r*   r+   r,   s   @r   r[   r[   M   s     " "r   r[   c                   z   a a ] tR t^bt o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VtV ;t# )ProactorTestsc                   < \         SV `  4        \        P                  ! 4       V n        V P                  V P                  4       R # r   )superr:   r	   ProactorEventLooprW   set_event_loop)r   	__class__s   &r   r:   ProactorTests.setUpd   s.    --/	DII&r   c                   \         P                  ! 4       w  rV P                  P                  V\        P
                  ! 4       4      p\        P                  ! V P                  P                  V^d4      V P                  R7      pVP                  4        V P                  P                  V4       V P                  VP                  4       R4       VP                  4        R# )d   rW   r   N)socket
socketpairrW   _make_socket_transportr	   Protocolensure_future	sock_recvr"   ra   assertEqualresult)r   abr   fs   &    r   
test_closeProactorTests.test_closei   s      "		00G4D4D4FG!!$))"5"5a"=DIIN		$$Q'S)		r   c                (   R \         P                  ! 4       ,          p\        P                  ! V4      pV P	                  \
        4      ;_uu_ 4        \        P                  ! V4       RRR4       VP                  4        R#   + '       g   i     L"; i)z\\.\pipe\test_double_bind-%sN)osgetpidr   
PipeServerassertRaisesPermissionErrorr"   )r   ADDRESSserver1s   &  r   test_double_bindProactorTests.test_double_bindr   sX    1BIIK? ++G4//%%g. 0 0/s   BB	c                |    V P                   P                  V P                  4       4      pV P                  VR 4       R# doneN)rW   ra   
_test_pipery   r   ress   & r   	test_pipeProactorTests.test_pipey   s-    ii**4??+<=f%r   c                  a"   R \         P                  ! 4       ,          pV P                  \        4      ;_uu_ 4        V P                  P                  \        P                  V4      G Rj  xL
  RRR4       V P                  P                  \        V4      G Rj  xL
 w  pV P                  V\        P                  4       . p\        ^4       F  p\        P                  ! V P                  R7      p\        P                  ! VV P                  R7      oV P                  P                  V3R lV4      G Rj  xL
 w  rgV P                  V\        P                   4       V P#                  SV4       VP%                  WV34       K  	  \'        V4       F6  w  pw  rV	P)                  RP+                  V4      P-                  4       4       K8  	  \'        V4       F_  w  pw  rVP/                  4       G Rj  xL
 p
V P#                  V
RP+                  V4      P-                  4       4       V	P1                  4        Ka  	  VP1                  4        V P                  \        4      ;_uu_ 4        V P                  P                  \        P                  V4      G Rj  xL
  RRR4       R#  EL9  + '       g   i     EL@; i EL  EL L L-  + '       g   i     R# ; i5i)z\\.\pipe\_test_pipe-%sNrr   c                     < S # r   r   )protocols   r   <lambda>*ProactorTests._test_pipe.<locals>.<lambda>   s    r   z	lower-{}
z	LOWER-{}
r   )r   r   r   FileNotFoundErrorrW   create_pipe_connectionr	   rv   start_serving_piper   assertIsInstancer   r   rangeStreamReaderStreamReaderProtocol	Transportry   r   	enumerater   formatencodereadliner"   )r   r   serverclientsistream_readerr   protorwresponser   s   &          @r   r   ProactorTests._test_pipe}   s,    +biik9011))22  '+ + + 2 55! !fn&?&?@qA#00dii@M33M9=DH!%!A!A '"+ +LE!!%):):;Xu-NNM12  #7+IAvGGL''*1134 , #7+IAvZZ\)HX|':':1'='D'D'FGGGI ,
 	011))22  '+ + + 2 A+ 211!+ *+ 21 s   :K.J'+J$,J'0+KJ;BK8J>9B9K2K3A4K'.KKK
K$J''J8	2
K>KKKK		Kc           	     6   \        4       p\        P                  Vn        \        P
                  P                  \        R VR7      ;_uu_ 4       pV P                  P                  P                  R4      pV P                  P                  V4      pVP                  4        V P                  \        P                  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)ConnectPipe)side_effectpipe_addressN)OSError_overlappedERROR_PIPE_BUSYwinerrorr   patchobjectrW   	_proactorconnect_pipecreate_taskcancelr   r	   CancelledErrorra   )r   excconnectr^   tasks   &    r   test_connect_pipe_cancel&ProactorTests.test_connect_pipe_cancel   s    i"22ZZ{M+.  0 03:99&&33NCD99((.D KKM""7#9#9::		,,T2 ;0 0 ;:0 0 0s%   A8DC4	"D4D?DD	c                P   \         P                  ! R RRR 4      pV P                  \        P                  V4       RpV P
                  P                  P                  W4      pV P
                  P                  4       pV P
                  P                  V4      pV P
                  P                  4       V,
          pV P                  VR4       V P                  VP                  4       4       V P                  Wb\        P                  ,
          4       \         P                   ! V4       V P
                  P                  P                  V^
4      pV P
                  P                  V4      pV P                  VR4       V P#                  VP                  4       4       VP%                  4        R # )NTFg      ?)r   CreateEvent
addCleanup_winapiCloseHandlerW   r   wait_for_handlerD   ra   ry   assertFalserz   assertGreaterEqual
test_utils	CLOCK_RESSetEventre   r   )r   eventtimeoutfutrQ   r   elapseds   &      r   test_wait_for_handle"ProactorTests.test_wait_for_handle   s0   ''dE4@++U3 ii!!11%A		 yy++C0)).."U*u%&:3G3G)GHU# ii!!11%<yy++C0t$

% 	

r   c                *   \         P                  ! R RRR 4      pV P                  \        P                  V4       V P
                  P                  P                  V^
4      pVP                  4        V P                  \        P                  4      ;_uu_ 4        V P
                  P                  V4       R R R 4       V P
                  P                  P                  V4      pVP                  4        VP                  4        R #   + '       g   i     LW; i)NTF)r   r   r   r   r   rW   r   r   r   r   r	   r   ra   )r   r   r   s   &  r   test_wait_for_handle_cancel)ProactorTests.test_wait_for_handle_cancel   s    ''dE4@++U3 ii!!11%<

w5566II((- 7
 ii!!11%8



 76s   DD	c                "   \         P                  ! 4       V P                  n        V P                  P	                  R R 4      pV P                  P                  4        V P                  P                  4        V P                  P                  4        V P                  P                  4        V P                  P                  V4       V P                  V P                  4       V P                  V P                  P                  P                  4       R # )Nc                      R # r   r   r   r   r   r   ;ProactorTests.test_read_self_pipe_restart.<locals>.<lambda>   s    Dr   )r   MockrW   call_exception_handlerrun_in_executorstoprR   ra   rU   r   called)r   r}   s   & r   test_read_self_pipe_restart)ProactorTests.test_read_self_pipe_restart   s     ,099;		(
 II%%dL9								 			$$Q' 			"99@@Ar   c                   V P                   P                  p\        P                  ! \        P                  R 7      pRpV P	                  \
        4      ;_uu_ 4        VP                  W#4       RRR4       V P	                  \
        4      ;_uu_ 4        VP                  VRVR7       RRR4       VP                  4        R#   + '       g   i     L\; i  + '       g   i     L5; i))typeNs   abc)addr)	rW   r   rs   
SOCK_DGRAMr   	TypeErrorr   sendtor"   )r   proactorsockbad_addresss   &   r    test_address_argument_type_error.ProactorTests.test_address_argument_type_error   s    99&&}}&"3"34y))T/ *y))OOD&{O; *

	 *)))s   CCC	C$	c                |    V P                   P                  V P                  4       4      pV P                  VR 4       R# r   )rW   ra   _test_client_pipe_statry   r   s   & r   test_client_pipe_stat#ProactorTests.test_client_pipe_stat  s/    ii**4+F+F+HIf%r   c                B  aa"   R \         P                  ! 4       ,          oV3R lpV P                  \        4      ;_uu_ 4        V! 4       G Rj  xL
  RRR4       V P                  P                  \        P                  S4      G Rj  xL
 w  pV P                  V\        P                  4       . oV P                  P                  V3R l4       \        ^4       F+  pV P                  P                  V! 4       4      G Rj  xL
  K-  	  V P                  \        S4      ^ S4       VP!                  4        V P                  \        4      ;_uu_ 4        V! 4       G Rj  xL
  RRR4       R#  EL  + '       g   i     EL&; i L L L)  + '       g   i     R# ; i5i)z!\\.\pipe\test_client_pipe_stat-%sc                  d  <"   \         P                  ! S4      p  \        P                  ! \         P                  ! S4      4       \        P                  ! V 4       R #   \         d+   pTP
                  \         P                  8w  d   h  R p?LHR p?ii ; i  \        P                  ! T 4       i ; i5ir   )r   r   r   r   r   r   r   )her   s     r   probe3ProactorTests._test_client_pipe_stat.<locals>.probe  s     ''0A'##K$;$;G$DE
 ##A&	  ::!<!<< = ##A&s:   B0*A B0B( BB BB B--B0Nc                 &   < SP                  V4      # r   )r   )_r#   errorss   &&r   r   6ProactorTests._test_client_pipe_stat.<locals>.<lambda>   s    d8Kr   r   )r   r   r   r   rW   r   r	   rv   r   r   r   set_exception_handlerr   r   ry   lenr"   )r   r   r   r   r   r   s   &   @@r   r   $ProactorTests._test_client_pipe_stat
  s*    6D		' 011'MM 2 55g6F6FPPfn&?&?@		''(KLqA))''000  	Va0011'MM 2 %  211 Q 1  21 sz   A FE1E.E15F	F
A8FFAFFF	 F$
F.E11F	<
FF	FF		Fc                  a a \         P                  ! 4       oV V3R  lp\         P                  ! VR7      p\        P                  ! 4       ^
,           pS P                  P                  VP                  4       S P                  '       gR   S P                  P                  4        S P                  P                  4        \        P                  ! 4       V8  g   Kb   SP                  4        VP                  4        R# )c                     < SP                  4       '       g5   S P                  P                  R  4       \        P                  ! R4       KJ  R# )c                      R # r   r   r   r   r   r   EProactorTests.test_loop_restart.<locals>.threadMain.<locals>.<lambda>4  s    tr   g{Gz?N)is_setrW   call_soon_threadsaferD   rE   )r   r   s   r   
threadMain3ProactorTests.test_loop_restart.<locals>.threadMain2  s1    kkmm		..|<

4  $r   rK   N)rM   EventrN   rD   rW   rP   rQ   r1   r   rR   setr    )r   r   thrend_timer   s   f   @r   test_loop_restartProactorTests.test_loop_restart.  s      	! j1
 99;#		CII&"""IINNII!!#yy{h&

r   rr   )r&   r'   r(   r)   r:   r~   r   r   r   r   r   r   r   r   r   r   r  r*   r+   __classcell__)rn   r-   s   @@r   ri   ri   b   sN     '
&$L3<"B8	&"H r   ri   c                   ,   a  ] tR tRt o R tR tRtV tR# )WinPolicyTestsiG  c                  a  V 3R  lp\         P                  P                  4       p S P                  \        R4      ;_uu_ 4        \         P                  P                  \         P                  ! 4       4       RRR4       \         P                  ! V! 4       4       \         P                  P                  V4       R#   + '       g   i     LL; i  \         P                  P                  T4       i ; i)c                  v   <"   S P                  \        P                  ! 4       \        P                  4       R # 5ir   )r   r	   get_running_loopSelectorEventLoopr   s   r   main5WinPolicyTests.test_selector_win_policy.<locals>.mainJ  s%     !!'":":"<g>W>WX   69z6'asyncio.WindowsSelectorEventLoopPolicy' is deprecatedN)r	   r
   _get_event_loop_policyassertWarnsRegexDeprecationWarningr   WindowsSelectorEventLoopPolicyrunr   r  
old_policys   f  r   test_selector_win_policy'WinPolicyTests.test_selector_win_policyI  s    	Y ^^::<
	>&&"H  55g6\6\6^_	
 KKNN11*=  NN11*=#   C 3B<8#C <C	C !C0c                  a  V 3R  lp\         P                  P                  4       p S P                  \        R4      ;_uu_ 4        \         P                  P                  \         P                  ! 4       4       RRR4       \         P                  ! V! 4       4       \         P                  P                  V4       R#   + '       g   i     LL; i  \         P                  P                  T4       i ; i)c                  v   <"   S P                  \        P                  ! 4       \        P                  4       R # 5ir   )r   r	   r  rl   r   s   r   r  5WinPolicyTests.test_proactor_win_policy.<locals>.mainY  s)     !!((*))+r  z6'asyncio.WindowsProactorEventLoopPolicy' is deprecatedN)r	   r
   r  r  r  r   WindowsProactorEventLoopPolicyr  r  s   f  r   test_proactor_win_policy'WinPolicyTests.test_proactor_win_policyX  s    	+
 ^^::<
	>&&"H  55g6\6\6^_	
 KKNN11*=  NN11*=r  r   N)r&   r'   r(   r)   r  r   r*   r+   r,   s   @r   r
  r
  G  s     >> >r   r
  __main__)r   rF   rs   r7   rD   rM   unittestr   platformSkipTestr   r   r	   r   test.test_asyncior   r   r   rv   r   TestCaser/   rA   r[   ri   r
  r&   r  r   r   r   <module>r(     s    	   
    <<7


N
++    " 10!! ,J// , - ,"2 "*b) bJ >*  >F zMMO r   