+
    Pj4                       a  R tz0 t R t^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIH	t	 ^ RI
Ht ^ RIHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHt ^ RIt^ RI t ^ RI H!t!H"t"H#t#H$t$H%t%H&t&H't'H(t(H)t)H*t*H+t+H,t,H-t-H.t.H/t/H0t0H1t1 ]R,          t2]! R
4      t3]! R]R]]4,          3,          R7      t5]! R]R]]4,          3,          R7      t6]]5]63,          t7]]7.]73,          t8 ! R R]94      t: ! R R]:4      t; ! R R]<]Pz                  4      t>Rt?R R lt@]RRRRRRRRRRRR/R R ll4       tA]RRRRRRRRRRRRR/R  R! lll4       tARR" R# lltAR$ R% ltBR& R' ltCR( R) ltDR* R+ ltER,tFR- R. ltG] P                  ! R/R07      R1 R2 l4       tIR3 R4 ltJR5 R6 ltKR7 R8 ltLR9 R: ltMR; R< ltNR= R> ltOR? R@ ltP ! RA RB]&4      tQ ! RC RD]Q4      tR ! RE RF]Q4      tS ! RG RH]Q4      tT ! RI RJ]Q4      tU]V! 4       tW] ^ k ] P                  ! RKR/RL7      RM RN l4       tX] P                  ! RKR/RO7      RP RQ l4       tY]1]<,          ! 4       tZ]!R	]+R]*R]0R/t[] ^k . t\] ^k ] P                  RR RS l4       t]]P                  RT RU l4       t_]! RV4      t`] P                  ! R/R07      RW RX l4       ta] P                  ! R/RY7      RZ R[ l4       tbR\ R] ltc]! R^4      tdR_ R` lteRa Rb ltfRc Rd ltgRRe Rf llth] P                  ! R/R/Rg7      Rh Ri l4       tiRj Rk ltj]! Rl4      tkRm Rn ltlRotmRptnRq Rr ltoRs Rt ltp] P                  Ru Rv l4       tq] P                  ! RRw7      Rx Ry l4       tr] P                  ! RR/Rz7      R{ R| l4       tsR} R~ lttR R ltu] P                  R R l4       tv] P                  R R l4       tw] P                  ! RRw7      R R l4       tx] P                  ! RRw7      R R l4       tyR# )zpytest-asyncio implementation.NAbstractEventLoopPolicy)dedent)AnyAsyncIterator	AwaitableCallableDict	GeneratorIterableIteratorListLiteralMappingOptionalSequenceSetTypeTypeVarUnionoverload)Class	CollectorConfig
FixtureDefFixtureRequestFunctionItemMarkMetafuncModulePackageParserPytestCollectionWarningPytestDeprecationWarningPytestPluginManagerSessionStashKeysessionpackagemoduleclass_TSimpleFixtureFunction.)boundFactoryFixtureFunctionc                       ] tR t^DtRtRtR# )PytestAsyncioErrorz2Base class for exceptions raised by pytest-asyncio N__name__
__module____qualname____firstlineno____doc____static_attributes__r2       n/Users/ahmed/devFolder/Ultron/claude-voice/gateway/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.pyr1   r1   D   s    <r:   r1   c                       ] tR t^HtRtRtR# ) MultipleEventLoopsRequestedErrorz9Raised when a test requests multiple asyncio event loops.r2   Nr3   r2   r:   r;   r=   r=   H   s    Cr:   r=   c                       ] tR t^LtRtRtRtR# )Modeautostrictr2   N)r4   r5   r6   r7   AUTOSTRICTr9   r2   r:   r;   r?   r?   L   s    DFr:   r?   z'auto' - for automatically handling all async functions by the plugin
'strict' - for autoprocessing disabling (useful if different async frameworks should be tested together, e.g. both pytest-asyncio and pytest-trio are used in the same project)
c                4    V ^8  d   QhR\         R\        RR/# )   parserpluginmanagerreturnN)r"   r%   )formats   "r;   __annotate__rJ   Y   s"      V 4G D r:   c                     V P                  R 4      pVP                  RRRR\        R7       V P                  RRRR7       V P                  R	R
RRR7       R# )asyncioz--asyncio-modeasyncio_modeNMODE)destdefaultmetavarhelpz default value for --asyncio-moderA   )rR   rP   "asyncio_default_fixture_loop_scopestringzFdefault scope of the asyncio event loop used to execute async fixtures)typerR   rP   )getgroup	addoptionASYNCIO_MODE_HELPaddini)rF   rG   groups   && r;   pytest_addoptionr[   Y   sk    OOI&E	OO   MM/  
 MM,U	  r:   scope
loop_scopeparamsautouseidsnamec                x   V ^8  d   QhR\         RRR\        \        R3,          R\        \        \
        ,          ,          R\        R\        \        \        \        \        \        \        R3,          ,          \        \        .\        \
        ,          3,          R3,          R	\        \        ,          R
\         /# )rE   fixture_functionr\   6Union[_ScopeName, Callable[[str, Config], _ScopeName]]r]   Nr^   r_   r`   ra   rH   )FixtureFunctionr   
_ScopeNamer   r   objectboolstrfloatintr   r   )rI   s   "r;   rJ   rJ   p   s      % D j$&'	
 Xf%&  
sE3d234#(()	
 3- r:   c                    R # Nr2   rc   r\   r]   r^   r_   r`   ra   s   &$$$$$$r;   fixturero   o   s     r:   c                p   V ^8  d   QhRRRRR\         \        R3,          R\        \        \        ,          ,          R\
        R\         \        \         \        \        \        \
        R3,          ,          \        \        .\        \        ,          3,          R3,          R	\        \        ,          R
\        /# )rE   rc   Nr\   rd   r]   r^   r_   r`   ra   rH   )r   rf   r   r   rg   rh   ri   rj   rk   r   r   FixtureFunctionMarker)rI   s   "r;   rJ   rJ      s          D  j$&'	 
 Xf%&    
