a
    –§»a9	  ã                   @   sV   d dl Z d dlmZ d dlmZmZmZ d dlZG dd„ dejƒZ	e
dkrRe ¡  dS )é    N)Újit)ÚNumbaDeprecationWarningÚNumbaPendingDeprecationWarningÚNumbaWarningc                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )ÚTestDeprecationc                 C   sR   |   t|ƒd¡ |   |d j|¡ |  |t|d jƒ¡ |  dt|d jƒ¡ d S )Né   r   úhttps://numba.pydata.org)ÚassertEqualÚlenÚcategoryÚassertInÚstrÚmessage)ÚselfÚwarningsZexpected_strr   © r   úW/home/yuhw/wc/pochoir/venv/lib/python3.9/site-packages/numba/tests/test_deprecations.pyÚcheck_warning
   s    zTestDeprecation.check_warningc                 C   sp   t jdd��P}t jdtd� t jdtd� dd„ }t|ƒƒ  d}|  ||t¡ W d   ƒ n1 sb0    Y  d S )	NT©ÚrecordÚignore©r   Úalwaysc                   S   s   g S )Nr   r   r   r   r   Úfoo   s    z-TestDeprecation.test_jitfallback.<locals>.foozPFall-back from the nopython compilation path to the object mode compilation path)r   Úcatch_warningsÚsimplefilterr   r   r   r   )r   Úwr   Úmsgr   r   r   Útest_jitfallback   s    
z TestDeprecation.test_jitfallbackc           	   	   C   sö   dd„ }dd„ }||fD ]Ø}|j  d¡}t|ƒdgƒ}tjdd��ž}tjd	td
� tjdtd
� tdd�|ƒ|ƒ |  	t
|ƒd¡ |  	|d jt¡ t|d jƒ}d}|  ||¡ d| }|  ||¡ |  d|¡ W d   ƒ q1 sæ0    Y  qd S )Nc                 S   s
   |   d¡S ©Nr   )Úappend©Úar   r   r   Úfoo_list!   s    zFTestDeprecation.test_reflection_of_mutable_container.<locals>.foo_listc                 S   s
   |   d¡S r   )Úaddr!   r   r   r   Úfoo_set$   s    zETestDeprecation.test_reflection_of_mutable_container.<locals>.foo_setZfoo_é
   Tr   r   r   r   )Znopythonr   r   z?Encountered the use of a type that is scheduled for deprecationz!'reflected %s' found for argumentr   )Ú__name__ÚstripÚevalr   r   r   r   r   r   r	   r
   r   r   r   r   )	r   r#   r%   ÚfÚ	containerÚinpr   Zwarn_msgr   r   r   r   Ú$test_reflection_of_mutable_container   s&    ÿz4TestDeprecation.test_reflection_of_mutable_containerN)r'   Ú
__module__Ú__qualname__r   r   r-   r   r   r   r   r      s   r   Ú__main__)r   Znumbar   Znumba.core.errorsr   r   r   ZunittestZTestCaser   r'   Úmainr   r   r   r   Ú<module>   s   2