+
    -jt  c                      R t ^ RIHt ^ RIt^ RIHu Ht ^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	HtHt ^ RIHtHtHtHtHtHtHt ^ RIHtHt ^ RI H!t!H"t"H#t#H$t$H%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/H0t0H1t1H2t2H3t3H4t4H5t5H6t6 ]Pn                  R~8  d   ^ R
I	H8t8 M^ R
I9H8t8 ]Pn                  R8  d   ^ RI H:t: M^ RI;H:t: ]"R,          t<]$! R]]!,          ]]!,          ,          R7      t=]#! R4      t>]]>]=3,          t? ! R R]@4      tA ! R R]B]P                  4      tDRtER R ltF]%RRRRRRRRRRRR/R R ll4       tG]%RRRRRRRRRRRRR/R  R! lll4       tGRR" R# lltGR$ R% ltHR& R' ltIR( R) ltJR* R+ ltKR, R- ltLR.tMR/ R0 ltNR1 R2 ltO]'P                  ! R3R47      R5 R6 l4       tQR7 R8 ltR]#! R94      tS]$! R:4      tTR; R< ltU]#! R=4      tV]$! R>4      tWR? R@ ltXRA RB ltY ! RC RD]/4      tZ ! RE RF]Z4      t[ ! RG RH]Z4      t\ ! RI RJ]Z4      t] ! RK RL]Z4      t^]'P                  ! RMR3RN7      RO RP l4       t_]
P                  RQ RR l4       taRS RT ltbRU RV ltcRRW RX lltdRY RZ lte]'P                  ! R3R3R[7      R\ R] l4       tfR^ R_ ltg]'P                  ! R3R`7      Ra Rb l4       thRctiRdtjRe Rf ltkRg Rh ltlRitmRj Rk ltn]+ F+  to]n! ]oP                  4      ]q! 4       Rl]oP                   Rm2&   K-  	  ]'P                  ! RR3Rn7      Ro Rp l4       trRq Rr ltsRs Rt ltt]'P                  Ru Rv l4       tu]'P                  Rw Rx l4       tv]'P                  ! RRy7      Rz R{ l4       tw]'P                  ! RRy7      R| R} l4       txR# )zpytest-asyncio implementation.)annotationsN)AbstractEventLoopAbstractEventLoopPolicy)AsyncIterator	AwaitableCallable	GeneratorIterableIteratorSequence)AsyncGeneratorTypeCoroutineType)AnyLiteral	ParamSpecTypeVaroverload)resolve_fixture_function)Scope)Config
FixtureDefFixtureRequestFunctionItemMarkMonkeyPatchParserPytestCollectionWarningPytestDeprecationWarningPytestPluginManager)Runner)TypeIssession_R)bound_Pc                      ] 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__r'       j/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/pytest_asyncio/plugin.pyr&   r&   D   s    <r.   r&   c                      ] tR t^HtRtRtRtR# )Modeautostrictr'   N)r(   r)   r*   r+   AUTOSTRICTr-   r'   r.   r/   r1   r1   H   s    DFr.   r1   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               $    V ^8  d   QhRRRRRR/# )   parserr   pluginmanagerr   returnNoner'   )formats   "r/   __annotate__r=   U   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R	R
7       V P                  RRRR7       V P                  RR	RRR7       V P                  RRRRR7       V P                  RRRRR7       R# )asyncioz--asyncio-modeasyncio_modeNMODE)destdefaultmetavarhelpz--asyncio-debugasyncio_debug
store_truez4enable asyncio debug mode for the default event loop)rB   actionrC   rE   z default value for --asyncio-moder3   )rE   rC   boolfalse)rE   typerC   "asyncio_default_fixture_loop_scopestringzFdefault scope of the asyncio event loop used to execute async fixtures)rK   rE   rC   asyncio_default_test_loop_scopez=default scope of the asyncio event loop used to execute testsfunction)getgroup	addoptionASYNCIO_MODE_HELPaddini)r8   r9   groups   && r/   pytest_addoptionrU   U   s    OOI&E	OO   
OOC   MM/  
 MMC	   MM,U	   MM)L	  r.   scope.
loop_scopeparamsautouseidsnamec               8    V ^8  d   QhRRRRRRRRR	R
RRRRRR/# )r7   fixture_functionFixtureFunction[_P, _R]rV   0_ScopeName | Callable[[str, Config], _ScopeName]rW   _ScopeName | NonerX   Iterable[object] | NonerY   rI   rZ   QIterable[str | float | int | bool | None] | Callable[[Any], object | None] | Noner[   
str | Noner:   r'   )r<   s   "r/   r=   r=      sZ     " "-" <" "	"
 $" "	" " "r.   c                   R # Nr'   r]   rV   rW   rX   rY   rZ   r[   s   &$$$$$$r/   fixturerg   ~   s     "r.   c               8    V ^8  d   QhRRRRRRRRR	R
RRRRRR/# )r7   r]   r;   rV   r_   rW   r`   rX   ra   rY   rI   rZ   rb   r[   rc   r:   z<Callable[[FixtureFunction[_P, _R]], FixtureFunction[_P, _R]]r'   )r<   s   "r/   r=   r=      se     G GG <G "	G
 $G G	G G BGr.   c                   R # re   r'   rf   s   &$$$$$$r/   rg   rg      s	     DGr.   c               (    V ^8  d   QhRRRRRRRR/# )	r7   r]   zFixtureFunction[_P, _R] | NonerW   r`   kwargsr   r:   zVFixtureFunction[_P, _R] | Callable[[FixtureFunction[_P, _R]], FixtureFunction[_P, _R]]r'   )r<   s   "r/   r=   r=      s1      4! 
C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                    V ^8  d   QhRRRR/# )r7   r]   r^   r:   r'   )r<   s   "r/   r=   fixture.<locals>.__annotate__   s      	N 	N$; 	N@W 	Nr.   c                    < \        V 3R S/SB # )rW   )rg   )r]   rk   rW   s   &r/   innerfixture.<locals>.inner   s    +M
MfMMr.   )_make_asyncio_fixture_functionpytestrg   	functoolswraps)r]   rW   rk   rp   s   &fl r/   rg   rg      sW     #&'7D~~.9&99 
	!	N 	N 
