+
    -jJ4                       R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RI	t	^ RI
Ht ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ]'       d   ^ RIHt ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ]! R4      t]R R l4       t]RR/R R ll4       t]R R l4       tR'R R llt]R(RR/R R lll4       t]R R  l4       t] 3RR/R! R" lllt ! R# R$]PB                  4      t"] ! R% R&]"4      4       t#R# ))z/Record warnings during test function execution.)annotations)Callable)	Generator)Iterator)pformatN)TracebackType)Any)final)overload)TYPE_CHECKING)TypeVar)Self)check_ispytest)fixture)Exit)failTc                   V ^8  d   QhRR/# )   returnzGenerator[WarningsRecorder] )formats   "d/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/_pytest/recwarn.py__annotate__r   "   s      ,     c               #     "   \        RR7      p V ;_uu_ 4        \        P                  ! R4       V x  RRR4       R#   + '       g   i     R# ; i5i)zReturn a :class:`WarningsRecorder` instance that records all warnings emitted by test functions.

See :ref:`warnings` for information on warning categories.
T	_ispytestdefaultN)WarningsRecorderwarningssimplefilter)wrecs    r   recwarnr#   !   s4      d+D	i(
 
s   A>
AA			Amatch.c                    V ^8  d   QhRRRR/# )r   r$   str | re.Pattern[str] | Noner   r   r   )r   s   "r   r   r   .   s      *r   c                    R # Nr   )r$   s   $r   deprecated_callr)   -   s     r   c               (    V ^8  d   QhRRRRRRRR/# )r   funcCallable[..., T]argsr   kwargsr   r   r   )r   s   "r   r   r   4   s     P P* P3 P# P! Pr   c                    R # r(   r   )r+   r-   r.   s   &*,r   r)   r)   3   s    MPr   c               (    V ^8  d   QhRRRRRRRR/# )r   r+   zCallable[..., Any] | Noner-   r   r.   r   zWarningsRecorder | Anyr   )r   s   "r   r   r   7   s,      
#36BEr   c                V    RpV e   V .VO5p\        \        \        \        3.VO5/ VB # )ae  Assert that code produces a ``DeprecationWarning`` or ``PendingDeprecationWarning`` or ``FutureWarning``.

This function can be used as a context manager::

    >>> import warnings
    >>> def api_call_v2():
    ...     warnings.warn('use v3 of this api', DeprecationWarning)
    ...     return 200

    >>> import pytest
    >>> with pytest.deprecated_call():
    ...    assert api_call_v2() == 200

It can also be used by passing a function and ``*args`` and ``**kwargs``,
in which case it will ensure calling ``func(*args, **kwargs)`` produces one of
the warnings types above. The return value is the return value of the function.

In the context manager form you may use the keyword argument ``match`` to assert
that the warning matches a text or regex.

The context manager produces a list of :class:`warnings.WarningMessage` objects,
one for each warning raised.
T)warnsDeprecationWarningPendingDeprecationWarningFutureWarning)r+   r-   r.   __tracebackhide__s   &*, r   r)   r)   7   sC    4 }t}	6FIMQW r   c               $    V ^8  d   QhRRRRRR/# )r   expected_warning)type[Warning] | tuple[type[Warning], ...]r$   r&   r   WarningsCheckerr   )r   s   "r   r   r   Z   s(      ? ( 	r   c                   R # r(   r   )r8   r$   s   &$r   r2   r2   Y   s    
 r   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r8   r9   r+   r,   r-   r   r.   r   r   r   )r   s   "r   r   r   b   s:      ?
  	
 r   c                    R # r(   r   )r8   r+   r-   r.   s   &&*,r   r2   r2   a   s     	r   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r8   r9   r-   r   r$   r&   r.   r   zWarningsChecker | Anyr   )r   s   "r   r   r   j   s:     =- =-?=-=- (=- 	=-
 =-r   c                  RpV'       g?   V'       d*   RP                  \        V4      4      p\        RV R24      h\        WRR7      # V^ ,          p\	        V4      '       g   \        V: R\        V4       R24      h\        V RR7      ;_uu_ 4        V! VR	,          / VB uuR
