+
    yj3                       R 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 ^ 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)pformatN)TracebackType)Any)Callable)final)	Generator)Iterator)overload)Pattern)TYPE_CHECKING)TypeVar)Self)check_ispytest)fixture)Exit)failTc                   V ^8  d   QhRR/# )   returnz'Generator[WarningsRecorder, None, None] )formats   "C/var/www/html/2rare/lib/python3.14/site-packages/_pytest/recwarn.py__annotate__r   #   s     	 	8 	    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 https://docs.pytest.org/en/latest/how-to/capture-warnings.html 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 | Pattern[str] | Noner   r    r   )r   s   "r   r   r   0   s     W W7 WBR Wr   c                    R # Nr   )r%   s   $r   deprecated_callr*   /   s    TWr   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   )r9   r%   s   &$r   r3   r3   Y   s    
 r   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r9   r:   r,   r-   r.   r   r/   r   r   r   )r   s   "r   r   r   b   s:      ?
  	
 r   c                    R # r)   r   )r9   r,   r.   r/   s   &&*,r   r3   r3   a   s     	r   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r9   r:   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)r9   r%   r.   r/   r7   argnamesr,   s   &$*,   r   r3   r3   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   rQ   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   rM      s      3 r   c                    V P                   # )zThe list of recorded warnings.rS   rT   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   rM      s      S %< r   c                (    V P                   V,          # )z Get a recorded warning by index.rY   )rT   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   rM      s        ;  r   c                ,    \        V P                  4      # )z&Iterate through the recorded warnings.)iterrS   rZ   s   &r   __iter__WarningsRecorder.__iter__   s    DJJr   c                   V ^8  d   QhRR/# )r   r   r_   r   )r   s   "r   r   rM      s       r   c                ,    \        V P                  4      # )z The number of recorded warnings.)lenrS   rZ   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   rM      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)	enumeraterS   categorypop
issubclassAssertionError)rT   ro   best_idxr^   wr7   s   &&    r   rs   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   rL   r   )r   s   "r   r   rM      s      t r   c                $    . V P                   R&   R# )z$Clear the list of recorded warnings.:NNNNrY   rZ   s   &r   clearWarningsRecorder.clear   s    

1r   c                   V ^8  d   QhRR/# )r   r   r   r   )r   s   "r   r   rM      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)rR   RuntimeErrorrP   	__enter__rS   r!   r"   )rT   r7   rS   rU   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   rL   r   )r   s   "r   r   rM      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)rR   r   rP   __exit__)rT   r   r   r   r7   rU   s   &&&& r   r   WarningsRecorder.__exit__   sA     }}} $dX5LMNNF3 r   )rR   rS   )__name__
__module____qualname____firstlineno____doc__rQ   propertyr[   rb   rg   rl   Warningrs   r{   r   r   __static_attributes____classcell__rU   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   r9   r:   rA   r'   r   rK   r   rL   r   )r   s   "r   r   WarningsChecker.__annotate__  s2     % %C% .%
 % 
%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   rP   rQ   
isinstancetuplert   r   rE   rG   r9   rA   )rT   r9   rA   r   msgexcexpected_warning_tuprU   s   &&&$   r   rQ   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   rK   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)   )	r9   rt   rr   rK   rA   researchstrmessage)rT   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__8  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   )rO   rT   s    r   	found_str+WarningsChecker.__exit__.<locals>.found_str8  s$    >vNN>qII>s   (c              3  d   <"   T F%  p\        VP                  SP                  4      x  K'  	  R # 5ir)   )rt   rr   r9   .0rw   rT   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   A  s     7$Qa$s   !z* matching the regex were emitted.
 Regex: z
 Emitted warnings: )r   rr   filenamelinenomodulesourcez$Warning must be str or Warning, got z (type ))rP   r   r   	Exceptionr   anyr   r9   rA   r   r!   warn_explicitr   rr   r   r   r   r   rG   UserWarningr.   r   rE   r   )	rT   r   r   r   r7   r   rw   r   rU   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)r9   rA   )
r   r   r   r   r   rQ   r   r   r   r   r   s   @r   r;   r;     s2     GN04%
  % %4
J Jr   r;   r)   ).)$r   
__future__r   pprintr   r   typesr   typingr   r   r   r   r	   r
   r   r   r   typing_extensionsr   r!   _pytest.deprecatedr   _pytest.fixturesr   _pytest.outcomesr   r   r   r$   r*   r3   r   catch_warningsr    r;   r   r   r   <module>r      s   5 "  	            &  - $ ! ! CL 		 		 
 W# W 
 W 
 P 
 PD 
 (+ 
 
 
 CJ=- (,=- =-@Tx.. Tn k& k kr   