"	N r.   c                    V ^8  d   QhRRRR/# r7   objr   r:   rI   r'   )r<   s   "r/   r=   r=      s     9 9c 9d 9r.   c                6    \        V R V 4      p \        V RR4      # )__func___force_asyncio_fixtureF)getattrrx   s   &r/   _is_asyncio_fixture_functionr~      s     
#z3
'C30%88r.   c               $    V ^8  d   QhRRRRRR/# )r7   rx   r   rW   r`   r:   r;   r'   )r<   s   "r/   r=   r=      s"     ! ! !9J !t !r.   c                \    \        V R 4      '       d   V P                  p RV n        Wn        R# )rz   TN)hasattrrz   r{   _loop_scope)rx   rW   s   &&r/   rr   rr      s%    sJll!%C Or.   c                    V ^8  d   QhRRRR/# rw   r'   )r<   s   "r/   r=   r=      s     O O3 O4 Or.   c                j    \         P                  ! V 4      ;'       g    \         P                  ! V 4      # re   )inspectiscoroutinefunctionisasyncgenfunctionr}   s   &r/   _is_coroutine_or_asyncgenr      s&    &&s+NNw/I/I#/NNr.   c                    V ^8  d   QhRRRR/# )r7   configr   r:   r1   r'   )r<   s   "r/   r=   r=      s     
 
f 
 
r.   c                    V P                  R 4      pVf   V P                  R 4      p \        V4      #   \         d@   pRP	                  R \         4       4      p\
        P                  ! T: RT R24      ThRp?ii ; i)r@   N, c              3  8   "   T F  qP                   x  K  	  R # 5ire   )value).0ms   & r/   	<genexpr>$_get_asyncio_mode.<locals>.<genexpr>   s     04a''4s   z+ is not a valid asyncio_mode. Valid modes: .)	getoptiongetinir1   
ValueErrorjoinrs   
UsageError)r   valemodess   &   r/   _get_asyncio_moder      s    


>
*C
{mmN+Cy 		0400g@qI
	s   
3 A=:A88A=c                    V ^8  d   QhRRRR/# )r7   r   r   r:   rI   r'   )r<   s   "r/   r=   r=      s      v $ r.   c                    V P                  R 4      pVf   V P                  R 4      p\        V\        4      '       d   V# VR8H  # )rF   true)r   r   
isinstancerI   )r   r   s   & r/   _get_asyncio_debugr      sA    


?
+C
{mmO,#t
f}r.   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RRR/# )r7   rV   rc   option_namestrr:   r;   r'   )r<   s   "r/   r=   r=      s!     
 
: 
C 
D 
r.   c           	         V f   R # \          Uu. uF  q"P                  NK  	  ppW9  d0   \        P                  ! V : RV RRP	                  V4       R24      hR # u upi )Nz is not a valid z. Valid scopes are: r   r   )r   r   rs   r   r   )rV   r   svalid_scopess   &&  r/   _validate_scoper      sj    }%*+UGGUL+ i'} 5!!%<!8 9<
 	
 ! ,s   Ac                    V ^8  d   QhRRRR/# )r7   r   r   r:   r;   r'   )r<   s   "r/   r=   r=      s      V  r.   c                    V P                  R 4      p\        VR 4       V'       g$   \        P                  ! \	        \
        4      4       V P                  R4      p\        VR4       V P                  RR4       R# )rL   rN   markerszQasyncio: mark the test as a coroutine, it will be run using an asyncio event loopN)r   r   warningswarnr   !_DEFAULT_FIXTURE_LOOP_SCOPE_UNSETaddinivalue_line)r   default_fixture_loop_scopedefault_test_loop_scopes   &  r/   pytest_configurer      sf    !'/S!T.0TU%./PQR$mm,MN+-NO
	*r.   T)tryfirstc                    V ^8  d   QhRRRR/# )r7   r   r   r:   z	list[str]r'   )r<   s   "r/   r=   r=     s       I r.   c                    \        V 4      p\        V 4      pV P                  R4      p\        V 4      pRV 2RV 2RV 2RV 2.pRRP	                  V4      ,           .# )z$Add asyncio config to pytest header.rL   zmode=zdebug=z#asyncio_default_fixture_loop_scope=z asyncio_default_test_loop_scope=z	asyncio: r   )r   r   r   _get_default_test_loop_scoper   )r   modedebugr   r   headers   &     r/   pytest_report_headerr     s     V$Dv&E!'/S!T:6B
