U
    .d5                     @   s8   d Z ddlZddlmZ ddlmZ dd Zdd ZdS )zg
Tests making sure that deprecated objects properly raise a deprecation warning
when imported/created.
    N)_deprecated_namesc               
   C   sL   dt kstt D ]6} d| }tjt|d td|  W 5 Q R X qd S )NZJoblibException8{} is deprecated and will be removed from joblib in 0.16matchz#from joblib.my_exceptions import {})_deprecated_exceptionsAssertionErrorformatpytestwarnsDeprecationWarningexec)namemsg r   G/tmp/pip-unpacked-wheel-ho8k9mhl/joblib/test/test_deprecated_objects.py!test_deprecated_joblib_exceptions   s    r   c              
   C   sX   dt kstdt kstt D ]6}d|}tjt|d td| W 5 Q R X qd S )NZ	safe_reprZeq_reprr   r   z"from joblib.format_stack import {})_deprecated_format_utilsr   r   r	   r
   r   r   )Zcapsysr   r   r   r   r   $test_deprecated_formatting_utilities   s    r   )	__doc__r	   Zjoblib.my_exceptionsr   r   Zjoblib.format_stackr   r   r   r   r   r   r   <module>   s
   	