sE3d234#(()	
  3-   r:   c                    R # rm   r2   rn   s   &$$$$$$r;   ro   ro      s      r:   c          
          V ^8  d   QhR\         \        ,          R\        \        R3,          R\        R\        \        \
        3,          /# )rE   rc   r]   NkwargsrH   )r   re   r   rf   r   rq   )rI   s   "r;   rJ   rJ      sJ      /j$&'  ?112	r:   c                    aa V e$   \        V S4       \        P                  ! V 3/ SB # \        P                  ! \        4      R VV3R ll4       pV# )Nc                0    V ^8  d   QhR\         R\         /# )rE   rc   rH   )re   )rI   s   "r;   rJ   fixture.<locals>.__annotate__   s     	N 	NO 	N 	Nr:   c                     < \        V 3R S/SB # )r]   )ro   )rc   rt   r]   s   &r;   innerfixture.<locals>.inner   s    +M
MfMMr:   )_make_asyncio_fixture_functionpytestro   	functoolswraps)rc   r]   rt   ry   s   &fl r;   ro   ro      sW    
 #&'7D~~.9&99 
	!	N 	N 
"	N r:   c                0    V ^8  d   QhR\         R\        /# rE   objrH   r   rh   )rI   s   "r;   rJ   rJ      s     9 9c 9d 9r:   c                 6    \        V R V 4      p \        V RR4      # )__func___force_asyncio_fixtureF)getattrr   s   &r;   _is_asyncio_fixture_functionr      s     
#z3
'C30%88r:   c                N    V ^8  d   QhR\         R\        \        R3,          RR/# )rE   r   r]   NrH   )r   r   rf   )rI   s   "r;   rJ   rJ      s.     ! !	!
D 01!	!r:   c                 \    \        V R 4      '       d   V P                  p RV n        Wn        R# )r   TN)hasattrr   r   _loop_scope)r   r]   s   &&r;   r{   r{      s'     sJll!%C Or:   c                0    V ^8  d   QhR\         R\        /# r   r   )rI   s   "r;   rJ   rJ      s     O O3 O4 Or:   c                 j    \         P                  ! V 4      ;'       g    \        P                  ! V 4      # rm   )rL   iscoroutinefunctioninspectisasyncgenfunctionr   s   &r;   _is_coroutine_or_asyncgenr      s&    &&s+NNw/I/I#/NNr:   c                0    V ^8  d   QhR\         R\        /# rE   configrH   )r   r?   )rI   s   "r;   rJ   rJ      s     

 

f 

 

r:   c                     V P                  R 4      pVf   V P                  R 4      p \        V4      #   \         d;    RP	                  R \         4       4      p\
        P                  ! T: RT R24      hi ; i)rM   z, c              3   8   "   T F  qP                   x  K  	  R # 5irm   )value).0ms   & r;   	<genexpr>$_get_asyncio_mode.<locals>.<genexpr>   s     04a''4s   z+ is not a valid asyncio_mode. Valid modes: .)	getoptiongetinir?   
ValueErrorjoinr|   
UsageError)r   valmodess   &  r;   _get_asyncio_moder      s{    


>
*C
{mmN+
Cy 
		0400g@qI
 	

s
   
3 AA8a  The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"
c                (    V ^8  d   QhR\         RR/# )rE   r   rH   N)r   )rI   s   "r;   rJ   rJ      s     	 	V 	 	r:   c                     V P                  R 4      pV'       g$   \        P                  ! \        \        4      4       V P                  RR4       R# )rS   markerszQasyncio: mark the test as a coroutine, it will be run using an asyncio event loopN)r   warningswarnr$   !_DEFAULT_FIXTURE_LOOP_SCOPE_UNSETaddinivalue_line)r   default_loop_scopes   & r;   pytest_configurer      s>    'KL./PQR
	*r:   T)tryfirstc                F    V ^8  d   QhR\         R\        \        ,          /# r   )r   r   ri   )rI   s   "r;   rJ   rJ      s"     N N NDI Nr:   c                L    \        V 4      pV P                  R4      pRV RV 2.# )z$Add asyncio config to pytest header.rS   zasyncio: mode=z, default_loop_scope=)r   r   )r   moder   s   &  r;   pytest_report_headerr      s7     V$D'KLTF"78J7KLMMr:   c                J    V ^8  d   QhR\         R\        \        ,          RR/# )rE   	collectorprocessed_fixturedefsrH   N)r   r   r   )rI   s   "r;   rJ   rJ      s*     *2 *2*2z?*2 
*2r:   c                    V P                   pVP                  R 4      p\        V4      pVP                  P	                  R4      pVf   Q hVP
                  P                  4        EFy  pV EFn  pVP                  pWq9   g   \        V4      '       g   K)  \        V4      '       g   V\        P                  8X  d   KQ  \        VRR4      ;'       g    T;'       g    VP                  p	V	R8X  d+   RVP                  9  d   V;P                  R,          un        \        W4       \         P"                  ! V4      p
RV
P$                  9   d-   \&        P(                  ! \+        VP,                   R24      4       RVP                  9  d   V;P                  R	,          un        \/        V4       \        VP                  4      '       g   Q hVP1                  V4       EKq  	  EK|  	  R# )
rS   
funcmanageNr   function
event_loop is asynchronous and explicitly requests the "event_loop" fixture. Asynchronous fixtures and test functions should use "asyncio.get_running_loop()" instead.request)r   )r   )r   r   r   rG   
get_plugin_arg2fixturedefsvaluesfuncr   r   r?   rC   r   r\   argnamesr{   r   	signature
parametersr   r   r$   r4   _synchronize_async_fixtureadd)r   r   r   r   rM   fixturemanagerfixtures
fixturedefr   r\   function_signatures   &&         r;   _preprocess_async_fixturesr      s    F'KL$V,L))44\BN%%%"33::<"J??D2:S; ; /55,$++:U mT2 $ $%$ $## 
 
"|:;N;N'N##6#*47!(!2!24!81<<<,==/ *# $ 
 3 33##|3#&z2/