v

-.H-IJ
*+B*CD	F 	dii'' r.   c               (    V ^8  d   QhRRRRRRRR/# )	r7   
fixturedefr   runnerr   requestr   r:   r   r'   )r<   s   "r/   r=   r=     s,     
 

$*
5C

r.   c                    \        W4      p\        P                  ! V P                  4      '       d   \	        W1V4      # \        P
                  ! V P                  4      '       d   \        W1V4      # V P                  # )z@Returns a synchronous function evaluating the specified fixture.)r   r   r   func_wrap_asyncgen_fixturer   _wrap_async_fixture)r   r   r   r]   s   &&& r/   _fixture_synchronizerr     s_     0
D!!*//22%&6HH		$	$Z__	5	5"#3WEEr.   AsyncGenFixtureParamsAsyncGenFixtureYieldTypec               (    V ^8  d   QhRRRRRRRR/# )	r7   r]   zRCallable[AsyncGenFixtureParams, AsyncGeneratorType[AsyncGenFixtureYieldType, Any]]r   r   r   r   r:   z9Callable[AsyncGenFixtureParams, AsyncGenFixtureYieldType]r'   )r<   s   "r/   r=   r=   &  s4     +% +%+% 	+%
 +% ?+%r.   c                T   a aa \         P                  ! S 4      R  V VV3R ll4       pV# )c                    V ^8  d   QhRRRR/# )r7   argszAsyncGenFixtureParams.argsrk   zAsyncGenFixtureParams.kwargsr'   )r<   s   "r/   r=   ,_wrap_asyncgen_fixture.<locals>.__annotate__.  s     ! !)!.!r.   c                    <aaa S! V / VB oV3R  lp\         P                  ! 4       oS
P                  V! 4       SR7      p\        S4      oR VVVV
3R llpS	P	                  V4       V# )c                 D   <"   SP                  4       G R j  xL
 p V #  L5ire   )	__anext__)resgen_objs    r/   setupH_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper.<locals>.setup4  s!     ))++CJ ,s     contextc                   V ^8  d   QhRR/# r7   r:   r;   r'   )r<   s   "r/   r=   O_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper.<locals>.__annotate__=  s     	$ 	$4 	$r.   c                 d   < R V3R llp SP                  V ! 4       SR7       Se
   S! 4        R# R# )zYield again, to finalize.c                   V ^8  d   QhRR/# r   r'   )r<   s   "r/   r=   b_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper.<locals>.finalizer.<locals>.__annotate__@  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_finalizer@  sP     *!++--- AC--C$S/) .) s1   A5 35 A5 A AAAr   Nrun)r   r   r   reset_contextvarsr   s    r/   	finalizerL_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper.<locals>.finalizer=  s3    * * JJ('J: ,!# -r.   contextvarscopy_contextr   _apply_contextvar_changesaddfinalizer)r   rk   r   resultr   r   r   r   r]   r   r   s   *,   @@@r/   _asyncgen_fixture_wrapper9_wrap_asyncgen_fixture.<locals>._asyncgen_fixture_wrapper-  sg    
 #D3F3	 **,EGW55g>	$ 	$" 	Y'r.   rt   ru   )r]   r   r   r   s   fff r/   r   r   &  s/     __%&! ! '!F %$r.   AsyncFixtureParamsAsyncFixtureReturnTypec               (    V ^8  d   QhRRRRRRRR/# )	r7   r]   zMCallable[AsyncFixtureParams, CoroutineType[Any, Any, AsyncFixtureReturnType]]r   r   r   r   r:   z4Callable[AsyncFixtureParams, AsyncFixtureReturnType]r'   )r<   s   "r/   r=   r=   X  s4     !" !"!" 	!"
 !" :!"r.   c                T   a aa \         P                  ! S 4      R  V VV3R ll4       pV# )c                    V ^8  d   QhRRRR/# )r7   r   zAsyncFixtureParams.argsrk   zAsyncFixtureParams.kwargsr'   )r<   s   "r/   r=   )_wrap_async_fixture.<locals>.__annotate__`  s      &+r.   c                    <a a V VV3R  lp\         P                  ! 4       pSP                  V! 4       VR7      p\        V4      pVe   SP	                  V4       V# )c                 4   <"   S! S/ SB G R j  xL
 p V #  L5ire   r'   )r   r   r]   rk   s    r/   r   B_wrap_async_fixture.<locals>._async_fixture_wrapper.<locals>.setupd  s"     ($9&99CJ :s   r   r   )	r   rk   r   r   r   r   r]   r   r   s	   jl    r/   _async_fixture_wrapper3_wrap_async_fixture.<locals>._async_fixture_wrapper_  sS    
	 **,EGW5 6g>(  !23r.   r   )r]   r   r   r   s   fff r/   r   r   X  s.     __%&  '2 "!r.   c                    V ^8  d   QhRRRR/# )r7   r   contextvars.Contextr:   zCallable[[], None] | Noner'   )r<   s   "r/   r=   r=   |  s       r.   c                  a . oV  F\  p VP                  4       V P                  V4      J d   K)   VP                  V P                  V4      4      pSP                  W34       K^  	  S'       g   R# V3R lpV#   \         d     LUi ; i)z
