+
    Bi]                     p   ^ RI t ^ RIHtHtHtHtHtHt ^ RIH	t	 ^ RI
Ht ^ RIt^ RIt^ RIHt R t ! R R]P$                  4      t ! R	 R
]P$                  4      t ! R R]P$                  4      t ! R R]]P$                  4      t ! R R]P$                  4      t]R8X  d   ]P2                  ! 4        R# R# )    N)asynccontextmanagerAbstractAsyncContextManagerAsyncExitStacknullcontextaclosingcontextmanager)support)run_no_yield_async_fn)TestBaseExitStackc                F   a  \         P                  ! S 4      V 3R l4       pV# )z?Decorator to turn an async function into a synchronous functionc                  "   < \        S.V O5/ VB # N)_run_async_fn)argskwargsasync_fns   *,1/usr/lib/python3.14/test/test_contextlib_async.pywrapper_async_test.<locals>.wrapper   s    X7777    )	functoolswraps)r   r   s   f r   _async_testr      s%    __X8 8 Nr   c                   \   a  ] tR t^t o ]R 4       t]R 4       t]R 4       tR tR t	Rt
V tR# )TestAbstractAsyncContextManagerc                8  "    ! R  R\         4      pV! 4       pT P                  VP                  4       G Rj  xL
 V4       T;_uu_4       GRj  xL
 pV P                  W#4       RRR4      GRj  xL
  R#  L? L) L
  + GRj  xL 
 '       g   i     R# ; i5i)c                   2   a a ] tR t^t oV 3R ltRtVtV ;t# )@TestAbstractAsyncContextManager.test_enter.<locals>.DefaultEnterc                @   <"   \         SV `  ! V!  G R j  xL
  R #  L5ir   super	__aexit__selfr   	__class__s   &*r   r"   JTestAbstractAsyncContextManager.test_enter.<locals>.DefaultEnter.__aexit__        g'...    __name__
__module____qualname____firstlineno__r"   __static_attributes____classdictcell____classcell__r%   __classdict__s   @@r   DefaultEnterr           / /r   r4   N)r   assertIs
__aenter__)r$   r4   managercontexts   &   r   
test_enter*TestAbstractAsyncContextManager.test_enter   sa     	/6 	/ .G..00':77gMM'+ 77 1777s]   5BA7BA9BA=%B0A;1B9B;B=B	B
B	B		Bc                   "    ! R  R\         4      pV P                  \        4      ;_uu_ 4        V! 4       p^*Vn        RRR4       R#   + '       g   i     R# ; i5i)c                   6   a a ] tR t^&t oRtV 3R ltRtVtV ;t# )NTestAbstractAsyncContextManager.test_slots.<locals>.DefaultAsyncContextManagerc                @   <"   \         SV `  ! V!  G R j  xL
  R #  L5ir   r    r#   s   &*r   r"   XTestAbstractAsyncContextManager.test_slots.<locals>.DefaultAsyncContextManager.__aexit__)   r'   r(   r)   )	r+   r,   r-   r.   	__slots__r"   r/   r0   r1   r2   s   @@r   DefaultAsyncContextManagerr>   &   s     I/ /r   rB   N)r   assertRaisesAttributeErrorvar)r$   rB   r8   s   &  r   
test_slots*TestAbstractAsyncContextManager.test_slots$   sB     	/)D 	/ ~..02GGK /...s   -AA
AA		Ac                   a"   \         R  4       oV3R lpV! 4       pV  Rj  xL
  pV P                  V^4        TP                  4       G Rj  xL
  R#  L2D3L L
5i)c                    "   R 5x  R # 5ir   r)   r)   r   r   ctxUTestAbstractAsyncContextManager.test_async_gen_propagates_generator_exit.<locals>.ctx4           
c                    <"   S ! 4       ;_uu_4       GR j  xL
  ^5x  R R R 4      GR j  xL
  R #  L L  + GR j  xL 
 '       g   i     R # ; i5ir   r)   )rJ   s   r   genUTestAbstractAsyncContextManager.test_async_gen_propagates_generator_exit.<locals>.gen8   s#     uuu uuuuus@   A3A7A5AAA	A 
A		A		AN)r   assertEqualaclose)r$   rO   gvalrJ   s   &   @r   (test_async_gen_propagates_generator_exitHTestAbstractAsyncContextManager.test_async_gen_propagates_generator_exit0   se      
	 
		 E 	 	#S"%hhj	 	s7   AAAA(AAAAAAc                     ! R  R\         4      pV P                  \        4      ;_uu_ 4        V! 4        RRR4       R#   + '       g   i     R# ; i)c                       ] tR t^CtRtR# )KTestAbstractAsyncContextManager.test_exit_is_abstract.<locals>.MissingAexitr)   Nr+   r,   r-   r.   r/   r)   r   r   MissingAexitrY   C       r   r[   N)r   rC   	TypeError)r$   r[   s   & r   test_exit_is_abstract5TestAbstractAsyncContextManager.test_exit_is_abstractB   s6    	6 	 y))N *)))s	   ?A	c                    ! R  R4      pV P                  V\        4        ! R R\        4      pV P                  V\        4        ! R RV4      pV P                  V\        4        ! R RV4      pV P                  V\        4       R# )	c                   ,   a  ] tR t^Jt o R tR tRtV tR# )WTestAbstractAsyncContextManager.test_structural_subclassing.<locals>.ManagerFromScratchc                   "   V # 5ir   r)   r$   s   &r   r7   bTestAbstractAsyncContextManager.test_structural_subclassing.<locals>.ManagerFromScratch.__aenter__K   s
        c                   "   R # 5ir   r)   )r$   exc_type	exc_value	tracebacks   &&&&r   r"   aTestAbstractAsyncContextManager.test_structural_subclassing.<locals>.ManagerFromScratch.__aexit__M   s     rf   r)   Nr+   r,   r-   r.   r7   r"   r/   r0   r3   s   @r   ManagerFromScratchrb   J   s      r   rn   c                   2   a a ] tR t^Rt oV 3R ltRtVtV ;t# )QTestAbstractAsyncContextManager.test_structural_subclassing.<locals>.DefaultEnterc                @   <"   \         SV `  ! V!  G R j  xL
  R #  L5ir   r    r#   s   &*r   r"   [TestAbstractAsyncContextManager.test_structural_subclassing.<locals>.DefaultEnter.__aexit__S   r'   r(   r)   r*   r2   s   @@r   r4   rp   R   r5   r   r4   c                       ] tR t^XtRtRtR# )OTestAbstractAsyncContextManager.test_structural_subclassing.<locals>.NoneAenterNr)   )r+   r,   r-   r.   r7   r/   r)   r   r   
