+
    xȇi'                        R t ^ RIt^ RIt^ RIHtHt ^ RIHt ]P                  ! ]
]3]]3]]
3]]3]]3]]3]]3]]3.R R7      R 4       tR tR t]P$                  P'                  R]
]]]]]].4      ]P$                  P'                  R	. RO4      R
 4       4       tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"]P$                  P'                  RRR.4       ! R R4      4       t#R t$R t%R# ) zG"
Test module for testing ``pandas._testing.assert_produces_warning``.
N)DtypeWarningPerformanceWarningc                 ,    \        V 4      P                  # N)type__name__)xs   &~/Users/max/.openclaw/workspace/postharvest/venv/lib/python3.14/site-packages/pandas/tests/util/test_assert_produces_warning.py<lambda>r
      s    $q'""    )paramsidsc                    V P                   # )z
Return pair or different warnings.

Useful for testing how several different warnings are handled
in tm.assert_produces_warning.
)param)requests   &r	   pair_different_warningsr      s    ( ==r   c                  r    \         P                  ! R \        4       \         P                  ! R\        4       R# )f1f2N)warningswarnFutureWarningRuntimeWarning r   r	   fr   (   s    MM$&MM$'r   c            	         R p \         P                  ! \        V R7      ;_uu_ 4        \        P                  ! \
        4      ;_uu_ 4        \        4        RRR4       RRR4       \        P                  ! \
        RR7      ;_uu_ 4        \        4        RRR4       R#   + '       g   i     LQ; i  + '       g   i     L\; i  + '       g   i     R# ; i)Caused unexpected warning\(s\)matchNFraise_on_extra_warnings)pytestraisesAssertionErrortmassert_produces_warningr   r   msgs    r	   *test_assert_produces_warning_honors_filterr(   -   sz    
+C	~S	1	1''77C 8 
2 
	#	#NE	R	R	 
S	R 87 
2	1 
S	R	Rs/   #B1
B	B1	CB.)B11C	C	categoryzmessage, matchc                     \         P                  ! WR 7      ;_uu_ 4        \        P                  ! W4       RRR4       R#   + '       g   i     R# ; i)r   Nr$   r%   r   r   )r)   messager   s   &&&r	   %test_catch_warning_category_and_matchr-   8   s0    : 
	#	#H	:	:g( 
