Ë
    ¤ehÜ   ã                   ó  — d Z ddlZddlZddlmZmZ ddlmZ  ej                  e
eeeeeeg¬«      d„ «       Z ej                  e
efeefee
feefeefeefeefeefgd„ ¬«      d„ «       Zd	„ Zej$                  j'                  d
«      d„ «       Zej$                  j+                  dg d¢«      d„ «       Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z ej$                  j+                  dddg«       G d„ d«      «       Z!d„ Z"d„ Z#y)zG"
Test module for testing ``pandas._testing.assert_produces_warning``.
é    N)ÚDtypeWarningÚPerformanceWarning)Úparamsc                 ó   — | j                   S )zx
    Return unique warning.

    Useful for testing behavior of tm.assert_produces_warning with various categories.
    ©Úparam©Úrequests    úl/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/pandas/tests/util/test_assert_produces_warning.pyÚcategoryr      s   € ð" �=‰=Ðó    c                 ó,   — t        | «      j                  S ©N)ÚtypeÚ__name__)Úxs    r   ú<lambda>r   /   s   € ”$�q“'×"Ñ"€ r   )r   Úidsc                 ó   — | j                   S )z’
    Return pair or different warnings.

    Useful for testing how several different warnings are handled
    in tm.assert_produces_warning.
    r   r	   s    r   Úpair_different_warningsr   $   s   € ð( �=‰=Ðr   c                  ól   — t        j                  dt        «       t        j                  dt        «       y )NÚf1Úf2)ÚwarningsÚwarnÚFutureWarningÚRuntimeWarning© r   r   Úfr   ;   s   € Ü‡M�M�$œÔ&Ü‡M�M�$œÕ'r   zignore:f1:FutureWarningc                  óL  — d} t        j                  t        | ¬«      5  t        j                  t
        «      5  t        «        d d d «       d d d «       t        j                  t
        d¬«      5  t        «        d d d «       y # 1 sw Y   Œ@xY w# 1 sw Y   ŒDxY w# 1 sw Y   y xY w)NúCaused unexpected warning\(s\)©ÚmatchF©Úraise_on_extra_warnings)ÚpytestÚraisesÚAssertionErrorÚtmÚassert_produces_warningr   r   ©Úmsgs    r   Ú*test_assert_produces_warning_honors_filterr-   @   s…   € ð ,€CÜ	�‰”~¨SÔ	1ñ Ü×'Ñ'¬Ó7ñ 	ÜŒC÷	÷ô 
×	#Ñ	#¤NÈEÔ	Rñ Ü	Œ÷ð ÷	ð 	ú÷ð ú÷ð ús.   žB¸BÁBÁ.BÂB	ÂBÂBÂB#zmessage, match))Ú N)r.   r.   )úWarning messagez.*)r/   ÚWar)r/   z
[Ww]arning)r/   Úage)r/   zage$)úMessage 12-234 with numbersz\d{2}-\d{3})r2   z^Mes.*\d{2}-\d{3})r2   z\d{2}-\d{3}\s\S+)zMessage, which we do not matchNc                 óˆ   — t        j                  | |¬«      5  t        j                  || «       d d d «       y # 1 sw Y   y xY w)Nr"   ©r)   r*   r   r   )r   Úmessager#   s      r   Ú%test_catch_warning_category_and_matchr6   L   s7   € ô" 
×	#Ñ	# H°EÔ	:ñ )Ü�‰�g˜xÔ(÷)÷ )ñ )ús	   ˜8¸Ac                  ó(  — t         } d}d}t        j                  t        |¬«      5  t	        j
                  | |¬«      5  t        j                  d| «       t        j                  d| «       d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   y xY w)NzDid not see this warningzÇDid not see warning 'RuntimeWarning' matching 'Did not see this warning'. The emitted warning messages are \[RuntimeWarning\('This is not a match.'\), RuntimeWarning\('Another unmatched warning.'\)\]r"   úThis is not a match.úAnother unmatched warning.)r   r&   r'   r(   r)   r*   r   r   ©r   r#   Ú	unmatcheds      r   Ú"test_fail_to_match_runtime_warningr<   a   sŒ   € Ü€HØ&€Eð	<ð ô 
