U
    sVc                  
   @   s|   d dl Z d dlZd dlmZ d dlmZ ejde	ddfe	ddfe	ddfe	dd	fe
dd	fgejd
de
gdd ZdS )    N)rewrite_warningz$target_category, target_message, hitTarget messageTZTargetzget messzMissed messageFnew_categoryc              
   C   sh   d}|r|r|n| }|}nt }d}tj||d. t|| || tjdt d W 5 Q R X W 5 Q R X d S )NzRewritten messager   )match)messagecategory)FutureWarningtmZassert_produces_warningr   warningswarn)Ztarget_categoryZtarget_messagehitr   Znew_messageZexpected_categoryZexpected_message r   J/tmp/pip-unpacked-wheel-xj8nt62q/pandas/tests/util/test_rewrite_warning.pytest_rewrite_warning
   s       r   )r
   ZpytestZpandas.util._exceptionsr   Zpandas._testingZ_testingr	   markZparametrizer   DeprecationWarningr   r   r   r   r   <module>   s&   