@@@@!%%j1A # =r:   c                (    V ^8  d   QhR\         RR/# rE   r   rH   Nr   )rI   s   "r;   rJ   rJ     s     ( (: ($ (r:   c                    \         P                  ! V P                  4      '       d   \        V 4       R# \         P                  ! V P                  4      '       d   \        V 4       R# R# )zK
Wraps the fixture function of an async fixture in a synchronous function.
N)r   r   r   _wrap_asyncgen_fixturer   _wrap_async_fixture)r   s   &r;   r   r     sC     !!*//22z*		$	$Z__	5	5J' 
6r:   c                    V ^8  d   QhR\         R\        3,          R\        \        \        3,          R\        P
                  R\        R\        \        \        3,          /# )rE   r   .rt   r   r   rH   )r   r   r	   ri   rL   AbstractEventLoopr   )rI   s   "r;   rJ   rJ     sY      
38
cN )) 	
 
#s(^r:   c                     \         P                  ! V 4      pVP                  4       pR VP                  9   d   W5R &   RVP                  9   d   W%R&   V# )r   r   )r   r   copyr   )r   rt   r   r   sigrets   &&&&  r;   _add_kwargsr     sK     

D
!C
++-CCNN" Is~~%&LJr:   c                R    V ^8  d   QhR\         R\        \        ,          R\         /# )rE   r   instancerH   )r,   r   r   )rI   s   "r;   rJ   rJ   '  s%      r Xc] r r:   c                     VeK   T R r2 V P                   \        V P                  4      r2Ve#   \	        W4      '       d   VP                  V4      p V #   \         d     L5i ; irm   )r   rU   __self__AttributeError
isinstance__get__)r   r   unboundclss   &&  r;   _perhaps_rebind_fixture_funcr   '  sb     T	==$t}}*=S
 ?z(88??8,DK  		s    A AAc                (    V ^8  d   QhR\         RR/# r   r   )rI   s   "r;   rJ   rJ   7  s     $0 $0z $0d $0r:   c                 p   a V P                   o\        P                  ! S4      R  V3R ll4       pWn         R# )c                0    V ^8  d   QhR\         R\        /# rE   r   rt   r   r   )rI   s   "r;   rJ   ,_wrap_asyncgen_fixture.<locals>.__annotate__;  s      > S r:   c           
      (  <aa \        S	V P                  4      p\        W4      pV P                  V4      oVP	                  VR 4       V! R/ \        W!SV 4      B oV3R lpR VV3R llpSP                  V! 4       4      pV P                  V4       V# )Nc                  D   <"   SP                  4       G R j  xL
 p V #  L5irm   )	__anext__)resgen_objs    r;   setupH_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper.<locals>.setupD  s!     ))++CJ ,s     c                    V ^8  d   QhRR/# rE   rH   Nr2   )rI   s   "r;   rJ   O_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper.<locals>.__annotate__H  s     	= 	=4 	=r:   c                 F   < R V3R llp SP                  V ! 4       4       R# )zYield again, to finalize.c                    V ^8  d   QhRR/# r   r2   )rI   s   "r;   rJ   b_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper.<locals>.finalizer.<locals>.__annotate__K  s     * *4 *r:   c                     <"    SP                  4       G R j  xL
  Rp V R,          p \        V 4      h L  \         d     R # i ; i5i)Nz$Async generator fixture didn't stop.zYield only once.)r   r   StopAsyncIteration)msgr   s    r;   async_finalizere_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper.<locals>.finalizer.<locals>.async_finalizerK  sP     *!++--- AC--C$S/) .) s1   A5 35 A5 A AAAN)run_until_complete)r   r   r   s    r;   	finalizerL_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper.<locals>.finalizerH  s     * * ))/*;<r:   r2   )r   r   ,_get_event_loop_fixture_id_for_async_fixturegetfixturevaluepopr   r   addfinalizer)
r   rt   r   event_loop_fixture_idr   r   resultr   r   ro   s
   &,     @@r;   _asyncgen_fixture_wrapper9_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper:  s    +GW5E5EF L!
 ,,-BC


($/HT:wGH		= 	= ..uw7Y'r:   Nr   r}   r~   )r   r  ro   s   & @r;   r   r   7  s/    ooG__W @ 0Or:   c                (    V ^8  d   QhR\         RR/# r   r   )rI   s   "r;   rJ   rJ   ^  s     - -J -4 -r:   c                 p   a V P                   o\        P                  ! S4      R  V3R ll4       pWn         R# )c                0    V ^8  d   QhR\         R\        /# r   r   )rI   s   "r;   rJ   )_wrap_async_fixture.<locals>.__annotate__b  s     6 6 6# 6r:   c                    <a aaa \        SS P                  4      o\        S S4      pS P                  V4      oSP	                  VR 4       VVVV 3R lpSP                  V! 4       4      # )Nc            
      L   <"   S! R/ \        SSSS4      B G R j  xL
 p V #  L5i)Nr2   )r   )r   r   r   rt   r   s    r;   r   B_wrap_async_fixture.<locals>._async_fixture_wrapper.<locals>.setupj  s,     N{4WMNNCJ Os   $"$)r   r   r   r   r   r   )r   rt   r  r   r   r   ro   s   fl  @@r;   _async_fixture_wrapper3_wrap_async_fixture.<locals>._async_fixture_wrappera  sf    +GW5E5EF LT!
 ,,-BC


($/	 	 ,,UW55r:   Nr  )r   r  ro   s   & @r;   r   r   ^  s.    ooG__W6 6 -Or:   c                <    V ^8  d   QhR\         R\        R\        /# )rE   r   r   rH   )r   r   ri   )rI   s   "r;   rJ   rJ   s  s$     ! !!#&!!r:   c                 &   V P                   P                  R 4      p\        VRR4      ;'       g    T;'       g    V P                  pVR8X  d   RpM6\	        V P
                  V4      pVP                  P                  \        R4      pV'       g   Q hV# )rS   r   Nr   r    )	r   r   r   r\   _retrieve_scope_root_pyfuncitemstashget_event_loop_fixture_id)r   r   r   r]   r  event_loop_nodes   &&    r;   r   r   s  s     !../STmT*QQ.@QQGMM  Z ,.w/B/BJO / 5 5 9 9"!

 !    r:   c                   x   a  ] tR tRt o Rt]V 3R lR l4       t]V 3R lR l4       t]V 3R lR l4       t	R	t