�‰”~¨YÔ	7ñ BÜ×'Ñ'¨¸Ô>ñ 	BÜ�M‰MÐ0°(Ô;Ü�M‰MÐ6¸ÔA÷	B÷Bð B÷	Bð 	Bú÷Bð Búó"   ¦B¾-A<Á+BÁ<B	ÂBÂBc                  ó(  — t         } d}d}t        j                  t        |¬«      5  t	        j
                  | |¬«      5  t        j                  d| «       t        j                  d| «       d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   y xY w)NÚWarningz³Did not see warning 'FutureWarning' matching 'Warning'. The emitted warning messages are \[FutureWarning\('This is not a match.'\), FutureWarning\('Another unmatched warning.'\)\]r"   r8   r9   )r   r&   r'   r(   r)   r*   r   r   r:   s      r   Ú!test_fail_to_match_future_warningr@   p   sŒ   € Ü€HØ€Eð	;ð ô 
�‰”~¨YÔ	7ñ BÜ×'Ñ'¨¸Ô>ñ 	BÜ�M‰MÐ0°(Ô;Ü�M‰MÐ6¸ÔA÷	B÷Bð B÷	Bð 	Bú÷Bð Búr=   c                  ó(  — t         } d}d}t        j                  t        |¬«      5  t	        j
                  | |¬«      5  t        j                  d| «       t        j                  d| «       d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   y xY w)Nz\d+z·Did not see warning 'ResourceWarning' matching '\\d\+'. The emitted warning messages are \[ResourceWarning\('This is not a match.'\), ResourceWarning\('Another unmatched warning.'\)\]r"   r8   r9   )ÚResourceWarningr&   r'   r(   r)   r*   r   r   r:   s      r   Ú#test_fail_to_match_resource_warningrC      sŒ   € Ü€HØ€Eð	=ð ô 