Copy contextvar changes from the given context to the current context.

If any contextvars were modified by the fixture, return a finalizer that
will restore them.
Nc                 b   < S'       d&   SP                  4       w  rV P                  V4       K-  R # re   )popreset)vartokencontext_tokenss     r/   restore_contextvars6_apply_contextvar_changes.<locals>.restore_contextvars  s'    )--/LSIIe r.   )getLookupErrorsetappend)r   r   r   r  r   s   &   @r/   r   r   |  s     N	wwyGKK,, - C()sl+  
   		s   #A88BBc                     a  ] tR tRtRt]R R l4       t]R R l4       t]R R l4       t	R	 V 3R
 llt
R V 3R llt]P                  R R l4       t]R R l4       tRtV ;t# )PytestAsyncioFunctioni  z<Base class for all test functions managed by pytest-asyncio.c                    V ^8  d   QhRRRR/# )r7   itemr   r:   z"type[PytestAsyncioFunction] | Noner'   )r<   s   "r/   r=   "PytestAsyncioFunction.__annotate__  s     
 
X 
5W 
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)clsr
  subclasss   "" r/   item_subclass_for'PytestAsyncioFunction.item_subclass_for  s2     **,H''-- - r.   c                    V ^8  d   QhRRRR/# r7   rO   r   r:   r'   )r<   s   "r/   r=   r    s     ! !h !h !r.   c                  VP                   pRq2! V4      qD'       g   RRR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MRR\        P
                  ! V4      R\        P
                  ! V4      R\        P
                  ! V4      /,          p\        \        P                  ! V4      4      hR;p;r4VP                  pRqbVJq3'       g   \        P                  ! RV3RW&34      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MRR\        P
                  ! V4      R	\        P
                  ! V4      /,          pR
RV/,          p\        \        P                  ! V4      4      hR;p;r6V 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"                  q!P"                  qBV8H  q3'       Eg   \        P                  ! RV3RW$34      RR\        P                  ! 4       9   g   \        P                  ! V	4      '       d   \        P
                  ! V	4      MRR\        P
                  ! V4      RR\        P                  ! 4       9   g   \        P                  ! V4      '       d   \        P
                  ! V4      MRR\        P
                  ! V4      /,          pRRV/,          p