V tR
# )PytestAsyncioFunctioni  z<Base class for all test functions managed by pytest-asyncio.c                H   < V ^8  d   QhRS[ RS[S[R,          R3,          /# )rE   itemrH   r  N)r   r   r   )rI   __classdict__s   "r;   rJ   "PytestAsyncioFunction.__annotate__  s-      	t+,d2	3r:   c               j    V P                  4        F  pVP                  V4      '       g   K  Vu # 	  R# )z
Returns a subclass of PytestAsyncioFunction if there is a specialized subclass
for the specified function item.

Return None if no specialized subclass exists for the specified item.
N)__subclasses___can_substitute)r   r  subclasss   "" r;   item_subclass_for'PytestAsyncioFunction.item_subclass_for  s2     **,H''-- - r:   c                &   < V ^8  d   QhRS[ RS[ /# rE   r   rH   r   )rI   r  s   "r;   rJ   r    s     ! !h !h !r:   c          
        VP                  R4      '       g   Q hV P                  VP                  VP                  \	        VRR4      VP
                  VP                  VP                  VP                  R7      pVP                  Vn	        VP                  VP                  8X  g   Q h\        P                  ! VP
                  4      pRVP                  9   d(   VP                  \        VP                   R24      4       V# )zY
Instantiates this specific PytestAsyncioFunction type from the specified
Function item.
rL   callspecN)ra   r(  callobjfixtureinfokeywordsoriginalnamer   r   )get_closest_markerfrom_parentparentra   r   r   _fixtureinfor+  r,  own_markersr   r   r   r   r$   )r   r   subclass_instancesubclassed_function_signatures   ""  r;   _from_function$PytestAsyncioFunction._from_function  s     **95555OOOOXz48LL --&&!.. , 
 )1(<(<% ,,0D0DDDD(/(9(9:K:O:O(P%8CCC""((--. /V W ! r:   c                &   < V ^8  d   QhRS[ RS[/# rE   r  rH   r   rh   )rI   r  s   "r;   rJ   r    s     $ $h $4 $r:   c                    \        4       h)zDReturns whether the specified function can be replaced by this class)NotImplementedErrorr  s   &r;   r   %PytestAsyncioFunction._can_substitute  s     "##r:   r2   N)r4   r5   r6   r7   r8   classmethodr"  r4  staticmethodr   r9   __classdictcell__)r  s   @r;   r  r    sB     F  ! !8 $ $r:   r  c                   ^   a a ] tR tRt oRt]V3R lR l4       tV3R lV 3R lltRtVt	V ;t
# )	Coroutinei  z"Pytest item created by a coroutinec                &   < V ^8  d   QhRS[ RS[/# r7  r8  )rI   r  s   "r;   rJ   Coroutine.__annotate__  s     1 1h 14 1r:   c                F    V P                   p\        P                  ! V4      # rm   )r   rL   r   r  r   s   & r;   r   Coroutine._can_substitute  s    xx**400r:   c                   < V ^8  d   QhRR/# r   r2   )rI   r  s   "r;   rJ   rC           r:   c                X   < \        V P                  4      V n        \        SV `  4        R # rm   wrap_in_syncr   superruntestself	__class__s   &r;   rM  Coroutine.runtest  "    HH
 	r:   r   r4   r5   r6   r7   r8   r>  r   rM  r9   r?  __classcell__rP  r  s   @@r;   rA  rA    s)     ,1 1  r:   rA  c                   h   a a ] tR tRt oRt]V3R lR l4       t]V3R lV 3R ll4       tRt	Vt
V ;t# )AsyncGeneratori  z0Pytest item created by an asynchronous generatorc                &   < V ^8  d   QhRS[ RS[/# r7  r8  )rI   r  s   "r;   rJ   AsyncGenerator.__annotate__  s     0 0h 04 0r:   c                F    V P                   p\        P                  ! V4      # rm   )r   r   r   rE  s   & r;   r   AsyncGenerator._can_substitute  s    xx))$//r:   c                &   < V ^8  d   QhRS[ RS[ /# r%  r&  )rI   r  s   "r;   rJ   rY    s     
 
h 
h 
r:   c                  < \         SV `  V4      pR VP                   R2pVP                  \	        V4      4       VP                  \        P                  P                  RVR7      4       V# )z:Tests based on asynchronous generators are not supported. z will be ignored.F)runreason)	rL  r4  ra   r   r#   
add_markerr|   markxfail)r   r   async_gen_itemunsupported_item_type_messagerP  s   ""  r;   r4  AsyncGenerator._from_function  sp    /9H}}o.0 	& 	34QRS!!KK%0MN	
 r:   r2   )r4   r5   r6   r7   r8   r>  r   r=  r4  r9   r?  rT  rU  s   @@r;   rW  rW    s8     :0 0 
 
 
 
r:   rW  c                   ^   a a ] tR tRt oRt]V3R lR l4       tV3R lV 3R lltRtVt	V ;t
# )AsyncStaticMethodi  zZ
Pytest item that is a coroutine or an asynchronous generator
decorated with staticmethod
c                &   < V ^8  d   QhRS[ RS[/# r7  r8  )rI   r  s   "r;   rJ   AsyncStaticMethod.__annotate__  s     
 
h 
4 
r:   c                t    V P                   p\        V\        4      ;'       d    \        VP                  4      # rm   )r   r   r>  r   r   rE  s   & r;   r   !AsyncStaticMethod._can_substitute  s3    xx$- 
 
2KMM3
 	
r:   c                   < V ^8  d   QhRR/# r   r2   )rI   r  s   "r;   rJ   ri    rH  r:   c                X   < \        V P                  4      V n        \        SV `  4        R # rm   rJ  rN  s   &r;   rM  AsyncStaticMethod.runtest  rR  r:   r   rS  rU  s   @@r;   rg  rg    s-     
 
 
  r:   rg  c                   ^   a a ] tR tRt oRt]V3R lR l4       tV3R lV 3R lltRtVt	V ;t
# )AsyncHypothesisTesti  z\
Pytest item that is coroutine or an asynchronous generator decorated by
@hypothesis.given.
c                &   < V ^8  d   QhRS[ RS[/# r7  r8  )rI   r  s   "r;   rJ    AsyncHypothesisTest.__annotate__  s     
 
h 
4 
r:   c                    V P                   p\        VR R4      ;'       d@    \        VRR4      ;'       d+    \        P                  ! VP                  P
                  4      # )is_hypothesis_testF
hypothesisN)r   r   rL   r   ru  
inner_testrE  s   & r;   r   #AsyncHypothesisTest._can_substitute  sY    xxD.6 H HlD1H H++DOO,F,FG	
r:   c                   < V ^8  d   QhRR/# r   r2   )rI   r  s   "r;   rJ   rr    s       r:   c                   < \        V P                  P                  P                  4      V P                  P                  n        \        SV `  4        R # rm   )rK  r   ru  rv  rL  rM  rN  s   &r;   rM  AsyncHypothesisTest.runtest  s9    )5HH***
& 	r:   r2   rS  rU  s   @@r;   rp  rp    s-     
 
 
  r:   rp  pytest_pycollect_makeitem)specnamer   c                H   V ^8  d   QhR\         \        P                  \        P                  3,          R\        R\
        R\         \        P                  \        P                  \        \         \        P                  \        P                  3,          ,          R3,          /# rE   r   ra   r   rH   N)	r   r|   r    r   ri   rg   r   r   r   )rI   s   "r;   rJ   rJ     sr     	 	V]]FLL01	9<	CI	

KK!!4fkk6;K;K.K(L#MtS	r:   c                X    V P                  V4      '       g   R# \        V \        4       R# )z,A pytest hook to collect asyncio coroutines.N)funcnamefilterr   _HOLDER)r   ra   r   s   &&&r;   3pytest_pycollect_makeitem_preprocess_async_fixturesr    s%     ##D))y'2r:   )r|  hookwrapperc                    V ^8  d   QhR\         \        P                  \        P                  3,          R\        R\
        R\        R\        P                  R3,          /# r~  )	r   r|   r    r   ri   rg   r
   pluggyResult)rI   s   "r;   rJ   rJ   "  sN     &6 &6V]]FLL01&69<&6CI&6tV]]D()&6r:   c              #    "   Rx p VP                  4       pT'       g   R# \        T\        4      '       d   \        T4      pM\        T34      p. pT F  pTp	\        T\        4      '       d   \        P                  T4      p