�‰”~¨YÔ	7ñ BÜ×'Ñ'¨¸Ô>ñ 	BÜ�M‰MÐ0°(Ô;Ü�M‰MÐ6¸ÔA÷	B÷Bð B÷	Bð 	Bú÷Bð Búr=   c                 óò   — | \  }}d}t        j                  t        |¬«      5  t        j                  |«      5  t        j                  d|«       d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   y xY w)Nz%Did not see expected warning of classr"   zwarning message©r&   r'   r(   r)   r*   r   r   )r   Úexpected_categoryÚactual_categoryr#   s       r   Ú!test_fail_to_catch_actual_warningrH   Ž   sm   € Ø)@Ñ&Ð�Ø3€EÜ	�‰”~¨UÔ	3ñ >Ü×'Ñ'Ð(9Ó:ñ 	>Ü�M‰MÐ+¨_Ô=÷	>÷>ð >÷	>ð 	>ú÷>ð >ús"   £A-¹A!ÁA-Á!A*	Á&A-Á-A6c                 ó¾   — | \  }}t        j                  |d¬«      5  t        j                  d|«       t        j                  d|«       d d d «       y # 1 sw Y   y xY w)NFr$   úExpected warningzUnexpected warning OKr4   )r   rF   Úextra_categorys      r   Útest_ignore_extra_warningrL   –   sR   € Ø(?Ñ%Ð�~Ü	×	#Ñ	#Ð$5ÈuÔ	Uñ ?Ü�‰Ð(Ð*;Ô<Ü�‰Ð-¨~Ô>÷?÷ ?ñ ?ús   �-AÁAc                 ó  — | \  }}d}t        j                  t        |¬«      5  t        j                  |«      5  t        j                  d|«       t        j                  d|«       d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   y xY w)Nr!   r"   rJ   zUnexpected warning NOT OKrE   )r   rF   rK   r#   s       r   Útest_raise_on_extra_warningrN   �   s†   € Ø(?Ñ%Ð�~Ø-€EÜ	�‰”~¨UÔ	3ñ GÜ×'Ñ'Ð(9Ó:ñ 	GÜ�M‰MÐ,Ð.?Ô@Ü�M‰MÐ5°~ÔF÷	G÷Gð G÷	Gð 	Gú÷Gð Gús"   £B¹-A7Á&BÁ7B 	Á<BÂBc                  óì   — t         } t        j                  | d¬«      5  t        j                  d| «       t        j                  d| «       t        j                  d| «       d d d «       y # 1 sw Y   y xY w)Nú^Match thisr"   ú
Match thisúDo not match thatúDo not match that either)ÚUserWarningr)   r*   r   r   ©r   s    r   Ú1test_same_category_different_messages_first_matchrV   ¦   sX   € Ü€HÜ	×	#Ñ	# H°NÔ	Cñ <Ü�‰�l HÔ-Ü�‰Ð)¨8Ô4Ü�‰Ð0°(Ô;÷<÷ <ñ <úó   žAA*Á*A3c                  óì   — t         } t        j                  | d¬«      5  t        j                  d| «       t        j                  d| «       t        j                  d| «       d d d «       y # 1 sw Y   y xY w)NrP   r"   rR   rS   rQ   )ÚDeprecationWarningr)   r*   r   r   rU   s    r   Ú0test_same_category_different_messages_last_matchrZ   ®   sX   € Ü!€HÜ	×	#Ñ	# H°NÔ	Cñ .Ü�‰Ð)¨8Ô4Ü�‰Ð0°(Ô;Ü�‰�l HÔ-÷.÷ .ñ .úrW   c                  óÜ   — t         t        f} t        j                  | d¬«      5  t	        j
                  dt         «       t	        j
                  dt        «       d d d «       y # 1 sw Y   y xY w)NrP   r"   rQ   zMatch this too)r   rT   r)   r*   r   r   rU   s    r   Útest_match_multiple_warningsr\   ¶   sN   € äœ{Ð+€HÜ	×	#Ñ	# H°NÔ	Cñ 5Ü�‰�l¤MÔ2Ü�‰Ð&¬Ô4÷5÷ 5ñ 5ús   ¤5A"Á"A+c                 ó  — | \  }}t        j                  t        d¬«      5  t        j                  |d¬«      5  t        j                  d|«       t        j                  d|«       d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   y xY w)NzDid not see warning.*matchingr"   rP   zDo not match itrQ   rE   )r   Útarget_categoryÚother_categorys      r   Ú&test_right_category_wrong_match_raisesr`   ¾   sw   € Ø&=Ñ#€O�^Ü	�‰”~Ð-LÔ	Mñ 8Ü×'Ñ'¨¸~ÔNñ 	8Ü�M‰MÐ+¨_Ô=Ü�M‰M˜,¨Ô7÷	8÷8ð 8÷	8ð 	8ú÷8ð 8ús"   ¡B¹-A7Á&BÁ7B 	Á<BÂBÚfalse_or_noneFc                   ó   — e Zd Zd„ Zd„ Zd„ Zy)ÚTestFalseOrNoneExpectedWarningc                 óÐ   — d}t        j                  t        |¬«      5  t        j                  |«      5  t        «        d d d «       d d d «       y # 1 sw Y   ŒxY w# 1 sw Y   y xY w)Nr!   r"   )r&   r'   r(   r)   r*   r   )Úselfra   r,   s      r   Útest_raise_on_warningz4TestFalseOrNoneExpectedWarning.test_raise_on_warningÈ   sW   € Ø/ˆÜ�]‰]œ>°Ô5ñ 	Ü×+Ñ+¨MÓ:ñ Ü”÷÷	ð 	÷ð ú÷	ð 	ús!   žA´A¿AÁA	ÁAÁA%c                 óZ   — t        j                  |«      5  	 d d d «       y # 1 sw Y   y xY wr   )r)   r*   ©re   ra   s     r   Útest_no_raise_without_warningz<TestFalseOrNoneExpectedWarning.test_no_raise_without_warningÎ   s(   € Ü×'Ñ'¨Ó6ñ 	Ø÷	÷ 	ñ 	ús   –!¡*c                 óp   — t        j                  |d¬«      5  t        «        d d d «       y # 1 sw Y   y xY w)NFr$   )r)   r*   r   rh   s     r   Ú'test_no_raise_with_false_raise_on_extrazFTestFalseOrNoneExpectedWarning.test_no_raise_with_false_raise_on_extraÒ   s,   € Ü×'Ñ'¨ÈuÔUñ 	ÜŒC÷	÷ 	ñ 	ús   ˜,¬5N)r   Ú