\        \        P                  ! V
4      4      hR;p;r4V	# )zY
Instantiates this specific PytestAsyncioFunction type from the specified
Function item.
r?   zTassert %(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.get_closest_marker
}(%(py4)s)
}py0rO   py2py4py6Npy5assert %(py7)spy7callspec)r[   r  callobjfixtureinfokeywordsoriginalnamesubclass_instancezassert %(py8)spy8is not)z2%(py2)s
{%(py2)s = %(py0)s.parent
} is not %(py5)s==)zT%(py2)s
{%(py2)s = %(py0)s.own_markers
} == %(py6)s
{%(py6)s = %(py4)s.own_markers
})get_closest_marker@py_builtinslocals
@pytest_ar_should_repr_global_name	_safereprAssertionError_format_explanationparent_call_reprcomparefrom_parentr[   r|   rx   _fixtureinfor   r!  own_markers)r  rO   @py_assert1@py_assert3@py_assert5@py_format7@py_assert4@py_format6@py_format8r"  @py_format9s   ""         r/   _from_function$PytestAsyncioFunction._from_function  s    **595*9555555555x5555x555*55595555555555*d*d***********x****x******d********OOOOXz48LL --&&!.. , 
 )1(<(<% ,,D0D0DD0DDDDDD,DDDDDD DDDD DDD,DDDDDDDDDDDDD0DDDDDDDDD  r.   c                    V ^8  d   QhRRRR/# r7   r
  r   r:   rI   r'   )r<   s   "r/   r=   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.   c                   V ^8  d   QhRR/# r   r'   )r<   s   "r/   r=   r    s      t r.   c                	   < R V P                    R2pWP                  9  d   V P                  P                  V4       \        SV `  4       # )__scoped_runner)r   fixturenamesr  superr   )selfrunner_fixture_id	__class__s   & r/   r   PytestAsyncioFunction.setup  sF     0 01@$5$55$$%67w}r.   c                   V ^8  d   QhRR/# r   r'   )r<   s   "r/   r=   r    s     	 	 	r.   c                	  < R V P                    R2pV P                  P                  V4      p\        P                  ! 4       p\        \        V P                  !  W#4      p\        P                  ! 4       ;_uu_ 4       pVP                  ! . V P                  OVN5!   \        SV `1  4        RRR4       R#   + '       g   i     R# ; i)rG  rH  N)r   _requestgetfixturevaluer   r   _synchronize_coroutiner|   _synchronization_target_attrr   r   setattrrJ  runtest)rK  rL  r   r   synchronized_objcrM  s   &     r/   rV  PytestAsyncioFunction.runtest  s     0 01@../@A**,1T667
   ""aIIKt88K:JKGO #"""s   <.B44C	c                   V ^8  d   QhRR/# )r7   r:   
_ScopeNamer'   )r<   s   "r/   r=   r    s     B BZ Br.   c                   V P                  R4      pRq!VJq3'       g   \        P                  ! RV3R	W34      RR\        P                  ! 4       9   g   \        P
                  ! V4      '       d   \        P                  ! V4      MRR\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;r2\        V P                  4      p\        W4      # )
aJ  
Return the scope of the asyncio event loop this item is run in.

The effective scope is determined lazily. It is identical to to the
`loop_scope` value of the closest `asyncio` pytest marker. If no such
marker is present, the the loop scope is determined by the configuration
value of `asyncio_default_test_loop_scope`, instead.
r?   Nr  markerpy3assert %(py5)sr  r$  )z%(py0)s is not %(py3)s)r(  r+  r1  r)  r*  r,  r-  r.  r/  r   r   _get_marked_loop_scope)rK  r]  @py_assert2r5  @py_format4r:  default_loop_scopes   &      r/   r   !PytestAsyncioFunction._loop_scope  s     ((3!!T!!!!!v!!!!!!v!!!!v!!!T!!!!!!!!9$++F%fAAr.   c                   V ^8  d   QhRR/# r7   r:   ztuple[object, str]r'   )r<   s   "r/   r=   r    s      .@ r.   c                
    V R3# )a  
Return the coroutine that needs to be synchronized during the test run.

This method is inteded to be overwritten by subclasses when they need to apply
the coroutine synchronizer to a value that's different from self.obj
e.g. the AsyncHypothesisTest subclass.
rx   r'   rK  s   &r/   rT  2PytestAsyncioFunction._synchronization_target_attr  s     U{r.   r'   )r(   r)   r*   r+   r,   classmethodr  r=  staticmethodr  r   rV  rt   cached_propertyr   propertyrT  r-   __classcell__rM  s   @r/   r  r    s    F
 
 ! !( $ $ 	 	 B B  r.   r  c                  0    ] tR tRtRt]R R l4       tRtR# )	Coroutinei  z"Pytest item created by a coroutinec                    V ^8  d   QhRRRR/# r@  r'   )r<   s   "r/   r=   Coroutine.__annotate__  s     1 1h 14 1r.   c                	F    V P                   p\        P                  ! V4      # re   )rx   r   r   r
  r   s   & r/   r  Coroutine._can_substitute  s    xx**400r.   r'   Nr(   r)   r*   r+   r,   rk  r  r-   r'   r.   r/   rq  rq    s    ,1 1r.   rq  c                  R   a  ] tR tRtRt]R R l4       t]R V 3R ll4       tRt	V ;t
# )AsyncGeneratori  z0Pytest item created by an asynchronous generatorc                    V ^8  d   QhRRRR/# r@  r'   )r<   s   "r/   r=   AsyncGenerator.__annotate__  s     0 0h 04 0r.   c                	F    V P                   p\        P                  ! V4      # re   )rx   r   r   ru  s   & r/   r  AsyncGenerator._can_substitute  s    xx))$//r.   c                    V ^8  d   QhRRRR/# r  r'   )r<   s   "r/   r=   r{    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)r   reason)	rJ  r=  r[   r   r   
add_markerrs   markxfail)r  rO   async_gen_itemunsupported_item_type_messagerM  s   ""  r/   r=  AsyncGenerator._from_function  sp    /9H}}o.0 	& 	34QRS!!KK%0MN	
 r.   r'   )r(   r)   r*   r+   r,   rk  r  rj  r=  r-   rn  ro  s   @r/   ry  ry    s,    :0 0 
 
r.   ry  c                  0    ] tR tRtRt]R R l4       tRtR# )AsyncStaticMethodi  zZ
Pytest item that is a coroutine or an asynchronous generator
decorated with staticmethod
c                    V ^8  d   QhRRRR/# r@  r'   )r<   s   "r/   r=   AsyncStaticMethod.__annotate__  s     
 
h 
4 
r.   c                	t    V P                   p\        V\        4      ;'       d    \        VP                  4      # re   )rx   r   rk  r   rz   ru  s   & r/   r  !AsyncStaticMethod._can_substitute  s3    xx$- 
 
2KMM3
 	