T
'       dy   \        TP                  4      \        P                  8X  d)   TP                  R4      '       g   TP                  R4       TP                  R4      '       d   T
P                  T4      p	TP!                  T	4       K  	  TP#                  T4       R#   \         d   pTP                  T4        Rp?R# Rp?ii ; i5i)z`
Converts coroutines and async generators collected as pytest.Functions
to AsyncFunction items.
NrL   )
get_resultBaseExceptionforce_exceptionr   r   iterr   r  r"  r   r   r?   rB   r-  r`  r4  appendforce_result)r   ra   r   hook_resultnode_or_list_of_nodesenode_iteratorupdated_node_collectionnodeupdated_itemspecialized_item_classs   &&&        r;   =pytest_pycollect_makeitem_convert_async_functions_to_subclassr  !  s%     K	 ""$ 	 !'2223 356 dH%%%:%L%LT%R"%$KKYY'+'>'>y'I'IOOI.**955#9#H#H#NL&&|4  45/  ##A&sE   ED, EA+E>E'E39E,E7EEEEc                <    V ^8  d   QhR\         P                  RR/# )rE   r   rH   N)r|   r   )rI   s   "r;   rJ   rJ   [  s(     MM MM6#3#3 MM MMr:   c                 p  a a  \        V 3R  l\        P                  4        4       4      pTR8X  d&   \        P
                  pTS P                  \        &   R# S P                   R2pTS P                  \        &   \        P                  ! TTR7      R R l4       o\        S 4      \        J d   \        P                  S4       R# \        S \         4      '       d"   T T3R lpS P"                  S n        TS n        R# \        S \&        4      '       d   SS P(                  n        R# R#   \         d     R# i ; i)c              3   T   <"   T F  w  r\        SV4      '       g   K  Vx  K  	  R # 5irm   )r   )r   r   r\   r   s   &  r;   r   &pytest_collectstart.<locals>.<genexpr>]  s&      