;	:	:	:s   AA	c            	      n   \         p R pRp\        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! WR7      ;_uu_ 4        \        P                  ! RV 4       \        P                  ! RV 4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zDid not see this warningzDid 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.N)r   r!   r"   r#   r$   r%   r   r   r)   r   	unmatcheds      r	   "test_fail_to_match_runtime_warningr3   Y   sx    H&E	<  
~Y	7	7''>>MM0(;MM6A ? 
8	7>> 
8	7	7#    B#/B	>B#B B##B4	c            	      n   \         p R pRp\        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! WR7      ;_uu_ 4        \        P                  ! RV 4       \        P                  ! RV 4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)WarningzDid not see warning 'FutureWarning' matching 'Warning'. The emitted warning messages are \[FutureWarning\('This is not a match.'\), FutureWarning\('Another unmatched warning.'\)\]r   r/   r0   N)r   r!   r"   r#   r$   r%   r   r   r1   s      r	   !test_fail_to_match_future_warningr7   h   sx    HE	;  
~Y	7	7''>>MM0(;MM6A ? 
8	7>> 
8	7	7r4   c            	      n   \         p R pRp\        P                  ! \        VR7      ;_uu_ 4        \        P
                  ! WR7      ;_uu_ 4        \        P                  ! RV 4       \        P                  ! RV 4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z\d+zDid not see warning 'ResourceWarning' matching '\\d\+'. The emitted warning messages are \[ResourceWarning\('This is not a match.'\), ResourceWarning\('Another unmatched warning.'\)\]r   r/   r0   N)ResourceWarningr!   r"   r#   r$   r%   r   r   r1   s      r	   #test_fail_to_match_resource_warningr:   w   sx    HE	=  
~Y	7	7''>>MM0(;MM6A ? 
8	7>> 
8	7	7r4   c           	      6   V w  rR p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! V4      ;_uu_ 4        \
        P                  ! RV4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z%Did not see expected warning of classr   zwarning messageNr!   r"   r#   r$   r%   r   r   )r   expected_categoryactual_categoryr   s   &   r	   !test_fail_to_catch_actual_warningr?      sb    )@&3E	~U	3	3''(9::MM+_= ; 
4	3:: 
4	3	3s#   B
A4	"B4B?BB	c                     V w  r\         P                  ! VR R7      ;_uu_ 4        \        P                  ! RV4       \        P                  ! RV4       RRR4       R#   + '       g   i     R# ; i)Fr   Expected warningzUnexpected warning OKNr+   )r   r=   extra_categorys   &  r	   test_ignore_extra_warningrC      sN    (?%		#	#$5u	U	U(*;<-~> 
V	U	U	Us   /AA/	c           	      d   V w  rR p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! V4      ;_uu_ 4        \
        P                  ! RV4       \
        P                  ! RV4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r   r   rA   zUnexpected warning NOT OKNr<   )r   r=   rB   r   s   &   r	   test_raise_on_extra_warningrE      sr    (?%-E	~U	3	3''(9::MM,.?@MM5~F ; 
4	3:: 
4	3	3s#   B
/B	9BBBB/	c                     \         p \        P                  ! V R R7      ;_uu_ 4        \        P                  ! RV 4       \        P                  ! RV 4       \        P                  ! RV 4       RRR4       R#   + '       g   i     R# ; i)^Match thisr   
Match thisDo not match thatDo not match that eitherN)UserWarningr$   r%   r   r   r)   s    r	   1test_same_category_different_messages_first_matchrM      sV    H		#	#HN	C	ClH-)840(; 
D	C	C	C   AA77B	c                     \         p \        P                  ! V R R7      ;_uu_ 4        \        P                  ! RV 4       \        P                  ! RV 4       \        P                  ! RV 4       RRR4       R#   + '       g   i     R# ; i)rG   r   rI   rJ   rH   N)DeprecationWarningr$   r%   r   r   rL   s    r	   0test_same_category_different_messages_last_matchrQ      sV    !H		#	#HN	C	C)840(;lH- 
D	C	C	CrN   c                     \         \        3p \        P                  ! V R R7      ;_uu_ 4        \        P
                  ! R\         4       \        P
                  ! R\        4       RRR4       R#   + '       g   i     R# ; i)rG   r   rH   zMatch this tooNr   rK   r$   r%   r   r   rL   s    r	   test_match_multiple_warningsrT      sL    {+H		#	#HN	C	ClM2&4 
D	C	C	Cs   7A..A?	c            	      R   \         \        3p R p\        P                  ! \        VR7      ;_uu_ 4        \
        P                  ! V RR7      ;_uu_ 4        \        P                  ! R\         4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)3Did not see expected warning of class 'UserWarning'r   rG   rH   N	r   rK   r!   r"   r#   r$   r%   r   r   r)   r'   s     r	   !test_must_match_multiple_warningsrY      sd    {+H
?C	~S	1	1''GGMM,6 H 
2	1GG 
2	1	1s#   !BB	0BBBB&	c            	         \         \        3p R p\        P                  ! \        VR7      ;_uu_ 4        \
        P                  ! V RR7      ;_uu_ 4        \        P                  ! R\         4       \        P                  ! R\        4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)z>The emitted warning messages are \[UserWarning\('Not this'\)\]r   rG   rH   Not thisNrW   rX   s     r	   *test_must_match_multiple_warnings_messagesr\      sr    {+H
KC	~S	1	1''GGMM,6MM*k2 H 
2	1GG 
2	1	1s#   !B07B	B0B-(B00C	c                      \         \        3p \        P                  ! V R RR7      ;_uu_ 4        \        P
                  ! R\         4       RRR4       R#   + '       g   i     R# ; i)rG   Fr   must_find_all_warningsrH   NrS   rL   s    r	   .test_allow_partial_match_for_multiple_warningsr`      sK    {+H		#	#u
 
 	lM2
 
 
 
s   AA%	c                     \         \        3p \        P                  ! V R RR7      ;_uu_ 4        \        P
                  ! R\         4       \        P
                  ! R\        4       RRR4       R#   + '       g   i     R# ; i)rG   Fr^   rH   r[   NrS   rL   s    r	   7test_allow_partial_match_for_multiple_warnings_messagesrb      sY    {+H		#	#u
 
 	lM2j+.	
 
 
 
s   7A//B 	c           	      d   V w  r\         P                  ! \        R R7      ;_uu_ 4        \        P                  ! VRR7      ;_uu_ 4        \
        P                  ! RV4       \
        P                  ! RV4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)zDid not see warning.*matchingr   rG   zDo not match itrH   Nr<   )r   target_categoryother_categorys   &  r	   &test_right_category_wrong_match_raisesrf      so    &=#O	~-L	M	M''~NNMM+_=MM,7 O 
