
    P/Ph                         d dl m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j	        
                    dg d          d             ZdS )	    )PathN)approx)compare_images)_image_directorieszim1, im2, tol, expect_rms))basn3p02.pngbasn3p02-minorchange.png
   N)r   r   r   gBs@)r   zbasn3p02-1px-offset.pngr   g%̴V@)r   zbasn3p02-half-1px-offset.pngr   g     O@)r   zbasn3p02-scrambled.pngr   gD/Xe@)
all127.png
all128.pngr      )r   r
   r   r   c                 4   |                     |           t          t          t          d                     \  }}|| z  }t	          j        ||z  |           t          || z  ||d          }	||	J dS |	J |	d         t          |d          k    sJ 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.
    c                      dS )Ndummy r       d/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/matplotlib/tests/test_compare_images.py<lambda>z2test_image_comparison_expect_rms.<locals>.<lambda>=   s    G r   T)tolin_decoratorNrmsg-C6?)abs)chdirmapr   r   shutilcopyfiler   r   )
im1im2r   
expect_rmstmp_pathmonkeypatchbaseline_dir
result_dir
result_im2resultss
             r    test_image_comparison_expect_rmsr%      s    ` h"4);OO)L)LMML* c!J
OL3&
333sJCdD D DG """u~
!=!=!=======r   )pathlibr   r   pytestr   matplotlib.testing.comparer   matplotlib.testing.decoratorsr   markparametrizer%   r   r   r   <module>r,      s                  5 5 5 5 5 5 < < < < < <      B> >C   B> > >r   