NoneAenterrt   X   s    Jr   ru   c                       ] tR t^]tRtRtR# )NTestAbstractAsyncContextManager.test_structural_subclassing.<locals>.NoneAexitNr)   )r+   r,   r-   r.   r"   r/   r)   r   r   	NoneAexitrw   ]   s    Ir   rx   N)assertIsSubclassr   assertNotIsSubclass)r$   rn   r4   ru   rx   s   &    r   test_structural_subclassing;TestAbstractAsyncContextManager.test_structural_subclassingI   s    	 	 	02MN	/6 	/ 	l,GH	+ 	 	  -HI	* 	 	  ,GHr   r)   N)r+   r,   r-   r.   r   r:   rF   rU   r^   r{   r/   r0   rm   s   @r   r   r      sP     	, 	, 	 	  "I Ir   r   c                   ~  a  ] tR t^ct o ]R 4       t]R 4       t]R 4       t]R 4       t]R 4       t	]R 4       t
]R 4       t]R 4       t]R	 4       t]R
 4       t]R 4       tR tR t]P&                  R 4       t]P&                  ]R 4       4       t]R 4       t]R 4       t]R 4       t]R 4       t]R 4       tRtV tR# )AsyncContextManagerTestCasec                V  a"   . o\         V3R  l4       pV! 4       ;_uu_4       GRj  xL
 pV P                  S^.4       V P                  V^*4       SP                  V4       RRR4      GRj  xL
  V P                  S. RO4       R#  L` L  + GRj  xL 
 '       g   i     L3; i5i)c                 ^   <"   S P                  ^4       ^*5x  S P                  R4       R# 5i     Nappendstates   r   woohooEAsyncContextManagerTestCase.test_contextmanager_plain.<locals>.woohooh   s"     LLOHLLs   *-Nr   *   r   )r   rQ   r   r$   r   xr   s   &  @r   test_contextmanager_plain5AsyncContextManagerTestCase.test_contextmanager_plaine   s{     		 
	 888qUQC(Q#LLO 8 	-	 888sJ   %B)B	B)7B#B).B/B)B)B&	B
B&	B&	!B)c           
       a"   . o\         V3R  l4       pV P                  \        4      ;_uu_ 4        V! 4       ;_uu_4       GRj  xL
 pV P                  S^.4       V P                  V^*4       SP	                  V4       \        4       h LD  + GRj  xL 
 '       g   i     M; i RRR4       M  + '       g   i     M; iT P                  S. RO4       R# 5i)c                    <"   S P                  ^4        ^*5x  S P                  R4       R#   S P                  R4       i ; i5ir   r   r   s   r   r   GAsyncContextManagerTestCase.test_contextmanager_finally.<locals>.woohoov   s3     LLO"S!S!s   A. AAANr   )r   rC   ZeroDivisionErrorrQ   r   r   s   &  @r   test_contextmanager_finally7AsyncContextManagerTestCase.test_contextmanager_finallys   s     		" 
	" 011xxx1  ,  B'Q'))	  xxxx 2111 	-sS   /CB3BB3
AB	B3B&B
B&B&!B3*	C3C	>Cc                  "   \         R  4       p V! 4       ;_uu_4       GRj  xL
  ^^ ,           RRR4      GRj  xL
  T P                  \        X4      ^4       T P                  T^ ,          P                  R4       T P                  T^ ,          P                  R4        ! R R\        4      p T! 4       ;_uu_4       GRj  xL
  T! ^*4      h L L  + GRj  xL 
 '       g   i     L; i  \         d+   p\        P                  ! TP                  4      p Rp?LRp?ii ; i Ld  + GRj  xL 
 '       g   i     M7; i  T d+   p\        P                  ! TP                  4      p Rp?MRp?ii ; iT P                  \        T4      ^4       T P                  T^ ,          P                  R4       T P                  T^ ,          P                  R4        ! R R\        4      p ! R	 R
\        4      p\        R4      \        R4      T! R4      T! R4      3 EFB  pT P                  \        T4      R7      ;_uu_ 4         T! 4       ;_uu_4       GRj  xL 
  Th  + GRj  xL 
 '       g   i     M; i T P                  T R24       MN  \        T4       d<   pT P                  Y'4       \        P                  ! TP                  4      p Rp?MRp?ii ; iT P                  \        T4      ^4       T P                  T^ ,          P                  R4       T P                  T^ ,          P                  R4       RRR4       EK0    + '       g   i     EKB  ; i	  R# 5i)c                    "   R 5x  R # 5ir   r)   r)   r   r   fDAsyncContextManagerTestCase.test_contextmanager_traceback.<locals>.f   rL   rM   Ntest_contextmanager_tracebackz1/0c                       ] tR t^tRtR# )WAsyncContextManagerTestCase.test_contextmanager_traceback.<locals>.RuntimeErrorSubclassr)   NrZ   r)   r   r   RuntimeErrorSubclassr      r\   r   r   zraise RuntimeErrorSubclass(42)c                       ] tR t^tRtR# )XAsyncContextManagerTestCase.test_contextmanager_traceback.<locals>.StopIterationSubclassr)   NrZ   r)   r   r   StopIterationSubclassr      r\   r   r   c                       ] tR t^tRtR# )]AsyncContextManagerTestCase.test_contextmanager_traceback.<locals>.StopAsyncIterationSubclassr)   NrZ   r)   r   r   StopAsyncIterationSubclassr      r\   r   r   spamhamtype was suppressedzraise stop_exc)r   r   rj   