N	MNN 
N	M	Ms#   !B
/B	9BBBB/	false_or_noneFc                   2   a  ] tR t^t o R tR tR tRtV tR# )TestFalseOrNoneExpectedWarningc           	        R p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! V4      ;_uu_ 4        \        4        RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r   r   N)r!   r"   r#   r$   r%   r   )selfrg   r'   s   && r	   test_raise_on_warning4TestFalseOrNoneExpectedWarning.test_raise_on_warning   sN    /]]>55++M:: ; 65:: 655s#   A6A#	A6#A3.A66B	c                ~    \         P                  ! V4      ;_uu_ 4         R R R 4       R #   + '       g   i     R # ; ir   )r$   r%   rk   rg   s   &&r	   test_no_raise_without_warning<TestFalseOrNoneExpectedWarning.test_no_raise_without_warning   s%    ''66 7666s   +<	c                    \         P                  ! VR R7      ;_uu_ 4        \        4        RRR4       R#   + '       g   i     R# ; i)Fr   N)r$   r%   r   ro   s   &&r	   'test_no_raise_with_false_raise_on_extraFTestFalseOrNoneExpectedWarning.test_no_raise_with_false_raise_on_extra   s*    ''uUUC VUUUs	   6A	r   N)	r   
__module____qualname____firstlineno__rl   rp   rs   __static_attributes____classdictcell__)__classdict__s   @r	   ri   ri      s      r   ri   c            	      f   R p \         P                  ! \        V R7      ;_uu_ 4        \        P                  ! \
        4      ;_uu_ 4        \        h  + '       g   i     M; i RRR4       M  + '       g   i     M; i\         P                  ! \        T R7      ;_uu_ 4        \        P                  ! \
        4      ;_uu_ 4        \        P                  ! R\        4       \        h  + '       g   i     M; i RRR4       M  + '       g   i     M; iRp \         P                  ! \        T R7      ;_uu_ 4        \        P                  ! R4      ;_uu_ 4        \        P                  ! R\        4       \        h  + '       g   i     M; i RRR4       R#   + '       g   i     R# ; i)rV   r   Nr   zCaused unexpected warning)r!   r"   r#   r$   r%   rK   
ValueErrorr   r   r   
IndexErrorSystemErrorr&   s    r	   test_raises_during_exceptionr      s    
?C	~S	1	1''44 544 
2	1	1	1 
~S	1	1''44MM 	 544 
2	1	1	1 &C	~S	1	1''--MM 	 .-- 
2	1	1	1sY   #A.
A	A!A..A>	%#D"C*	*C:5DD	 F"F	FFF0	c            	      D   \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! R4      ;_uu_ 4        \        R 4      h  + '       g   i     M; i RRR4       M  + '       g   i     M; i\         P                  ! \
        R R7      ;_uu_ 4        \        P                  ! \        RR7      ;_uu_ 4        \        P                  ! R\        4       \        R 4      h  + '       g   i     M; i RRR4       R#   + '       g   i     R# ; i)Errorr   Nr   )	r!   r"   SyntaxErrorr$   r%   r|   r   r   r   r   r   r	   test_passes_during_exceptionr     s    	{'	2	2''--g&& .-- 
3	2	2	2 
z	1	1''_MMMM W%%	 NMM 
2	1	1	1s;   A-A	A A--A=	$%D	'C0	0D ;DD	)) 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})r   z^Mes.*\d{2}-\d{3})r   z\d{2}-\d{3}\s\S+)zMessage, which we do not matchN)&__doc__r   r!   pandas.errorsr   r   pandas._testing_testingr$   fixturer   rK   r   rP   r9   r   r   r(   markparametrizer-   r3   r7   r:   r?   rC   rE   rM   rQ   rT   rY   r\   r`   rb   rf   ri   r   r   r   r   r	   <module>r      st    
  	%	m$	'	/0	]+	)*	,-	*+	 	#(
   )!8)
BBB>?G<.5733/8 5$-8  9 ,
&r   