r.   r'   Nrw  r'   r.   r/   r  r    s    
 
 
r.   r  c                  ^   a  ] tR tRtRtR V 3R llt]R R l4       t]R R l4       t	R	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R/# r   r'   )r<   s   "r/   r=    AsyncHypothesisTest.__annotate__%  s      t r.   c                	   < \        V P                  R R4      '       g9   \        V P                  RR4      '       d   \        P                  ! RV : R24       \        SV `  4       # )
hypothesisFis_hypothesis_testztest function `zU` is using Hypothesis, but pytest-asyncio only works with Hypothesis 3.64.0 or later.)r|   rx   rs   failrJ  r   )rK  rM  s   &r/   r   AsyncHypothesisTest.setup%  s[    txxu55'HH*E;
 ;
 KK!$ *> > w}r.   c                    V ^8  d   QhRRRR/# r@  r'   )r<   s   "r/   r=   r  0  s     
 
h 
4 
r.   c                	    V P                   p\        VR R4      ;'       d@    \        VRR4      ;'       d+    \        P                  ! VP                  P
                  4      # )r  Fr  N)rx   r|   r   r   r  
inner_testru  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/# rf  r'   )r<   s   "r/   r=   r  9  s     1 1.@ 1r.   c                	2    V P                   P                  R 3# )r  )rx   r  rh  s   &r/   rT  0AsyncHypothesisTest._synchronization_target_attr8  s    xx""L00r.   r'   )r(   r)   r*   r+   r,   r   rk  r  rm  rT  r-   rn  ro  s   @r/   r  r    s:    
  
 
 1 1r.   r  pytest_pycollect_makeitem)specnamehookwrapperc               (    V ^8  d   QhRRRRRRRR/# )	r7   	collectorzpytest.Module | pytest.Classr[   r   rx   objectr:   z$Generator[None, pluggy.Result, None]r'   )r<   s   "r/   r=   r=   @  s,     #6 #6+#636#6=C#6)#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.
Nr?   )
get_resultBaseExceptionforce_exceptionr   r
   iterr   r  r  r   r   r1   r4   r(  r  r=  r  force_result)r  r[   rx   hook_resultnode_or_list_of_nodesr   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RRR/# )r7   policyr   r:   zIterator[None]r'   )r<   s   "r/   r=   r=   g  s     " ")@ "^ "r.   c              #     "   \        4       p \        4       p\        V 4        R x  \        V4       \	        V4       R #   \         d    R p L7i ; i  \        T4       \	        T4       i ; i5ire   )_get_event_loop_policy_get_event_loop_no_warnRuntimeError_set_event_loop_policy_set_event_loop)r  old_loop_policyold_loops   &  r/   _temporary_event_loop_policyr  f  sd     ,.O*, 6""/!   	/!s=   A.
A  A.A A. AA.AA.A++A.c                   V ^8  d   QhRR/# r7   r:   r   r'   )r<   s   "r/   r=   r=   u  s     / / 7 /r.   c                     \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       \        P
                  ! 4       uuRRR4       #   + '       g   i     R# ; iignoreN)r   catch_warningssimplefilterDeprecationWarningr?   get_event_loop_policyr'   r.   r/   r  r  u  s=    		 	 	"	"h(:;,,. 
#	"	"	"s   0AA*	c                    V ^8  d   QhRRRR/# )r7   r  r   r:   r;   r'   )r<   s   "r/   r=   r=   {  s     . .#: .t .r.   c                    \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       \        P
                  ! V 4       RRR4       R#   + '       g   i     R# ; ir  )r   r  r  r  r?   set_event_loop_policyr  s   &r/   r  r  {  s?    		 	 	"	"h(:;%%f- 
#	"	"	"   2AA+	c                    V ^8  d   QhRRRR/# )r7   r  zAbstractEventLoopPolicy | Noner:   zasyncio.AbstractEventLoopr'   )r<   s   "r/   r=   r=     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r  )r   r  r  r  get_event_loopr?   r  s   &r/   r  r    s[     
	 	 	"	"h(:;((* 
#	"
 ))+ 
#	"	"	"s   /A7A77B	c                    V ^8  d   QhRRRR/# )r7   loopzAbstractEventLoop | Noner:   r;   r'   )r<   s   "r/   r=   r=     s     % %2 %t %r.   c                    \         P                  ! 4       ;_uu_ 4        \         P                  ! R \        4       \        P
                  ! V 4       RRR4       R#   + '       g   i     R# ; ir  )r   r  r  r  r?   set_event_loop)r  s   &r/   r  r    s?    		 	 	"	"h(:;t$ 
#	"	"	"r  )r   r  c                    V ^8  d   QhRRRR/# )r7   
pyfuncitemr   r:   object | Noner'   )r<   s   "r/   r=   r=     s     ) )8 ) )r.   c           
   #  @  "   V P                  R4      Ee   \        V 4      '       d   \        V P                  4      pV P                  P
                  P                  4        F  w  r#VR	,          P                  pV\        P                  8X  g   K/  \        V4      '       g   KB  \        V4      '       d   KU  \        P                  ! \        RV P                  : RV: R24      ^R7       K  	  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.r?   Nzasyncio test z! requested async @pytest.fixture z in strict mode. You might want to use @pytest_asyncio.fixture or switch to auto mode. This will become an error in future versions of pytest-asyncio.)
stacklevelz	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(  is_async_testr   r   r3  name2fixturedefsitemsr   r1   r5   r   r~   r   r   r   r[   rs   PytestWarning)r  r@   fixnamefixturesr   s   &    r/   pytest_pyfunc_callr    s      $$Y/;$$,Z->->?L%/%<%<%M%M%S%S%U!  |(( DKK/1$778>>MM0+JOO+> ?/&k *.. $% &V4 OO$$
| ,G G 
s   B	DD#D6A(Dc               $    V ^8  d   QhRRRRRR/# )r7   r   zCallable[..., CoroutineType]r   zasyncio.Runnerr   r   r'   )r<   s   "r/   r=   r=     s&      
& !r.   c                N   a aa \         P                  ! S 4      VV V3R l4       pV# )z\
Return a sync wrapper around a coroutine executing it in the
specified runner and context.
c                 >   < S! V / VB pSP                  VSR 7       R# )r   Nr   )r   rk   coror   r   r   s   *, r/   rp   %_synchronize_coroutine.<locals>.inner  s"    T$V$

4
)r.   r   )r   r   r   rp   s   fff r/   rS  rS    s'     __T* * Lr.   )wrapperc                    V ^8  d   QhRRRR/# )r7   r   r   r:   r  r'   )r<   s   "r/   r=   r=     s      Z ] r.   c              #  |  "   \        VP                  4      p\        V P                  4      '       g9   V\        P
                  8X  d   R x # \        V P                  4      '       g   R x # VP                  P                  R4      p\        V P                  RR 4      ;'       g    T;'       g    V P                  pRV R2pVP                  V4      p\        WV4      p\        Wt4       \        P                  ! 4       ;_uu_ 4       pVP                  V RV4       R x p	R R R 4       V	#   + '       g   i     X	# ; i5i)NrL   r   rG  rH  r   )r   r   r~   r   r1   r5   r   r   r|   rV   rR  r   rr   r   r   rU  )
r   r   r@   rc  rW   rL  r   synchronizerrX  r  s
   &&        r/   pytest_fixture_setupr    s    $W^^4L'
884;;& N(99N ../ST
5 	 		 	 
 J<~6$$%67F(WEL"<<					!			*fl3 
  
	 s+   B!D<$	D<.AD<D(
D<(D9	3	D<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               $    V ^8  d   QhRRRRRR/# )r7   asyncio_markerr   rc  r[  r:   r'   )r<   s   "r/   r=   r=     s$      .8r.   c           	     >   V P                   pR q2V8H  qD'       g   \        P                  ! RV3RW#34      RR\        P                  ! 4       9   g   \        P
                  ! V 4      '       d   \        P                  ! V 4      MRR\        P                  ! V4      R\        P                  ! V4      /,          pRRV/,          p\        \        P                  ! V4      4      hR;p;rCV 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	4      pVf   Tp0 RmqV9   q"'       g   \        P                  ! RV3RWx34      RR	\        P                  ! 4       9   g   \        P
                  ! V4      '       d   \        P                  ! V4      MR	R\        P                  ! V4      /,          p	RRV	/,          p\        \        P                  ! V4      4      hR;r(V# )r?   r  r  r  r  r  r  NrW   rV   z:mark.asyncio accepts only a keyword argument 'loop_scope'.r^  r_  r&  )z,%(py2)s
{%(py2)s = %(py0)s.name
} == %(py5)s>   classmodulepackager!   rO   )in)z%(py0)s in %(py3)s)r[   r+  r1  r)  r*  r,  r-  r.  r/  r   rk   r  r   rs   r   &_DUPLICATE_LOOP_SCOPE_DEFINITION_ERRORr   r   r   '_MARKER_SCOPE_KWARG_DEPRECATION_WARNINGr  )
r  rc  r5  r9  r6  r:  r;  rV   ra  rb  s
   &&        r/   r`  r`    s    +)+)+++++++++++>++++>++++++)++++++++#n&;&;"<g?V"V"VUVV.'''>000##$JKK./VWX!!%%l3  ~7L7L7P7P8E }"IIIIIIII5IIIIII5IIII5IIIIIIIIIIIILr.   c                    V ^8  d   QhRRRR/# )r7   r   r   r:   r   r'   )r<   s   "r/   r=   r=     s     < < <C <r.   c                $    V P                  R 4      # )rN   )r   )r   s   &r/   r   r     s    ==:;;r.   a  An exception occurred during teardown of an asyncio.Runner. The reason is likely that you closed the underlying event loop in a test, which prevents the cleanup of asynchronous generators by the runner.