R
R
4       #   + '       g   i     R
# ; i)a  Assert that code raises a particular class of warning.

Specifically, the parameter ``expected_warning`` can be a warning class or tuple
of warning classes, and the code inside the ``with`` block must issue at least one
warning of that class or classes.

This helper produces a list of :class:`warnings.WarningMessage` objects, one for
each warning emitted (regardless of whether it is an ``expected_warning`` or not).
Since pytest 8.0, unmatched warnings are also re-emitted when the context closes.

This function can be used as a context manager::

    >>> import pytest
    >>> with pytest.warns(RuntimeWarning):
    ...    warnings.warn("my warning", RuntimeWarning)

In the context manager form you may use the keyword argument ``match`` to assert
that the warning matches a text or regex::

    >>> with pytest.warns(UserWarning, match='must be 0 or None'):
    ...     warnings.warn("value must be 0 or None", UserWarning)

    >>> with pytest.warns(UserWarning, match=r'must be \d+$'):
    ...     warnings.warn("value must be 42", UserWarning)

    >>> with pytest.warns(UserWarning):  # catch re-emitted warning
    ...     with pytest.warns(UserWarning, match=r'must be \d+$'):
    ...         warnings.warn("this is not here", UserWarning)
    Traceback (most recent call last):
      ...
    Failed: DID NOT WARN. No warnings of type ...UserWarning... were emitted...

**Using with** ``pytest.mark.parametrize``

When using :ref:`pytest.mark.parametrize ref` it is possible to parametrize tests
such that some runs raise a warning and others do not.

This could be achieved in the same way as with exceptions, see
:ref:`parametrizing_conditional_raising` for an example.

Tz, z5Unexpected keyword arguments passed to pytest.warns: z"
Use context-manager form instead?)
match_exprr   z object (type: z) must be callabler   :   NNN)joinsorted	TypeErrorr:   callabletype)r8   r$   r-   r.   r6   argnamesr+   s   &$*,   r   r2   r2   j   s    ^ yy0HGz56  /TRRAw~~thod4j\ASTUU->>b,V, ?>>>s   B--B>	c                     a  ] tR t^tRtRR/R V 3R lllt]R R l4       tR R	 ltR
 R lt	R R lt
]3R R lltR R ltR V 3R lltR V 3R lltRtV ;t# )r   a.  A context manager to record raised warnings.

Each recorded warning is an instance of :class:`warnings.WarningMessage`.

Adapted from `warnings.catch_warnings`.

.. note::
    ``DeprecationWarning`` and ``PendingDeprecationWarning`` are treated
    differently; see :ref:`ensuring_function_triggers`.

