3
$ßL]S  ã               @   st   d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ edd„ ƒ\ZZ	ej
jddddddddgƒdd„ ƒZdS )é    N)Úapprox)Úcompare_images)Ú_image_directoriesc               C   s   dS )Nz
dummy func© r   r   r   úL/tmp/pip-install-edjban26/matplotlib/matplotlib/tests/test_compare_images.pyÚ<lambda>   s    r   zim1, im2, tol, expect_rmsúbasn3p02.pngúbasn3p02-minorchange.pngé
   ç»íBs�@úbasn3p02-1px-offset.pngç%Ì´ý‰V@úbasn3p02-half-1px-offset.pngç     àO@úbasn3p02-scrambled.pngç‘D/£X”e@ú
all127.pngú
all128.pngé   c             C   s„   t jjt| ƒ} t jjt|ƒ}t jjt|ƒ}tj||ƒ t| ||dd�}|dkr\|dks€t‚n$|dk	sht‚|d t	|dd�ks€t‚dS )a›  Compare two images, expecting a particular RMS error.

    im1 and im2 are filenames relative to the baseline_dir directory.

    tol is the tolerance to pass to compare_images.

    expect_rms is the expected RMS value, or None. If None, the test will
    succeed if compare_images succeeds. Otherwise, the test will succeed if
    compare_images fails and returns an RMS error almost equal to this value.
    T)ÚtolZin_decoratorNZrmsg-Cëâ6?)Úabs)
ÚosÚpathÚjoinÚbaseline_dirÚ
result_dirÚshutilÚcopyfiler   ÚAssertionErrorr   )Zim1Zim2r   Z
expect_rmsZim2_srcÚresultsr   r   r   Ú test_image_comparison_expect_rms   s    ,r    )r   r	   r
   N)r   r	   r   r   )r   r   r   r   )r   r   r   r   )r   r   r   r   )r   r   r   r   )r   r   r   r   )r   r   Zpytestr   Zmatplotlib.testing.comparer   Zmatplotlib.testing.decoratorsr   r   r   ÚmarkZparametrizer    r   r   r   r   Ú<module>   s   