__module__Ú__qualname__rf   ri   rk   r   r   r   rc   rc   Æ   s   „ òòór   rc   c                  óž  — d} t        j                  t        | ¬«      5  t        j                  t
        «      5  t        ‚# 1 sw Y   nxY w	 d d d «       n# 1 sw Y   nxY wt        j                  t        | ¬«      5  t        j                  t
        «      5  t        j                  dt        «       t        ‚# 1 sw Y   nxY w	 d d d «       n# 1 sw Y   nxY wd} t        j                  t        | ¬«      5  t        j                  d «      5  t        j                  dt        «       t        ‚# 1 sw Y   nxY w	 d d d «       y # 1 sw Y   y xY w)Nz3Did not see expected warning of class 'UserWarning'r"   r   zCaused unexpected warning)r&   r'   r(   r)   r*   rT   Ú
ValueErrorr   r   r   Ú
IndexErrorÚSystemErrorr+   s    r   Útest_raises_during_exceptionrr   ×   s  € Ø
?€CÜ	�‰”~¨SÔ	1ñ Ü×'Ñ'¬Ó4ñ 	ÜÐ÷	ð 	úð 	÷÷ ñ úô 
�‰”~¨SÔ	1ñ Ü×'Ñ'¬Ó4ñ 	Ü�M‰M˜/¬=Ô9ÜÐ÷	ð 	úð 	÷÷ ñ úð
 &€CÜ	�‰”~¨SÔ	1ñ Ü×'Ñ'¨Ó-ñ 	Ü�M‰M˜/¬=Ô9ÜÐ÷	ð 	úð 	÷÷ ñ úsV   žA¸?¿A	ÁAÁAÁ<CÂ!B7Â7C 	Â<CÃCÃ6EÄ!D-Ä-D6	Ä2EÅEc                  ó¾  — t        j                  t        d¬«      5  t        j                  d «      5  t        d«      ‚# 1 sw Y   nxY w	 d d d «       n# 1 sw Y   nxY wt        j                  t
        d¬«      5  t        j                  t        d¬«      5  t        j                  dt        «       t        d«      ‚# 1 sw Y   nxY w	 d d d «       y # 1 sw Y   y xY w)NÚErrorr"   r   )	r&   r'   ÚSyntaxErrorr)   r*   ro   r   r   r   r   r   r   Útest_passes_during_exceptionrv   é   s¶   € Ü	�‰”{¨'Ô	2ñ 'Ü×'Ñ'¨Ó-ñ 	'Ü˜gÓ&Ð&÷	'ð 	'úð 	'÷'÷ 'ñ 'úô 
�‰”z¨Ô	1ñ &Ü×'Ñ'¬¸_ÔMñ 	&Ü�M‰M˜/¬=Ô9Ü˜WÓ%Ð%÷	&ð 	&úð 	&÷&÷ &ñ &ús8   œA²>¾A	ÁAÁAÁ;CÂ&B=Â=C	ÃCÃC)$Ú__doc__r   r&   Úpandas.errorsr   r   Úpandas._testingÚ_testingr)   Úfixturer   rB   rT   r   rY   r   r   r   ÚmarkÚfilterwarningsr-   Úparametrizer6   r<   r@   rC   rH   rL   rN   rV   rZ   r\   r`   rc   rr   rv   r   r   r   ú<module>r      s„  ðñó ã ÷õ
 ð €‡�àØØØØØØðô
ñó
ðð €‡�à	˜Ð%Ø	�mÐ$Ø	˜Ð'Ø	Ð/Ð0Ø	˜]Ð+Ø	Ð)Ð*Ø	Ð,Ð-Ø	Ð*Ð+ð	ñ 	#ôñóðò(ð
 ‡�×ÑÐ5Ó6ñó 7ðð ‡�×ÑØòóñ )ó!ð )ò
BòBòBò>ò?òGò<ò.ò5ò8ð ‡�×Ñ˜¨5°$¨-Ó8÷ð ó 9ðò ó$&r   