This warning will become an error in future versions of pytest-asyncio. Please ensure that your tests don't close the event loop. Here is the traceback of the exception triggered during teardown:
%s
c                    V ^8  d   QhRRRR/# )r7   rV   r[  r:   r   r'   )r<   s   "r/   r=   r=     s        r.   c                P    \         P                  ! V R V  R2R7      R R l4       pV# )rG  rH  )rV   r[   c                    V ^8  d   QhRRRR/# )r7   r   r   r:   zIterator[Runner]r'   )r<   s   "r/   r=   3_create_scoped_runner_fixture.<locals>.__annotate__  s       
r.   c           
   3    "   T p\        VP                  4      p\        V4      ;_uu_ 4        \        VR 7      P	                  4       p Vx  \
        P                  ! 4       ;_uu_ 4        \
        P                  ! RR\        4        VP                  RRR4       RRR4       RRR4       R#   \         d=    \
        P                  ! \        \        P                  ! 4       ,          \        4        LXi ; i  + '       g   i     Ld; i  \         d0   pTP                  \!        T4      YUP"                  4        Rp?LRp?ii ; i  + '       g   i     R# ; i5i))r   r  z$.*BaseEventLoop.shutdown_asyncgens.*N)r   r   r  r   	__enter__r   r  filterwarningsRuntimeWarning__exit__r  r   _RUNNER_TEARDOWN_WARNING	traceback