F
)S) EFs   (
(Nr(   z::<event_loop>)r\   ra   c                N    V ^8  d   QhR\         \        P                  ,          /# rE   rH   )r   rL   r   )rI   s   "r;   rJ   )pytest_collectstart.<locals>.__annotate__{  s!     
 
 
'++	,
r:   c              7      "   T p\        V4      ;_uu_ 4        \        P                  ! 4       pR Vn        \        P                  ! V4       Vx  VP                  4        RRR4       R#   + '       g   i     R# ; i5iTN_temporary_event_loop_policyrL   new_event_loop__pytest_asyncioset_event_loopclose)event_loop_policyargsnew_loop_policyloops   $*  r;   scoped_event_loop.pytest_collectstart.<locals>.scoped_event_loopw  sW      ,)/::))+D$(D!""4(JJJL ;:::   A=AA)
A=)A:	4	A=c                     < SP                   p V e3   SV n         \        P                  4       pWn        SP                  4       # SP                  4       #   \
         d     SP                  4       # i ; irm   )r   "__pytest_asyncio_scoped_event_loop__package_loop_stackr   *__pytest_asyncio_package_scoped_event_loop
IndexError__original_collect)r*   package_loopr   r  s     r;   _patched_collect-pytest_collectstart.<locals>._patched_collect  su    ]]F!<M9#7#;#;#=LHTE //119//11 " //11s   A A10A1)next _fixture_scope_by_collector_typeitemsStopIteration_session_event_loopr4   r  r  nodeidr|   ro   rU   r!   r  r  r   r    collectr  r   r   r  )r   collector_scoper  r  r  s   f   @r;   pytest_collectstartr  Z  s    
>DDF
 
 )# 3 < <2G	./  )//0?.CIOO*+^^"
	
  I'!
 	##$56	Iv	&	&
	2 (1'8'8	$,		Iu	%	%;L	8 
&K  s   'D& &D54D5c                >    V ^8  d   QhR\         R\        R,          /# )rE   policyrH   N)r   r   )rI   s   "r;   rJ   rJ     s     ) ))@ )Xd^ )r:   c              #     "   \         P                  ! 4       p \        4       p\         P                  ! V 4        R x  \         P                  ! V4        \        4       P                  4        \         P                  ! V4       R #   \         d    R p Lqi ; i  \         d     L8i ; i  \         P                  ! T4        \        4       P                  4        M  \         d     Mi ; i\         P                  ! T4       i ; i5irm   )rL   get_event_loop_policy_get_event_loop_no_warnRuntimeErrorset_event_loop_policyr  r  )r  old_loop_policyold_loops   &  r;   r  r    s     335O*, !!&))%%o6	#%++- 	x(!    		 	%%o6	#%++- 		x(s   D
B DB) DB -DBDBDB&#D%B&&D)DCDC(%D'C((DDa      The event_loop fixture provided by pytest-asyncio has been redefined in
    %s:%d
    Replacing the event_loop fixture with a custom implementation is deprecated
    and will lead to errors in the future.
    If you want to request an asyncio event loop with a scope other than function
    scope, use the "scope" argument to the asyncio mark when marking the tests.
    If you want to return different types of event loops, use the event_loop_policy
    fixture.
    c                (    V ^8  d   QhR\         RR/# )rE   metafuncrH   N)r   )rI   s   "r;   rJ   rJ     s     "
 "
H "
 "
r:   c                    V P                   P                  R 4      pV'       g   R# \        V4      pVR8X  d   R# \        V P                   V4      pVP                  P                  \        R4      pV'       d   W@P                  9   d   R# V P                  P                  P                  R4      pVf   Q hRV P                  9   d@   \        \        P                  V P                   P                  VVP                  R7      4      hV P                  P                  V4       VP                   V,          V P                   V&   R# R# )rL   Nr   r   r   )	test_namer\   scoped_loop_node)
definitionr-  _get_marked_loop_scoper  r  r  r  fixturenamesr   rG   r   r=   _MULTIPLE_LOOPS_REQUESTED_ERRORrI   r  r  r   )r  markerr\   r  r  r   s   &     r;   pytest_generate_testsr    s     33I>F"6*E
*8+>+>FO+11556LdS
 !$9$99!66AA,O)))80002/66&1188%4%;%; 7   	$$%:;++,AB 	!!"78- r:   )r  c                `    V ^8  d   QhR\         R\        R\        P                  R3,          /# r   )r   r
   r  r  )rI   s   "r;   rJ   rJ     s,     *
 *
*
tV]]D()*
r:   c              #    "   V P                   R8X  Ed!   \        V \        \        \        P
                  ! 4       4      \        4       Rx pVP                  4       p\        P                  ! V P                  4      p\        VRR4      '       gJ   \        P                  ! V P                  4      w  rE\        P                  ! \        W53,          \         4       \        P
                  ! 4       p \#        V4      p\        VRR4      pWrJd   V'       g   VP%                  4        TP)                  T4       R# Rx  R#   \&         d     L&i ; i5i)z<Adjust the event loop policy when an event loop is produced.r   N__original_fixture_loopFr  )argname_add_finalizers_close_event_loop_restore_event_loop_policyrL   r  _provide_clean_event_loopr  r   getsourcefiler   r   getsourcelinesr   r   %_REDEFINED_EVENT_LOOP_FIXTURE_WARNINGDeprecationWarningr  r  r  r  )	r   outcomer  fixture_filename_fixture_line_numberr  r  is_pytest_asyncio_loops	   &        r;   pytest_fixture_setupr    s    
 \) 	&w'D'D'FG%		
 *1*<*<*> #00At6>>%,%;%;JOO%L"AMM5#9:"
 ..0		.v6H%,X7I5%Q"#,B  	d#	  	 		s0   C*E-$D; D; "E;E	EE		Ec                N    V ^8  d   QhR\         R\        . \        3,          RR/# )rE   r   
finalizersrH   N)r   r   rg   )rI   s   "r;   rJ   rJ   %  s+     
+ 
+
 
+"f*9M 
+RV 
+r:   c                L    \        V4       F  pV P                  V4       K  	  R# )a  
Regsiters the specified fixture finalizers in the fixture.

Finalizers need to specified in the exact order in which they should be invoked.

:param fixturedef: Fixture definition which finalizers should be added to
:param finalizers: Finalizers to be added
N)reversedr   )r   r  r   s   &* r;   r  r  %  s!     j)		* *r:   a      pytest-asyncio detected an unclosed event loop when tearing down the event_loop
    fixture: %r
    pytest-asyncio will close the event loop for you, but future versions of the
    library will no longer do so. In order to ensure compatibility with future
    versions, please make sure that:
        1. Any custom "event_loop" fixture properly closes the loop after yielding it
        2. The scopes of your custom "event_loop" fixtures do not overlap
        3. Your code does not modify the event loop in async fixtures or tests
    c                    V ^8  d   QhRR/# r   r2   )rI   s   "r;   rJ   rJ   @  s      4 r:   c                     \         P                  ! 4       p  V P                  4       pVeO   VP	                  4       '       g'   \
        P                  ! \        V,          \        4       VP                  4        R # R #   \         d    R p Lci ; irm   )
rL   r  get_event_loopr  	is_closedr   r   _UNCLOSED_EVENT_LOOP_WARNINGr  r  )r  r  s     r;   r  r  @  su    **,F$$& ~~MM,t3" 	

   s   A; ;B