extract_tb__traceback__rQ   lennamelineRuntimeErrorStopIterationStopAsyncIterationsubTestr   failr6   )r$   r   eframesr   r   r   stop_excs   &       r   r   9AsyncContextManagerTestCase.test_contextmanager_traceback   sh    		 
		;sss! s
 	Va()HI/	< 		;sss*2.. sss  	;))!//:F	; sss# 	;))!//:F	; 	Va()HI)IJ	M 		); 	 &!u%!&)&v.	
H 4>22< sss&  #ssss II
/:;	 H~ CMM!.&11!//BFC   Va0  1PQ  1AB 3222
s]  M(C2 CC2 
CC2 CC2 A0M(2E D*E 		D,C2 C2 C/	C
C/	(C/	*C2 .M(/C2 2D'= D"M("D''M(*E ,E	2D53
E	>E	 E M(E E9 E4/M(4E99CM(MJIJ I##I<)I,*
I<5I<7J MK 	%1K	MK 	 A$MM(M!M(c                   "   \         R  4       pV! 4       pVP                  4       G Rj  xL
  T P                  VP                  \        \	        R4      R4      G Rj  xL
 4       R#  L= L5i)c                    "   R 5x  R # 5ir   r)   r)   r   r   wheeHAsyncContextManagerTestCase.test_contextmanager_no_reraise.<locals>.whee   rL   rM   Nfoo)r   r7   assertFalser"   r]   )r$   r   rJ   s   &  r   test_contextmanager_no_reraise:AsyncContextManagerTestCase.test_contextmanager_no_reraise   sY     		 
	fnns}}Y	%8H$OOP 	Os!   'A+A'2A+A)A+)A+c                  "   \         R  4       pV! 4       pVP                  4       G Rj  xL
  V P                  \        4      ;_uu_ 4        VP	                  \
        \        R4      R4      G Rj  xL
  RRR4       \        P                  ! RR7      '       d(   V P                  VP                  P                  4       R# R#  L LT  + '       g   i     LZ; i5i)c                 4   "    R 5x  R #    R 5x   R # ; i5ir   r)   r)   r   r   whooTAsyncContextManagerTestCase.test_contextmanager_trap_yield_after_throw.<locals>.whoo   s     s    Nr   Tcpython)r   r7   rC   r   r"   r]   r	   check_impl_detailr   rO   ag_suspendedr$   r   rJ   s   &  r   *test_contextmanager_trap_yield_after_throwFAsyncContextManagerTestCase.test_contextmanager_trap_yield_after_throw   s     		 
	
 fnn|,,--	9U+;TBBB -$$T22SWW112 3 	B -,s?   'CC!C$C/C0C4$C*CCC	Cc                   "   \         R  4       pV! 4       pV P                  \        4      ;_uu_ 4        VP                  4       G Rj  xL
  RRR4       R#  L  + '       g   i     R# ; i5i)c                    "   R# 5i)FNr)   r)   r   r   r   KAsyncContextManagerTestCase.test_contextmanager_trap_no_yield.<locals>.whoo   s     rf   N)r   rC   r   r7   r   s   &  r   !test_contextmanager_trap_no_yield=AsyncContextManagerTestCase.test_contextmanager_trap_no_yield   sW     		 
	 f|,,..""" -," -,,s.   1A,AAA
A,AA)	#	A,c                  "   \         R  4       pV! 4       pVP                  4       G Rj  xL
  V P                  \        4      ;_uu_ 4        VP	                  RRR4      G Rj  xL
  RRR4       \
        P                  ! RR7      '       d(   V P                  VP                  P                  4       R# R#  L LT  + '       g   i     LZ; i5i)c                 "   "   R 5x  R 5x  R # 5ir   r)   r)   r   r   r   OAsyncContextManagerTestCase.test_contextmanager_trap_second_yield.<locals>.whoo   s     s   NTr   )
r   r7   rC   r   r"   r	   r   r   rO   r   r   s   &  r   %test_contextmanager_trap_second_yieldAAsyncContextManagerTestCase.test_contextmanager_trap_second_yield   s     		 
	 fnn|,,--dD111 -$$T22SWW112 3 	1 -,s?   'CB5!CB9"B7#B9'$C*C7B99C		Cc                  "   \         R  4       pV! 4       pVP                  4       G Rj  xL
  V P                  \        4      ;_uu_ 4        VP	                  \
        RR4      G Rj  xL
  RRR4       R#  LK L  + '       g   i     R# ; i5i)c                 D   "    R 5x  R #   \          d    \        hi ; i5ir   )r   SyntaxErrorr)   r   r   r   LAsyncContextManagerTestCase.test_contextmanager_non_normalised.<locals>.whoo   s!     " "!!"s       N)r   r7   rC   r   r"   r   r   s   &  r   "test_contextmanager_non_normalised>AsyncContextManagerTestCase.test_contextmanager_non_normalised   sr     		" 
	" fnn{++--dD999 ,+ 	9 ,++s9   'BA5!BA9&A7'A9+B7A99B
		Bc                L  a a"   . o\         V V3R  l4       pV! 4       ;_uu_4       GRj  xL
 pS P                  S^.4       S P                  V^*4       SP                  V4       \        R4      h LE  + GRj  xL 
 '       g   i     M; iS P                  S. RO4       R# 5i)c                    <"   SP                  ^4        ^*5x  R#   \         dB   p SP                  T P                  ^ ,          4       SP                  S. RO4        Rp ? R# Rp ? ii ; i5i)r   Nr   )r   r   r   rQ   )r   r$   r   s    r   r   FAsyncContextManagerTestCase.test_contextmanager_except.<locals>.woohoo   sQ     LLO6$ 6QVVAY'  556s*   A, A,A)6A$A,$A))A,Nr   r   )r   rQ   r   r   r   s   f  @r   test_contextmanager_except6AsyncContextManagerTestCase.test_contextmanager_except   s     		6 
	6 888qUQC(Q#LLO#C((	 888
 	-s9   &B$A0B$AA20B$2B	8A;9
B	B	B$c                (  "   \         R  4       p ! R R\        4      p ! R R\        4      p\        R4      \        R4      V! R4      V! R4      3 F@  pV P                  \	        V4      R7      ;_uu_ 4         V! 4       ;_uu_4       GRj  xL
  Vh	  R#  L
  + GRj  xL 
 '       g   i     M; i T P                  T R	24       M)  \         d   pT P                  YT4        Rp?MRp?ii ; iRRR4       K    + '       g   i     K  ; i5i)
c                    "   R 5x  R # 5ir   r)   r)   r   r   r   OAsyncContextManagerTestCase.test_contextmanager_except_stopiter.<locals>.woohoo  rL   rM   c                       ] tR tRtRtR# )^AsyncContextManagerTestCase.test_contextmanager_except_stopiter.<locals>.StopIterationSubclassi  r)   NrZ   r)   r   r   r   r     r\   r   r   c                       ] tR tRtRtR# )cAsyncContextManagerTestCase.test_contextmanager_except_stopiter.<locals>.StopAsyncIterationSubclassi  r)   NrZ   r)   r   r   r   r     r\   r   r   r   r   r   Nr   )r   r   r   r   r   r   	Exceptionr6   )r$   r   r   r   r   exs   &     r   #test_contextmanager_except_stopiter?AsyncContextManagerTestCase.test_contextmanager_except_stopiter  s     		 
		M 		); 	 &!u%!&)&v.	
H 4>22<%xxx&
  (xxxx
 II
/:; ! 0MM"//0	 3222s   A5D7C>9CBCBDCB2B" 
B2+B2-C6C>C1	C,	'C>,C1	1C>4
D>D		Dc           
     (  "   \         R  4       pV P                  \        4      ;_uu_ 4        V! 4       ;_uu_4       GRj  xL
  ^^ ,           RRR4      GRj  xL
  RRR4       V P                  \        4      ;_uu_ 4        V! 4       ;_uu_4       GRj  xL
  \        h La LJ  + GRj  xL 
 '       g   i     La; i  + '       g   i     Ll; i L=  + GRj  xL 
 '       g   i     M; i RRR4       R#   + '       g   i     R# ; i5i)c                 ^   "    R 5x  R #   \          d   p \        RT  24      T hR p ? ii ; i5i)Nzcaught )r   r   excs    r   r   QAsyncContextManagerTestCase.test_contextmanager_wrap_runtimeerror.<locals>.woohoo,  s/     = ="WSE?3<=s   - -*%*-N)r   rC   r   r   )r$   r   s   & r   %test_contextmanager_wrap_runtimeerrorAAsyncContextManagerTestCase.test_contextmanager_wrap_runtimeerror*  s     		= 
	= |,,xxxA  x - 122xxx((  xxx -,  xxxx 3222s   *DC B"C
B&	CB$C%DC>CC>C	"C$C&B?,B/-
B?8B?:CC	DC>C0C 
C0)C0+C>4
D>D			Dc                <    R  p\         V! RR7      R 4       4       pV# )c                     a  V 3R  lpV# )c                 R   < SP                  4        F  w  r\        WV4       K  	  V # r   )itemssetattr)funckvkws   &  r   decorate]AsyncContextManagerTestCase._create_contextmanager_attribs.<locals>.attribs.<locals>.decorate@  s$    88:CAD1% &r   r)   )r   r   s   l r   attribsKAsyncContextManagerTestCase._create_contextmanager_attribs.<locals>.attribs?  s     Or   barr   c                  "   R5x  R# 5iWhee!Nr)   )r   s   &r   bazGAsyncContextManagerTestCase._create_contextmanager_attribs.<locals>.bazE  s
      rM   )r   )r$   r   r  s   &  r   _create_contextmanager_attribs:AsyncContextManagerTestCase._create_contextmanager_attribs>  s/    	 
	U		 
 
	 
r   c                    V P                  4       pV P                  VP                  R 4       V P                  VP                  R4       R# )r  r   N)r  rQ   r+   r   r$   r  s   & r   test_contextmanager_attribs7AsyncContextManagerTestCase.test_contextmanager_attribsL  s8    113e,%(r   c                ^    V P                  4       pV P                  VP                  R 4       R# r  r  rQ   __doc__r  s   & r   test_contextmanager_doc_attrib:AsyncContextManagerTestCase.test_contextmanager_doc_attribQ  s$    113g.r   c                   "   V P                  4       ! R 4      pV P                  VP                  R4       T;_uu_4       GR j  xL
   R R R 4      GR j  xL
  R #  L L  + GR j  xL 
 '       g   i     R # ; i5i)Nr  r  r  s   & r   *test_instance_docstring_given_cm_docstringFAsyncContextManagerTestCase.test_instance_docstring_given_cm_docstringV  sG      113D9g.33 33333sN   AA<AA<A	A<AA<A<A9	%A(&
A9	1A9	3	A<c                   "   \         R  4       pV! ^^^!^,R7      ;_uu_4       GRj  xL
 pV P                  VR4       RRR4      GRj  xL
  R#  L( L  + GRj  xL 
 '       g   i     R# ; i5i)c                   "   WW#35x  R # 5ir   r)   r$   r   r   kwdss   &&&&r   r   9AsyncContextManagerTestCase.test_keywords.<locals>.woohooa  s     t**s   
r  N)      !   ,   r   rQ   )r$   r   targets   &  r   test_keywords)AsyncContextManagerTestCase.test_keywords^  sT      
	+ 
	+r"===V%56 >=====sI   %A1AA1AA1	A
A1A1A.	A
A.	&A.	(	A1c                   a aaa"   ^ o^ o\         VVV 3R l4       pV! 4       VV3R l4       oS! 4       G Rj  xL
  S P                  S^
4       S P                  S^ 4       R#  L*5i)r   c                 x   <"   S^,          oSp S^,          oR5x  S^,          oSP                  SV 4       R# 5ir   N)rQ   )beforedepthncolsr$   s    r   r   :AsyncContextManagerTestCase.test_recursive.<locals>.woohool  s=      QJE FQJEQJEUF+s   7:c                  D   <"   S ^
8  d   S! 4       G Rj  xL
  R# R#  L5i)
   Nr)   )r$  	recursives   r   r)  =AsyncContextManagerTestCase.test_recursive.<locals>.recursivex  s      rzk!! !s    	 Nr  )r$   r   r$  r%  r)  s   f @@@r   test_recursive*AsyncContextManagerTestCase.test_recursiveg  sj     			, 
		, 
	" 
	" k#" 	s   1A$A"+A$c                   a a"   R o\         V3R l4       pV! 4       VV 3R l4       pS P                  S4       V! 4       G Rj  xL
  S P                  S4       R#  L5i)Fc                 "   <"   R o R5x  Ro R# 5iTNFr)   entereds   r   r9   ;AsyncContextManagerTestCase.test_decorator.<locals>.context  s      GGs   c                  2   <"   SP                  S 4       R # 5ir   )
assertTruer1  r$   s   r   test8AsyncContextManagerTestCase.test_decorator.<locals>.test  s     OOG$   N)r   r   r$   r9   r6  r1  s   f  @r   test_decorator*AsyncContextManagerTestCase.test_decorator  s_     		 
	 
	% 
	% 	!f! 	s   >AAAc                0  a a"   R o\         V3R l4       pV! 4       VV 3R l4       pS P                  S4       S P                  \        R4      ;_uu_ 4        V! 4       G Rj  xL
  RRR4       S P                  S4       R#  L  + '       g   i     L%; i5i)Fc                 2   <"    R o R5x  Ro R#   Ro i ; i5ir/  r)   r0  s   r   r9   JAsyncContextManagerTestCase.test_decorator_with_exception.<locals>.context  s      %s    c                  D   <"   SP                  S 4       \        R 4      h5ir   )r4  	NameErrorr5  s   r   r6  GAsyncContextManagerTestCase.test_decorator_with_exception.<locals>.test  s     OOG$E""s    r   N)r   r   assertRaisesRegexr@  r9  s   f  @r   test_decorator_with_exception9AsyncContextManagerTestCase.test_decorator_with_exception  s     		  
	  
	# 
	# 	!##Iu55&LL 6!  65s0   ABB!B"B&BBB	Bc                  a"   \         R  4       o ! V3R lR\        4      pV! 4       pVP                  ^^4      G Rj  xL
  V P                  VP                  ^4       V P                  VP
                  ^4       V P                  VP                  R4       V! 4       pVP                  RRR4      G Rj  xL
  V P                  VP                  R4       V P                  VP
                  R4       V P                  VP                  R4       V! 4       pVP                  ^^R7      G Rj  xL
  V P                  VP                  ^4       V P                  VP
                  ^4       R#  EL+ L LC5i)c                    "   R 5x  R # 5ir   r)   r)   r   r   r9   CAsyncContextManagerTestCase.test_decorating_method.<locals>.context  rL   rM   c                   B   <a  ] tR tRt o  Z! 4       RR l4       tRtV tR# )@AsyncContextManagerTestCase.test_decorating_method.<locals>.Testi  Nc                2   "   Wn         W n        W0n        R # 5ir   abc)r$   rL  rM  rN  s   &&&&r   methodGAsyncContextManagerTestCase.test_decorating_method.<locals>.Test.method  s     s   rK  r   )r+   r,   r-   r.   rO  r/   r0   )r3   r9   s   @r   TestrI    s     Y r   rQ  NrL  rM  rN  )rL  rM  )r   objectrO  rQ   rL  rM  rN  )r$   rQ  r6  r9   s   &  @r   test_decorating_method2AsyncContextManagerTestCase.test_decorating_method  s,     
	 
		6 	 vkk!Q##&vkk#sC(((%%%vkkAk##### 	  	) 	$s5   ;E0E)A5E04E,5A5E0*E.+?E0,E0.E0r)   N)r+   r,   r-   r.   r   r   r   r   r   r   r   r   r   r   r   r   r  r	  r	   requires_docstringsr  r  r  r+  r:  rC  rS  r/   r0   rm   s   @r   r~   r~   c   s    . . . ." 5C 5Cn Q Q 3 3 # # 3 3 : : . ." < <4 ) )&)
   / !/     ! 7 7 # #4 " "$ " ", $ $r   r~   c                   t   a  ] tR tRt o ]P
                  R 4       t]R 4       t]R 4       t	]R 4       t
RtV tR# )AclosingTestCasei  c                t    \         P                  p\        R 4      pV P                  VP                  V4       R # r   )r   r  rQ   )r$   cm_docstringobjs   &  r   test_instance_docs#AclosingTestCase.test_instance_docs  s*    ''tnl3r   c                @  a"   . o ! V3R  lR4      pV! 4       pV P                  S. 4       \        V4      ;_uu_4       GRj  xL
 pV P                  W#4       RRR4      GRj  xL
  V P                  S^.4       R#  L: L  + GRj  xL 
 '       g   i     L2; i5i)c                   .   <a  ] tR tRt o V3R ltRtV tR# ))AclosingTestCase.test_aclosing.<locals>.Ci  c                2   <"   SP                  ^4       R# 5ir"  r   r$   r   s   &r   rR   0AclosingTestCase.test_aclosing.<locals>.C.aclose       Qr8  r)   Nr+   r,   r-   r.   rR   r/   r0   r3   r   s   @r   Cr_            r   rf  N)rQ   r   r$   rf  r   yr   s   &   @r   test_aclosingAclosingTestCase.test_aclosing  sm     	  	  C#A;;;!Q" ;$ ;;;sN   A BA>BBB$B %B BB	B	
B	B	Bc           
       a"   . o ! V3R  lR4      pV! 4       pV P                  S. 4       V P                  \        4      ;_uu_ 4        \        V4      ;_uu_4       GRj  xL
 pV P                  W#4       ^^ ,           RRR4      GRj  xL
  RRR4       V P                  S^.4       R#  LK L#  + GRj  xL 
 '       g   i     L:; i  + '       g   i     LE; i5i)c                   .   <a  ] tR tRt o V3R ltRtV tR# )/AclosingTestCase.test_aclosing_error.<locals>.Ci  c                2   <"   SP                  ^4       R# 5ir"  r   ra  s   &r   rR   6AclosingTestCase.test_aclosing_error.<locals>.C.aclose  rc  r8  r)   Nrd  re  s   @r   rf  rn    rg  r   rf  N)rQ   rC   r   r   rh  s   &   @r   test_aclosing_error$AclosingTestCase.test_aclosing_error  s     	  	  C#011{{{a  &A #{ 2 	$ #{{{ 21sl   AC 	C!B-"C%B1	 CB/CC -C/C1C
7B:8
C
C
CC	C c           
     *  aa"   . o\         V3R  l4       oV3R lpV! 4       pV P                  S. 4       V P                  \        4      ;_uu_ 4        \	        V4      ;_uu_4       GRj  xL
 pV P                  W#4       T P                  RVP                  4       G Rj  xL
 4       ^^ ,           RRR4      GRj  xL
  RRR4       V P                  S^.4       R#  Ls L@ L%  + GRj  xL 
 '       g   i     L<; i  + '       g   i     LG; i5i)c               3   h   <"    R x  S P                  ^4       R #   S P                  ^4       i ; i5ir   r   r   s   r   sync_resource>AclosingTestCase.test_aclosing_bpo41229.<locals>.sync_resource  s$      QQs   2 2/2c                 |   <"   S ! 4       ;_uu_ 4        R5x  R5x  RRR4       R#   + '       g   i     R# ; i5i)r   Nr)   )ru  s   r   agenfunc9AclosingTestCase.test_aclosing_bpo41229.<locals>.agenfunc  s"      !s   <(
<9		<Nrx  )r   rQ   rC   r   r   	__anext__)r$   rz  r   ri  r   ru  s   &   @@r   test_aclosing_bpo41229'AclosingTestCase.test_aclosing_bpo41229  s     		  
	 	
 J#011{{{a  &  1;;=%89A #{ 2
 	$	 #%8 #{{{ 21s~   ADD *C+D .1C$	C  C$	1D <C"=D DD  C$	"D $C=*C-+
C=6C=8D  D	Dr)   N)r+   r,   r-   r.   r	   rU  r[  r   rj  rq  r}  r/   r0   rm   s   @r   rW  rW    sY       4 !4
 	% 	% % % % %r   rW  c                      a  ] tR tRt o  ! R R]4      t]t. ROt]R 4       t	]R 4       t
]R 4       t]R 4       t]R 4       t]R	 4       t]R
 4       tRtV tR# )TestAsyncExitStacki  c                   2   a  ] tR tRt o R tR tR tRtV tR# )%TestAsyncExitStack.SyncAsyncExitStacki  c                ,    \        V P                  4      # r   )r   rR   rd   s   &r   close+TestAsyncExitStack.SyncAsyncExitStack.close  s     --r   c                ,    \        V P                  4      # r   )r   r7   rd   s   &r   	__enter__/TestAsyncExitStack.SyncAsyncExitStack.__enter__  s     11r   c                0    \        V P                  .VO5!  # r   )r   r"   r$   exc_detailss   &*r   __exit__.TestAsyncExitStack.SyncAsyncExitStack.__exit__  s     >+>>r   r)   N)	r+   r,   r-   r.   r  r  r  r/   r0   rm   s   @r   SyncAsyncExitStackr    s     	.	2	? 	?r   r  c           
     &  a"   R/ 3R/ 3R/ 3R\        ^R7      3R\        ^R7      3R\        ^R7      3.p. oV3R lp\        4       ;_uu_4       GRj  xL
 p\        V4       F  w  rEV'       d    V'       d   VP                  ! V.VO5/ VB pMJV'       d   VP                  ! V.VO5!  pM-V'       d   VP                  ! V3/ VB pMVP                  V4      pV P	                  Wb4       K  	  VP
                   F  pV P	                  V^,          P                  V4       V P                  V^,          P                  VP                  4       V P                  V^,          P                  VP                  4       K  	  RRR4      GRj  xL
  V P                  SV4       . o\        4       ;_uu_4       GRj  xL
 pV P                  \        4      ;_uu_ 4        VP                  ^R7       RRR4       V P                  \        4      ;_uu_ 4        V P                  P                  ^R7       RRR4       V P                  \        4      ;_uu_ 4        VP                  V^R7       RRR4       RRR4      GRj  xL
  V P                  S. 4       R#  ELA EL  + GRj  xL 
 '       g   i     EL&; i L  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i Lv  + GRj  xL 
 '       g   i     L; i5i)	r   )examplec                 4   <"   SP                  W34       R# 5i)zTest metadata propagationNr   )r   r  results   *,r   _exit5TestAsyncExitStack.test_async_callback.<locals>._exit*  s     MM4,'   N)arg)callbackr  r)   )r   )r      )dictr   reversedpush_async_callbackr6   _exit_callbacks__wrapped__assertNotEqualr+   assertIsNoner  rQ   rC   r]   
exit_stack)	r$   expectedr  stackr   r  r   r   r  s	   &       @r   test_async_callback&TestAsyncExitStack.test_async_callback  s?     H2JBKa!4?#DO$
 	( "###u&x0
D11%G$G$GA11%?$?A11%@4@A11%8Aa' 1 !00gaj44e<##GAJ$7$7H!!'!*"4"4emmD 1 $#  	*!###u""9--))a)0 .""9--333: .""9--))5a)@ . $# 	$5 $###& $------ $###s   ALJL J9JJ5C
J?L
J.L9J8:L=K5J:	.%K5K	0%K5K 	)K51L<K3=LLJ5	!J$"
J5	-J5	/
L:K
K5KK5 K0+K53L5L	;K><
L	L		Lc                   a a"   \         oVV 3R  lpR pV 3R lp ! R R\        4      pS P                  4       ;_uu_4       GRj  xL
 pVP                  V4       S P	                  VP
                  R,          ^,          V4       V! V4      pVP                  V4       S P	                  VP
                  R,          ^,          P                  V4       VP                  V4       S P	                  VP
                  R,          ^,          V4       V! V4      pVP                  V4       S P	                  VP
                  R,          ^,          P                  V4       VP                  V4       S P	                  VP
                  R,          ^,          V4       VP                  V4       S P	                  VP
                  R,          ^,          V4       ^^ ,           RRR4      GRj  xL
  R#  EL L	  + GRj  xL 
 '       g   i     R# ; i5i)c                 4   <"   SP                  V S4       R # 5ir   )r6   )rh   r   exc_tb
exc_raisedr$   s   &&&r   _expect_exc7TestAsyncExitStack.test_async_push.<locals>._expect_excM  s     MM(J/r  c                     "   R # 5iTr)   )r  s   *r   _suppress_exc9TestAsyncExitStack.test_async_push.<locals>._suppress_excO  s     rf   c                 v   <"   SP                  V 4       SP                  V4       SP                  V4       R # 5ir   )r  )rh   r   r  r$   s   &&&r   
_expect_ok6TestAsyncExitStack.test_async_push.<locals>._expect_okQ  s0     h'c"f%s   69c                   2   a  ] tR tRt o R tR tR tRtV tR# )2TestAsyncExitStack.test_async_push.<locals>.ExitCMiU  c                    Wn         R # r   	check_exc)r$   r  s   &&r   __init__;TestAsyncExitStack.test_async_push.<locals>.ExitCM.__init__V  s    !*r   c                0   "   V P                  R 4       R# 5i)zShould not be called!N)r   rd   s   &r   r7   =TestAsyncExitStack.test_async_push.<locals>.ExitCM.__aenter__X  s     		12s   c                B   "   V P                   ! V!  G R j  xL
  R #  L5ir   r  r  s   &*r   r"   <TestAsyncExitStack.test_async_push.<locals>.ExitCM.__aexit__Z  s     nnk222s   r  N)	r+   r,   r-   r.   r  r7   r"   r/   r0   rm   s   @r   ExitCMr  U  s     +33 3r   r  Nrx  )r   rR  r  push_async_exitr6   r  __self__)r$   r  r  r  r  r  cmr  s   f      @r   test_async_push"TestAsyncExitStack.test_async_pushJ  s    &
	0		&	3V 	3 ??$$$!!*-MM%//3A6
C
#B!!"%MM%//3A6??D!!-0MM%//3A6F$B!!"%MM%//3A6??D!!+.MM%//3A6D!!+.MM%//3A6DaC %$$$$$$sO   AHG,H
FG1H%G/&H/H1H	7G:8
H	H		Hc                  a"    ! V3R  lR\         4      p. oV! 4       p\        4       ;_uu_4       GRj  xL
 pVP                  V3R l4       pV P                  V4       VP	                  V4      G Rj  xL
  V P                  VP                  R,          ^,          P                  V4       SP                  ^4       RRR4      GRj  xL
  V P                  S. RO4       R#  L Lq L  + GRj  xL 
 '       g   i     L5; i5i)c                   :   <a  ] tR tRt o V3R ltV3R ltRtV tR# );TestAsyncExitStack.test_enter_async_context.<locals>.TestCMip  c                2   <"   SP                  ^4       R# 5ir"  r   )r$   r  s   &r   r7   FTestAsyncExitStack.test_enter_async_context.<locals>.TestCM.__aenter__q       a r8  c                2   <"   SP                  ^4       R# 5i)   Nr   )r$   r  r  s   &*r   r"   ETestAsyncExitStack.test_enter_async_context.<locals>.TestCM.__aexit__s  r  r8  r)   Nrl   )r3   r  s   @r   TestCMr  p  s     !! !r   r  Nc                  2   <"   S P                  ^4       R# 5i)   Nr   )r  s   r   r  :TestAsyncExitStack.test_enter_async_context.<locals>._exitz  s     a r8  rx  )r   r  r  r  )
rR  r   r  assertIsNotNoneenter_async_contextr6   r  r  r   rQ   )r$   r  r  r  r  r  s   &    @r   test_enter_async_context+TestAsyncExitStack.test_enter_async_contextn  s     	!V 	! X!###u&&! '!  '++B///MM%//3A6??DMM! $# 	. $
 0 $###s]   2DC$D;C*4C&5A	C*>D	C(
D&C*(D*D	0C31
D	<D	>Dc           	     B  "    ! R  R4      p ! R R4      p ! R R4      pV P                  4       ;_uu_4       GRj  xL
 pV P                  \        R4      ;_uu_ 4        VP                  V! 4       4      G Rj  xL
  RRR4       V P                  \        R4      ;_uu_ 4        VP                  V! 4       4      G Rj  xL
  RRR4       V P                  \        R4      ;_uu_ 4        VP                  V! 4       4      G Rj  xL
  RRR4       V P	                  VP
                  4       RRR4      GRj  xL
  R#  EL L  + '       g   i     L; i L  + '       g   i     L; i Lf  + '       g   i     Ll; i LH  + GRj  xL 
 '       g   i     R# ; i5i)c                       ] tR tRtRtR# )MTestAsyncExitStack.test_enter_async_context_errors.<locals>.LacksEnterAndExiti  r)   NrZ   r)   r   r   LacksEnterAndExitr    r\   r   r  c                   &   a  ] tR tRt o R tRtV tR# )FTestAsyncExitStack.test_enter_async_context_errors.<locals>.LacksEnteri  c                   "   R # 5ir   r)   )r$   exc_infos   &*r   r"   PTestAsyncExitStack.test_enter_async_context_errors.<locals>.LacksEnter.__aexit__       rf   r)   N)r+   r,   r-   r.   r"   r/   r0   rm   s   @r   
LacksEnterr          r   r  c                   &   a  ] tR tRt o R tRtV tR# )ETestAsyncExitStack.test_enter_async_context_errors.<locals>.LacksExiti  c                   "   R # 5ir   r)   rd   s   &r   r7   PTestAsyncExitStack.test_enter_async_context_errors.<locals>.LacksExit.__aenter__  r  rf   r)   N)r+   r,   r-   r.   r7   r/   r0   rm   s   @r   	LacksExitr    r  r   r  Nasynchronous context manager)r  rB  r]   r  r   r  )r$   r  r  r  r  s   &    r   test_enter_async_context_errors2TestAsyncExitStack.test_enter_async_context_errors  s!    	 		 		 	 ??$$$''	3QRR//0A0CDDD S''	3QRR//
=== S''	3QRR//	<<< SU223 %$$D SR > SR = SR %$$$s   ;FD>FF E	:E;E	?&F%E	?E E	&F*E-	E+E-		#F,F7F 8FE	EFE	E(#F+E-	-E=8F FF	F	
F	F		Fc                p  a"   R  pRoV3R lp V P                  4       ;_uu_4       GRj  xL
 pVP                  V\        4       VP                  V\        4       VP                  V\        4       VP                  V4       VP                  V\        4       ^^ ,           RRR4      GRj  xL
  V P                  R4       S^,          pV P                  V\        4       V P                  VP                  \        4       R#  L LX  + GRj  xL 
 '       g   i     Lo; i  \         d   pT P                  TP                  \        4       T P                  TP                  P                  \        4       T P                  TP                  P                  P                  4        Rp?LRp?ii ; i5i)c                    "   V h5ir   r)   r   s   &r   	raise_excHTestAsyncExitStack.test_async_exit_exception_chaining.<locals>.raise_exc  s
     Irf   Nc                     <"   V oR # 5ir  r)   )r  saved_detailss   *r   suppress_excKTestAsyncExitStack.test_async_exit_exception_chaining.<locals>.suppress_exc  s     'Ms   0Expected IndexError, but no exception was raised)r  r  
IndexErrorKeyErrorrD   r  
ValueErrorr   assertIsInstance__context__r  r   )r$   r  r  r  r   	inner_excr  s   &     @r   "test_async_exit_exception_chaining5TestAsyncExitStack.test_async_exit_exception_chaining  s<    	 	
	J(((E)))Z@)))X>)))^D%%l3)))Z@A )( IIHI!!$	i4i335FG# )(((  	G!!#//8<!!#//"="=~Ncoo99EEFF		Gs|   F6D% DD% A3D	#D% .D/D% 3AF6D% D% 	D"	D
D"	D"	D% %F30A9F.)F6.F33F6c                  a aa"    ! R  R\         4      o\        V3R l4       o\        VV 3R l4       pSV3 F=  pS P                  4       ;_uu_ 4         V! 4       ;_uu_4       GRj  xL
  \        4       h	  R#  L  + GRj  xL 
 '       g   i     M; i S P	                  R4       M/  S d&   pS P                  TP                  4        Rp?MRp?ii ; iRRR4       K    + '       g   i     K  ; i5i)c                       ] tR tRtRtR# )WTestAsyncExitStack.test_async_exit_exception_explicit_none_context.<locals>.MyExceptioni  r)   NrZ   r)   r   r   MyExceptionr    r\   r   r  c                 f   <"    R 5x  R #   \          d    S! 4       p  T h  R T n        i ; ii ; i5ir   )BaseExceptionr  )r   r  s    r   my_cmQTestAsyncExitStack.test_async_exit_exception_explicit_none_context.<locals>.my_cm  s6     +  +!m+I&*CO+s    1 1.!	*.1c                    <"   SP                  4       ;_uu_4       GR j  xL
 p V P                  S! 4       4      G R j  xL
  V 5x  R R R 4      GR j  xL
  R #  L9 L L
  + GR j  xL 
 '       g   i     R # ; i5ir   )r  r  )r  r  r$   s    r   my_cm_with_exit_stackaTestAsyncExitStack.test_async_exit_exception_explicit_none_context.<locals>.my_cm_with_exit_stack  sO     (((E//888 )((8 )(((sZ   A=AA=A A	A A=AA=A A= A:	&A)'
A:	2A:	4	A=Nr  )r   r   r   r  r   r  r  )r$   r  r  r   r  r  s   f   @@r   /test_async_exit_exception_explicit_none_contextBTestAsyncExitStack.test_async_exit_exception_explicit_none_context  s     
	) 	 
	+ 
	+ 
	 
	
 /0BR!ttt(l*	 1  $tttt
 IIPQ # 7%%coo667	  s   AC9C%B,(A;)B,,A=7C9;B,=BB
BBB,C%,C	3C	C%C	C%
C9%C60	C9c                  "    ! R  R\         4      pV! 4       p\        4       Vn        \        4       Vn        V P                  4       pV P	                  \
        R4      ;_uu_ 4        VP                  V4      G Rj  xL
  RRR4       VP                  V4       V P                  VP                  R,          ^,          V4       R#  LI  + '       g   i     LO; i5i)c                       ] tR tRtRtR# )>TestAsyncExitStack.test_instance_bypass_async.<locals>.Examplei  r)   NrZ   r)   r   r   Exampler    s    tr   r	  r  Nrx  )
rR  r7   r"   r  rB  r]   r  r  r6   r  )r$   r	  r  r  s   &   r   test_instance_bypass_async-TestAsyncExitStack.test_instance_bypass_async  s     #f#Yx!##I/MNN++B/// Ob!e++B/2B7 0 ONs1   A#C%C:C;C?ACCC	Cr)   N))r  z2return _run_async_fn(self.__aexit__, *exc_details))r
   zcoro.send(None))r"   z	raise exc)r"   zcb_suppress = cb(*exc_details))r+   r,   r-   r.   r   r  r  callback_error_internal_framesr   r  r  r  r  r  r  r
  r/   r0   rm   s   @r   r  r    s     	?^ 	? $J&" (% (%T ! !F / /* 4 4& H H>  R  RD 	8 	8r   r  c                   0   a  ] tR tRt o ]R 4       tRtV tR# )TestAsyncNullcontexti  c                   "    ! R  R4      pV! 4       p\        V4      ;_uu_4       GRj  xL
 pV P                  W24       RRR4      GRj  xL
  R#  L' L  + GRj  xL 
 '       g   i     R# ; i5i)c                       ] tR tRtRtR# )6TestAsyncNullcontext.test_async_nullcontext.<locals>.Ci  r)   NrZ   r)   r   r   rf  r    r\   r   rf  N)r   r6   )r$   rf  rN  c_ins   &   r   test_async_nullcontext+TestAsyncNullcontext.test_async_nullcontext  s>     	 	Cq>>>TMM$" ">>>>>sJ   )A4AA4AA4AA4A4A1	A 
A1	)A1	+	A4r)   N)r+   r,   r-   r.   r   r  r/   r0   rm   s   @r   r  r    s     # #r   r  __main__)r   
contextlibr   r   r   r   r   r   r6  r	   test.supportr
   r   unittestrj   test.test_contextlibr   r   TestCaser   r~   rW  r  r  r+   mainr)   r   r   <module>r     s    ; ;  ?   2JIh&7&7 JIZi$("3"3 i$X9%x(( 9%xZ8*H,=,= Z8z#8,, # zMMO r   