format_exc	ExceptionrK   __traceback__)event_loop_policyr   new_loop_policy
debug_moder   r   s   &&    r/   rH  5_create_scoped_runner_fixture.<locals>._scoped_runner  s      ,'7
)/::*-779F ,,..++ "H.dD9 / ;: (  4y7K7K7MM* /.  =QOO<<=	 ;::s}   +EE	D
E*C7	B-E#
E-AC41C7	3C44C7	7DE
E%D?:E?EEE		E)rs   rg   )rV   rH  s   & r/   _create_scoped_runner_fixturer    s4    ^^~&	2 r.   rG  rH  )rV   rY   c                   V ^8  d   QhRR/# r  r'   )r<   s   "r/   r=   r=   B  s     $ $2 $r.   c                     \        4       # )zDReturn an instance of the policy used to create asyncio event loops.)r  r'   r.   r/   r  r  A  s     "##r.   c                    V ^8  d   QhRRRR/# )r7   r
  r   r:   zTypeIs[PytestAsyncioFunction]r'   )r<   s   "r/   r=   r=   G  s     3 3 3!> 3r.   c                "    \        V \        4      # )z4Returns whether a test item is a pytest-asyncio test)r   r  rC  s   &r/   r  r  G  s    d122r.   c                    V ^8  d   QhRRRR/# )r7   socket_typeintr:   r'   )r<   s   "r/   r=   r=   L  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.)rK   N)z	127.0.0.1    )
contextlibclosingsocketbindgetsockname)r  socks   & r/   _unused_portr  L  sK    			FMM{;	<	<		"#!!$ 
=	<	<	<s   (A''A8	c                   V ^8  d   QhRR/# r7   r:   r  r'   )r<   s   "r/   r=   r=   T  s     , , ,r.   c                 4    \        \        P                  4      # re   )r  r  SOCK_STREAMr'   r.   r/   unused_tcp_portr  S  s    **++r.   c                   V ^8  d   QhRR/# r  r'   )r<   s   "r/   r=   r=   Y  s     + + +r.   c                 4    \        \        P                  4      # re   )r  r  
SOCK_DGRAMr'   r.   r/   unused_udp_portr  X  s    ))**r.   )rV   c                   V ^8  d   QhRR/# r7   r:   zCallable[[], int]r'   )r<   s   "r/   r=   r=   ^        !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.)r  r  r  addportproduceds    r/   factory(unused_tcp_port_factory.<locals>.factoryb  s<    F../h 2 23DTr.   r  r)  r(  s    @r/   unused_tcp_port_factoryr-  ]       uH	 Nr.   c                   V ^8  d   QhRR/# r   r'   )r<   s   "r/   r=   r=   q  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 # r$  )r  r  r  r%  r&  s    r/   r)  (unused_udp_port_factory.<locals>.factoryu  s<    F--.h 1 12DTr.   r+  r,  s    @r/   unused_udp_port_factoryr3  p  r.  r.   )      )r4     )r!   r  r  r  rO   ).)NNre   )yr,   
__future__r   builtinsr)  _pytest.assertion.rewrite	assertionrewriter+  r?   r  r   enumrt   r   r  sysr  r   r   r   collections.abcr   r   r   r   r   r	   r
   typesr   r   typingr   r   r   r   r   pluggyrs   _pytest.fixturesr   _pytest.scoper   r   r   r   r   r   r   r   r   r   r   r   version_infor   backports.asyncio.runnerr    typing_extensionsr[  r"   r$   FixtureFunctionr  r&   r   Enumr1   rR   rU   rg   r~   rr   r   r   r   r   r   r   hookimplr   r   r   r   r   r   r   r   r   r  rq  ry  r  r  r  contextmanagerr  r  r  r  r  r  rS  r  r  r  r`  r   r  r  rV   r   globalsr  r  r  r  r  r-  r3  r'   r.   r/   <module>rL     s   $ "          
   >   4    5     w/w(HI
T3-*<<=t_2r6"= =3		 
 &R 
" ?B" %(	"
 '*" " 	" " 
"  
G ?BG %(	G
 '*G G 	G G 
G *9
!O
% !
  $  "
 ""9: "#=> +%\ 34  !9: !"H@SH Sl1% 1* ,
- 
1/ 1@ 54H#6 I#6L " "/.,% $D1) 2)X$  2* &
+ '*< B E1N2GI%++n-.  i.$ /$
3
% , , + + i  !$ i  !r.   