Bc                6    V ^8  d   QhR\         . R3,          /# r   )r   )rI   s   "r;   rJ   rJ   O  s      8BH3E r:   c                    a  V 3R  lpV# )c                     <  \        S4      p V '       d   V P                  4        \        P                  ! S4       R #   \         d    R p  L?i ; irm   )r  r  r  rL   r  )r  previous_policys    r;   _restore_policy3_restore_event_loop_policy.<locals>._restore_policyP  sD    	*?;D JJL%%o6	  	D	s   > AAr2   )r  r  s   f r;   r  r  O  s    	7 r:   c                    V ^8  d   QhRR/# r   r2   )rI   s   "r;   rJ   rJ   ^  s     	$ 	$4 	$r:   c                  r    \         P                  ! 4       p V P                  4       pV P                  V4       R # rm   )rL   r  r  r  )r  new_loops     r;   r  r  ^  s.     **,F$$&H
(#r:   c                Z    V ^8  d   QhR\         \        ,          R\        P                  /# )rE   r  rH   )r   r   rL   r   )rI   s   "r;   rJ   rJ   j  s(     , ,,-,,r:   c                    \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       V e   V P	                  4       uuRRR4       # \
        P                  ! 4       uuRRR4       #   + '       g   i     R# ; i)ignoreN)r   catch_warningssimplefilterr  r  rL   )r  s   &r;   r  r  j  s[     
	 	 	"	"h(:;((* 
#	"
 ))+ 
#	"	"	"s   /A7A77B	)r   r  c                F    V ^8  d   QhR\         R\        \        ,          /# )rE   
pyfuncitemrH   )r   r   rg   )rI   s   "r;   rJ   rJ   v  s      8 0@ r:   c              #     "   V P                  R4      eA   \        V \        4      '       d   M)V P                  \        P
                  ! RV  R24      4       Rx  R# 5i)z
Pytest hook called before a test case is run.

Wraps marked tests in a synchronous function
where the wrapped test coroutine is executed in an event loop.
rL   Nz	The test z is marked with '@pytest.mark.asyncio' but it is not an async function. Please remove the asyncio mark. If the test is not marked explicitly, check for global marks applied via 'pytestmark'.)r-  r   r  r   r|   PytestWarning)r  s   &r;   pytest_pyfunc_callr   u  s^      $$Y/;j"788OO$$
| ,G G 
s   AAc                T    V ^8  d   QhR\         R\        \        ,          3,          /# )rE   r   .)r   r   r   )rI   s   "r;   rJ   rJ     s"      
3	#&
'r:   c                z   a  \        S RR4      pVe   Vo \        P                  ! S 4      V 3R l4       pS Vn        V# )zVReturn a sync wrapper around an async function executing it in the
current event loop._raw_test_funcNc                    < S! V / VB p\        4       p\        P                  ! W#R 7      p VP                  V4       R#   \         d?    TP                  4       '       d'   TP                  4       '       g   TP                  4        h i ; i))r  N)r  rL   ensure_futurer   r  done	cancelled	exception)r  rt   coro_looptaskr   s   *,   r;   ry   wrap_in_sync.<locals>.inner  sr    T$V$')$$T6	$$T* 	 yy{{4>>#3#3 	s   ?  B B6B)r   r}   r~   r  )r   raw_funcry   s   f  r;   rK  rK    sI     t-t4H__T   ELr:   a          Multiple asyncio event loops with different scopes have been requested
        by {test_name}. The test explicitly requests the event_loop fixture, while
        another event loop with {scope} scope is provided by {scoped_loop_node}.
        Remove "event_loop" from the requested fixture in your test to run the test
        in a {scope}-scoped event loop or remove the scope argument from the "asyncio"
        mark to run the test in a function-scoped event loop.
    c                <    V ^8  d   QhR\         P                  RR/# )rE   r  rH   N)r|   r   )rI   s   "r;   rJ   rJ     s     
 
v{{ 
t 
r:   c                    V P                  R 4      pVf   R# \        V4      pVR8w  d$   \        W4      pVP                  \        ,          pMRpV P
                  pWE9  d   VP                  V4       \        V RR4      p\        VRR4      '       g3   \        VRR4      '       d   \        P                  ! RV : R	24       R# R# R# )
rL   Nr   r   r   ru  Frt  ztest function `zU` is using Hypothesis, but pytest-asyncio only works with Hypothesis 3.64.0 or later.)
r-  r  r  r  r  r  r  r   r|   fail)r  r  r\   parent_noder  r  r   s   &      r;   pytest_runtest_setupr    s    $$Y/F~"6*E
*47 + 1 12H I ,$$L012
$t
$C3e,,!52 2 	dX &: :	
2,r:   zeAn asyncio pytest marker defines both "scope" and "loop_scope", but it should only use "loop_scope".
zvThe "scope" keyword argument to the asyncio marker has been deprecated. Please use the "loop_scope" argument instead.
c                0    V ^8  d   QhR\         R\        /# )rE   asyncio_markerrH   )r   rf   )rI   s   "r;   rJ   rJ     s      4 J r:   c                     V P                   R 8X  g   Q hV P                  '       g7   V P                  '       d0   \        V P                  4      RR0,
          '       d   \	        R4      hRV P                  9   dO   RV P                  9   d   \
        P                  ! \        4      h\        P                  ! \        \        4      4       V P                  P                  R4      ;'       g    V P                  P                  RR4      pVR9   g   Q hV# )rL   r]   r\   z5mark.asyncio accepts only a keyword argument 'scope'.r   >   r+   r*   r)   r(   r   )ra   r  rt   setr   r|   r   &_DUPLICATE_LOOP_SCOPE_DEFINITION_ERRORr   r   r$   '_MARKER_SCOPE_KWARG_DEPRECATION_WARNINGr  )r  r\   s   & r;   r  r    s    )+++#n&;&;"<g?V"V"VPQQ.'''>000##$JKK./VWX!!%%l3  ~7L7L7P7P8E IIIILr:   c                ^    V ^8  d   QhR\         \        \        3,          R\        R\        /# )rE   r  r\   rH   )r   r   r   ri   )rI   s   "r;   rJ   rJ     s*     + +uY_5 +c +i +r:   c                 J   R \         R\        R\        R\        /pW!,          p\	        V P                  4       4       F:  p\        WC4      '       g   K  \        V\        P                  4      '       g   Q hVu # 	  V P                   RV RV R2p\        P                  ! V4      h)r+   r*   r)   r(   z1 is marked to be run in an event loop with scope z, but is not part of any r   )r   r    r!   r&   r  	listchainr   r|   r   ra   r   )r  r\   node_type_by_scopescope_root_typer  error_messages   &&    r;   r  r    s    &77	 )/O)*d,,dF$4$45555K +
 99+Fug N""'	+  