r   Fc                    V ^8  d   QhRRRR/# )r   r   boolr   Noner   )r   s   "r   r   WarningsRecorder.__annotate__   s     7 7T 7d 7r   c               	Z   < \        V4       \        SV `	  R R7       RV n        . V n        R# )T)recordFN)r   super__init___entered_list)selfr   	__class__s   &$r   rP   WarningsRecorder.__init__   s)    y!%46
r   c                   V ^8  d   QhRR/# )r   r   zlist[warnings.WarningMessage]r   )r   s   "r   r   rL      s      3 r   c                    V P                   # )zThe list of recorded warnings.rR   rS   s   &r   listWarningsRecorder.list   s     zzr   c                    V ^8  d   QhRRRR/# )r   iintr   warnings.WarningMessager   )r   s   "r   r   rL      s      S %< r   c                (    V P                   V,          # )z Get a recorded warning by index.rX   )rS   r]   s   &&r   __getitem__WarningsRecorder.__getitem__   s    zz!}r   c                   V ^8  d   QhRR/# )r   r   z!Iterator[warnings.WarningMessage]r   )r   s   "r   r   rL      s        ;  r   c                ,    \        V P                  4      # )z&Iterate through the recorded warnings.)iterrR   rY   s   &r   __iter__WarningsRecorder.__iter__   s    DJJr   c                   V ^8  d   QhRR/# )r   r   r^   r   )r   s   "r   r   rL      s       r   c                ,    \        V P                  4      # )z The number of recorded warnings.)lenrR   rY   s   &r   __len__WarningsRecorder.__len__   s    4::r   c                    V ^8  d   QhRRRR/# )r   clsztype[Warning]r   r_   r   )r   s   "r   r   rL      s     C C} C3J Cr   c                   Rp\        V P                  4       F  w  r4VP                  V8X  d   V P                  P                  V4      u # \	        VP                  V4      '       g   KQ  Ve:   \	        VP                  V P                  V,          P                  4      '       d   K  TpK  	  Ve   V P                  P                  V4      # Rp\        V: R24      h)zPop the first recorded warning which is an instance of ``cls``,
but not an instance of a child class of any other match.
Raises ``AssertionError`` if there is no match.
NTz not found in warning list)	enumeraterR   categorypop
issubclassAssertionError)rS   rn   best_idxr]   wr6   s   &&    r   rr   WarningsRecorder.pop   s    
  $djj)DAzzS zz~~a((!**c** !!**djj.B.K.KLL * ::>>(++ w&@ABBr   c                   V ^8  d   QhRR/# )r   r   rK   r   )r   s   "r   r   rL      s      t r   c                $    . V P                   R&   R# )z$Clear the list of recorded warnings.:NNNNrX   rY   s   &r   clearWarningsRecorder.clear   s    

1r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   rL      s     	 	4 	r   c                	   < V P                   '       d   R p\        RV : R24      h\        SV `  4       pVf   Q hW n        \
        P                  ! R4       V # )TzCannot enter z twicealways)rQ   RuntimeErrorrO   	__enter__rR   r    r!   )rS   r6   rR   rT   s   &  r   r   WarningsRecorder.__enter__   sW    === $thf=>>!#   
h'r   c               (    V ^8  d   QhRRRRRRRR/# 	r   exc_typeztype[BaseException] | Noneexc_valzBaseException | Noneexc_tbzTracebackType | Noner   rK   r   )r   s   "r   r   rL      s2      , & %	
 
r   c                	~   < V P                   '       g   R p\        RV : R24      h\        SV `  WV4       RV n         R# )TzCannot exit z without entering firstFN)rQ   r   rO   __exit__)rS   r   r   r   r6   rT   s   &&&& r   r   WarningsRecorder.__exit__   sA     }}} $dX5LMNNF3 r   )rQ   rR   )__name__
__module____qualname____firstlineno____doc__rP   propertyrZ   ra   rf   rk   Warningrr   rz   r   r   __static_attributes____classcell__rT   s   @r   r   r      s`    
7E 7 7    (/ C&	 	 r   r   c                  \   a  ] tR tRt]R3RR/R V 3R lllltR R ltR	 V 3R
 lltRtV ;t	# )r:   i  Nr   Fc               (    V ^8  d   QhRRRRRRRR/# )	r   r8   r9   r@   r&   r   rJ   r   rK   r   )r   s   "r   r   WarningsChecker.__annotate__  s2     % %C% 1%
 % 
%r   c               	  < \        V4       \        SV `	  R R7       Rp\        V\        4      '       d>   V F4  p\        V\        4      '       d   K  \        V\        V4      ,          4      h	  TpMK\        V\        4      '       d   \        V\        4      '       d   V3pM\        V\        V4      ,          4      hW`n	        W n
        R# )Tr   z/exceptions must be derived from Warning, not %sN)r   rO   rP   
isinstancetuplers   r   rD   rF   r8   r@   )rS   r8   r@   r   msgexcexpected_warning_tuprT   s   &&&$   r   rP   WarningsChecker.__init__  s     	y!4(?&..'!#w//#C$s)O44 ( $4 ($//Jg5
 5
 %5#6 C$'7"8899 4$r   c                    V ^8  d   QhRRRR/# )r   warningr_   r   rJ   r   )r   s   "r   r   r     s     
 
6 
4 
r   c                	   V P                   f   Q h\        VP                  V P                   4      ;'       dT    \        V P                  R J ;'       g5    \
        P                  ! V P                  \        VP                  4      4      4      # r(   )	r8   rs   rq   rJ   r@   researchstrmessage)rS   r   s   &&r   matchesWarningsChecker.matches  sm    $$000'**D,A,AB 
 
tOOt#WWryy#gooBV'WH
 	
r   c               (    V ^8  d   QhRRRRRRRR/# r   r   )r   s   "r   r   r   %  s8     J J,J &J %	J
 
Jr   c                	  <a  \         SS `  WV4       R pVe/   \        V\        4      '       d   \        V\        4      '       d   R# R V 3R llp \
        ;QJ d    V 3R lS  4       F  '       g   K   R M	  RM! V 3R lS  4       4      '       g#   \        RS P                   RV! 4        R24       Mn\
        ;QJ d    V 3R	 lS  4       F  '       g   K   R M	  RM! V 3R	 lS  4       4      '       g/   \        RS P                   R
S P                   RV! 4        R24       S  Ft  pS P                  V4      '       d   K  \        P                  ! VP                  VP                  VP                  VP                  VP                   VP"                  R7       Kv  	  S  F  p\%        VP                  4      \&        Jd   K"  VP                  P(                  '       g   K@  VP                  P(                  ^ ,          p\        V\*        4      '       d   Ku  \-        RV: R\%        V4      P.                   R24      h	  R#   S  Ft  pS P                  T4      '       d   K  \        P                  ! TP                  TP                  TP                  TP                  TP                   TP"                  R7       Kv  	  S  F  p\%        TP                  4      \&        Jd   K"  TP                  P(                  '       g   K@  TP                  P(                  ^ ,          p\        T\*        4      '       d   Ku  \-        RT: R\%        T4      P.                   R24      h	  i ; i)TNc                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   .WarningsChecker.__exit__.<locals>.__annotate__:  s     	J 	J3 	Jr   c                 Z   < \        S U u. uF  q P                  NK  	  up ^R7      # u up i )r   )indent)r   r   )rN   rS   s    r   	found_str+WarningsChecker.__exit__.<locals>.found_str:  s$    >vNN>qII>s   (c              3  d   <"   T F%  p\        VP                  SP                  4      x  K'  	  R # 5ir(   )rs   rq   r8   .0rv   rS   s   & r   	<genexpr>+WarningsChecker.__exit__.<locals>.<genexpr>>  s%     Sdz!**d.C.CDDds   -0Fz"DID NOT WARN. No warnings of type z" were emitted.
 Emitted warnings: .c              3  F   <"   T F  pSP                  V4      x  K  	  R # 5ir(   )r   r   s   & r   r   r   C  s     7$Qa$s   !z* matching the regex were emitted.
 Regex: z
 Emitted warnings: )r   rq   filenamelinenomodulesourcez$Warning must be str or Warning, got z (type ))rO   r   r   	Exceptionr   anyr   r8   r@   r   r    warn_explicitr   rq   r   r   r   r   rF   UserWarningr-   r   rD   r   )	rS   r   r   r   r6   r   rv   r   rT   s	   f&&&    r   r   WarningsChecker.__exit__%  s    	F3  7I..'4((	J 	J2	3SdS333SdSSS89N9N8O P**3+a9 S7$7SSS7$77789N9N8O P#/ 0**3+a9 ||A** !		!"!" xx || xx & 		?+5 yy~~~iinnQ'c3''  :3'cI[I[H\\]^  ' ||A** !		!"!" xx || xx & 		?+5 yy~~~iinnQ'c3''  :3'cI[I[H\\]^  s>   
H< H< 3H< ,H< >H< H< 3.H< <MBM7A M)r8   r@   )
r   r   r   r   r   rP   r   r   r   r   r   s   @r   r:   r:     s2     GN37%
  % %4
J Jr   r:   r(   ).)$r   
__future__r   collections.abcr   r   r   pprintr   r   typesr   typingr   r	   r
   r   r   typing_extensionsr   r    _pytest.deprecatedr   _pytest.fixturesr   _pytest.outcomesr   r   r   r#   r)   r2   r   catch_warningsr   r:   r   r   r   <module>r      s   5 " $ % $  	        &  - $ ! ! CL 	 	 
-0 

 
 P 
 PD 
 +. 
 
 
 CJ=- +/=- =-@Vx.. Vr k& k kr   