+
    ÄD©iJ4  ã                  óð  € 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   "Ú1/usr/lib/python3/dist-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)z�Return 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Ð*Ð P°3Ð 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¬   € ð^ ÐßßØ—y‘y¤¨£Ó0ˆHÜØGÈÀzØ5ð6óð ô Ð/ÈTÔRÐRà�A�wˆÜ˜�~Š~Ü˜t™h o´d¸4³j°\Ð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ñ 7 Tð 7°dñ 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   € ð �z‰zÐ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   € à�z‰z˜!�}Ð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   € ä�D—J‘JÓÐ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)z©Pop 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­   € ð
  $ˆÜ˜dŸj™jÖ)‰DˆAØ�z‰z˜SÔ Ø—z‘z—~‘~ aÓ(Ò(Ü˜!Ÿ*™* c×*Ô*ØÒ Ü! !§*¡*¨d¯j©j¸Õ.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   ø€ Ø�=�=ˆ=Ø $ÐÜ ¨t©h°fÐ=Ó>Ð>Ü‘Ñ!Ó#ˆàÒ Ð Ð ØŒ
Ü×Ò˜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   ø€ ð �}�}ˆ}Ø $ÐÜ ¨d©XÐ5LÐ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`   ø† ñ
ð7¨E÷ 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Ø�O‰O˜tÐ#×WÐW¤r§y¢y°·±Ä#ÀgÇoÁoÓBVÓ'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$   ø€ Ü¹Ó>¹¨vŸNœN¹Ñ>À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%   øé € ÐSÉdÈ”z !§*¡*¨d×.CÑ.C×DÐDËdùs   ƒ-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à Ðð ÒÜ˜7¤I×.Ò.ä˜'¤4×(Ò(á÷	Jð 	Jð2	ß“3ÔSÉdÓS—3—3’3ÔSÉdÓS×SÒSÜØ8¸×9NÑ9NÐ8Oð P*Ù*3«+¨°að9õ÷ “SÔ7±$Ó7—S—S’SÔ7±$Ó7×7Ò7ÜØ8¸×9NÑ9NÐ8Oð PØ#Ÿ™Ð/ð 0*Ù*3«+¨°að9ôó �Ø—|‘| A—”Ü×*Ò*Ø !§	¡	Ø!"§¡Ø!"§¡Ø Ÿx™xØ Ÿ|™|Ø Ÿx™x÷ñ ó& �Ü˜Ÿ	™	“?¬+Ó5ñ Ø—y‘y—~—~�~áØ—i‘i—n‘n QÕ'�Ü˜c¤3×'Ò'Ùô  Ø:¸3¹'ÀÌÈcË×I[ÑI[ÐH\Ð\]Ð^óð ó øó' �Ø—|‘| A—”Ü×*Ò*Ø !§	¡	Ø!"§¡Ø!"§¡Ø Ÿx™xØ Ÿ|™|Ø Ÿx™x÷ñ ó& �Ü˜Ÿ	™	“?¬+Ó5ñ Ø—y‘y—~—~�~áØ—i‘i—n‘n QÕ'�Ü˜c¤3×'Ò'Ùô  Ø:¸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å "å $Ý %Ý $Ý Û 	Ý Ý Ý Ý Ý  Ý ÷ Ý&ã å -Ý $Ý !Ý !ñ ˆCƒL€ð 	ôó 	ðð 
ðØ-0öó 
ðð
 
Ü Pó 
Ø P÷ðD 
ñð +.÷ó 
ðð 
ôó 
ðð CJñ=-ð +/÷=-ð =-ô@V�x×.Ñ.ô Vðr ôkÐ&ó kó òkr   