M
**r:   c                Z    V ^8  d   QhR\         R\        \        P                  ,          /# )rE   r   rH   )r   r   rL   r   )rI   s   "r;   rJ   rJ     s%       8G4M4M+N r:   c              #     "   V P                  \        P                  4      p\        P                  ! V4       \        P
                  ! 4       P                  4       pRVn        Vx  VP                  4        R# 5i)z@Create an instance of the default event loop for each test case.TN)	r   r  r4   rL   r  r  r  r  r  )r   r  r  s   &  r;   r   r      s[      --.?.H.HIO!!/2((*99;D $(D 
JJJLs   A6A8)r\   c                f    V ^8  d   QhR\         R\        R\        \        P                  ,          /# )rE   r   r  rH   )r   r   r   rL   r   )rI   s   "r;   rJ   rJ     s/     	 		0G	g''(	r:   c              #      "   Tp\        V4      ;_uu_ 4        \        P                  ! 4       pR Vn        \        P                  ! V4       Vx  VP                  4        RRR4       R#   + '       g   i     R# ; i5ir  r  )r   r  r  r  s   &&  r;   r  r    sW      (O	%o	6	6%%' $t$


 
7	6	6	6r  )r\   r_   c                $    V ^8  d   QhR\         /# r  r   )rI   s   "r;   rJ   rJ     s     + +2 +r:   c                 ,    \         P                  ! 4       # )zDReturn an instance of the policy used to create asyncio event loops.)rL   r  r2   r:   r;   r  r    s     ((**r:   c                0    V ^8  d   QhR\         R\        /# r7  )r   rh   )rI   s   "r;   rJ   rJ   #  s     3 3 3 3r:   c                "    \        V \        4      # )z4Returns whether a test item is a pytest-asyncio test)r   r  r;  s   &r;   is_async_testr'  #  s    d122r:   c                0    V ^8  d   QhR\         R\         /# )rE   socket_typerH   rk   )rI   s   "r;   rJ   rJ   (  s     % %c %c %r:   c                    \         P                  ! \        P                  ! V R7      4      ;_uu_ 4       pVP                  R4       VP	                  4       ^,          uuRRR4       #   + '       g   i     R# ; i)z<Find an unused localhost port from 1024-65535 and return it.)rU   N)z	127.0.0.1    )
contextlibclosingsocketbindgetsockname)r)  socks   & r;   _unused_portr3  (  sK    			FMM{;	<	<		"#!!$ 
=	<	<	<s   (A''A8	c                $    V ^8  d   QhR\         /# r  r*  )rI   s   "r;   rJ   rJ   0  s     , , ,r:   c                  4    \        \        P                  4      # rm   )r3  r/  SOCK_STREAMr2   r:   r;   unused_tcp_portr7  /  s    **++r:   c                $    V ^8  d   QhR\         /# r  r*  )rI   s   "r;   rJ   rJ   5  s     + + +r:   c                  4    \        \        P                  4      # rm   )r3  r/  
SOCK_DGRAMr2   r:   r;   unused_udp_portr;  4  s    ))**r:   c                >    V ^8  d   QhR\         . \        3,          /# r  r   rk   )rI   s   "r;   rJ   rJ   :        "c'!2 r:   c                 (   a \        4       oV3R lp V # )z9A factory function, producing different unused TCP ports.c                    < \        \        P                  4      p V S9   d   \        \        P                  4      p K"  SP                  V 4       V # zReturn an unused port.)r3  r/  r6  r   portproduceds    r;   factory(unused_tcp_port_factory.<locals>.factory>  s<    F../h 2 23DTr:   r  rE  rD  s    @r;   unused_tcp_port_factoryrI  9       uH	 Nr:   c                >    V ^8  d   QhR\         . \        3,          /# r  r=  )rI   s   "r;   rJ   rJ   M  r>  r:   c                 (   a \        4       oV3R lp V # )z9A factory function, producing different unused UDP ports.c                    < \        \        P                  4      p V S9   d   \        \        P                  4      p K"  SP                  V 4       V # rA  )r3  r/  r:  r   rB  s    r;   rE  (unused_udp_port_factory.<locals>.factoryQ  s<    F--.h 1 12DTr:   rG  rH  s    @r;   unused_udp_port_factoryrO  L  rJ  r:   c                *   V ^8  d   Qh/ ^ \         9   d   \        \        ,          ;R&   ^\         9   d0   \        \        \
        P                  ,          \        3,          ;R&   ^\         9   d&   \        \        \        \        3,          ,          ;R&   # )rE   r  r  r  )__conditional_annotations__r   r   r   r   r|   r   rf   r   r   rq   re   )rI   s   "r;   rJ   rJ      sr     $ $X !  Z  Y %V '$v/?/?*@**L"M W %l O Nd5!6!GHI Nm %r:   )r(   r)   r*   r+   r   ).)NNrm   ){rQ  r8   rL   r-  enumr}   r   r/  r   r   textwrapr   typingr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r  r|   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   rf   r,   rg   r-   r/   re   rq   	Exceptionr1   r=   ri   Enumr?   rX   r[   ro   r   r{   r   r   r   r   hookimplr   r   r   r   r   r   r   r   r  rA  rW  rg  rp  r  r  r  r  r  r  r  r  contextmanagerr  r  r  r  r  r  r  r  r  r  r   rK  r  r  r  r  r  r  r   r  r  r'  r3  r7  r;  rI  rO  rJ   )rQ  s   @r;   <module>rY     s   $        +     *      ( HI
T]8C61B,B#C  !HS-2G-G$H  -/EEF /!2O!CD = =D'9 D3		 
 , 
 GJ +.	
 *-  	  
  
  GJ  +.	 
 *-    	    
  $9
!O

% !	 $N  N*2Z( $0N-*!(2$H 2$j%  * ,- */ , 5  
 5E	 F	 54H&6 I&6R "# 	7 Y
HYQ    MO  N MM MM` ) ). )/	) % $"
  "
J T"*
 #*
Z
+  &	  	$, $D1 20@ #)	# 
.* &
+ '"+&   i 	 !	 i.+ /+
3
% , , + + i  !$ i  !r:   