
    g                         d dl Z d dlZd dlZd dlmZ d Zd Z e j                  d      d        Ze j                  d        Ze j                  d	        Z	y)
    N)_apic                     dD ]  \  }}| j                  ||        t        j                  dd       dt        _        t        j                          y )N))markersz*flaky: (Provided by pytest-rerunfailures.))r   z&timeout: (Provided by pytest-timeout.))r   z6backend: Set alternate Matplotlib backend temporarily.)r   z3baseline_images: Compare output against references.)r   z.pytz: Tests that require pytz to be installed.)filterwarningserror)r   z?ignore:.*The py23 module has been deprecated:DeprecationWarning)r   z]ignore:DynamicImporter.find_spec\(\) not found; falling back to find_module\(\):ImportWarningaggT)force)addinivalue_line
matplotlibuse_called_from_pytest_init_tests)configkeyvalues      X/var/www/dash_apps/app1/venv/lib/python3.12/site-packages/matplotlib/testing/conftest.pypytest_configurer      sM    
 ,
U 	U+, NN5%%)J"    c                     dt         _        y )NF)r   r   )r   s    r   pytest_unconfigurer       s
    %*J"r   T)autousec           
   #      K   ddl m}  |       5  d }| j                  j                  d      }t	        j
                         }|t        |j                        dk(  sJ d       |j                  \  }|j                  j                  dd      }|j                         j                  d      r't        d	 d
D              rt        j                  d       t        j                  j!                          t#        j$                         5  |dd lm} 	 |j+                  |       t        j.                  j1                  ddg       d d d        	 d  |'j3                  d       t	        j0                  |       	 d d d        y # t,        $ r<}d|j                         v srt        j                  d| d| d       n Y d }~d }~ww xY w# 1 sw Y   xY w# |'j3                  d       t	        j0                  |       w w xY w# 1 sw Y   y xY ww)Nr   )_cleanup_cmbackend   z(Marker 'backend' must specify 1 backend.skip_on_importerrorFqt5c              3   Z   K   | ]#  }t         j                  j                  |       % y w)N)sysmodulesget).0ks     r   	<genexpr>z$mpl_test_settings.<locals>.<genexpr>6   s     Gas{{q)Gs   )+)PyQt4PySidezQt4 binding already importedcairozFailed to switch to backend z (z).classic_classic_test_patchall)matplotlib.testing.decoratorsr   nodeget_closest_markerr   get_backendlenargskwargsr!   lower
startswithanypytestskiptestingsetupr   'suppress_matplotlib_deprecation_warningmatplotlib.pyplotpyplotswitch_backendImportErrorstyler   close)requestr   r   backend_markerprev_backendr   pltexcs           r   mpl_test_settingsrE   $   s    9	 (- 88C!--/%~**+q0 ;:;0%**HG"0"7"7";";%u#. }}))%0G3FGGKK >?  "99; 	E" 0	&&w/   )-B!CD!	E"	-"		% |,Q(- (-2 #  '--/15H$B'.ir#b%: ; ;		E 	E( "		% |, #M(- (-sw   HC5H	GF  !GH
G)H7	H 	G	2G ;G GGG	H+G??HHHc                  l    t        j                  d      } 	 ddlm}  |        | S # t        $ r Y | S w xY w)a  
    Fixture to import and configure pandas. Using this fixture, the test is skipped when
    pandas is not installed. Use this fixture instead of importing pandas in test files.

    Examples
    --------
    Request the pandas fixture by passing in ``pd`` as an argument to the test ::

        def test_matshow_pandas(pd):

            df = pd.DataFrame({'x':[1,2,3], 'y':[4,5,6]})
            im = plt.figure().subplots().matshow(df)
            np.testing.assert_array_equal(im.get_array(), df)
    pandasr   ) deregister_matplotlib_converters)r5   importorskippandas.plottingrH   r=   )pd
deregisters     r   rK   rK   S   sC      
		X	&B	< I  Is   & 	33c                  0    t        j                  d      } | S )a  
    Fixture to import xarray so that the test is skipped when xarray is not installed.
    Use this fixture instead of importing xrray in test files.

    Examples
    --------
    Request the xarray fixture by passing in ``xr`` as an argument to the test ::

        def test_imshow_xarray(xr):

            ds = xr.DataArray(np.random.randn(2, 3))
            im = plt.figure().subplots().imshow(ds)
            np.testing.assert_array_equal(im.get_array(), ds)
    xarray)r5   rI   )xrs    r   rO   rO   m   s    " 
		X	&BIr   )
r5   r   r   r   r   r   fixturerE   rK   rO    r   r   <module>rR      sk     
  2+ +- +-\  2  r   