
    G8c9                        d dl Z d dlZd dlZd dlmZmZ d Zd Z e j                  d      d        Ze j                   ej                  dd	
      d               Z
e j                  d        Ze j                  d        Zy)    N)_apicbookc                     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   z?style: Set alternate Matplotlib style temporarily (deprecated).)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      =/usr/lib/python3/dist-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       ddg}| j                  j                  d      }|Ft        |j                        dk(  sJ d       t        j                   dddd       |j                  \  }t        j"                  j%                          t        j&                         5  |dd lm} 	 |j-                  |       t        j2                  j5                  |       d d d        	 d  t	        j4                  |       	 d d d        y # t.        $ rE}	d|j                         v sr&t        j                  dj1                  ||	             n Y d }	~	d }	~	ww xY w# 1 sw Y   ~xY w# t	        j4                  |       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>8   s     Gas{{q)Gs   )+)PyQt4PySidezQt4 binding already importedclassic_classic_test_patchstylez$Marker 'style' must specify 1 style.3.5zpytest markerz@mpl.style.context(...))nameobj_typealternativecairoz$Failed to switch to backend {} ({}).)matplotlib.testing.decoratorsr   nodeget_closest_markerr   get_backendlenargskwargsr"   lower
startswithanypytestskipr   warn_deprecatedtestingsetup'suppress_matplotlib_deprecation_warningmatplotlib.pyplotpyplotswitch_backendImportErrorformatr*   r   )
requestr   r   backend_markerprev_backendr   r*   style_markerpltexcs
             r   mpl_test_settingsrK   &   s    9	 /) 88C!--/%~**+q0 ;:;0%**HG"0"7"7";";%u#. }}))%0G3FGGKK >? 12||66w?#|(()Q. 767.  W-FH!&&FE  "99; 	(" 0	&&w/   '	( 	)NN<(_/) /)F #  '--/15H$J%+VGS%9; ;		( 	(& NN<(_/) /)sw   IEI	,	H#6GH#&I	/H/3I			I	H ;HH#H  H##H,	(I	/II		IIr+   none)r.   c              #     K   | j                   j                  d      j                  \  }|| j                  d      }| j                  }t        j                  |j                  ||f      5  d  d d d        y # 1 sw Y   y xY ww)Nbaseline_images)
parameters)r1   r2   r5   getfixturevaluefunctionr   _setattr_cm__wrapped__)rE   	extensionrN   funcs       r   mpl_image_comparison_parametersrV   \   s      ||667HINNO "112CDD			4++'6	&B
D   s   A*B,A:1	B:B?Bc                  l    t        j                  d      } 	 ddlm}  |        | S # t        $ r Y | S w xY w)z'Fixture to import and configure pandas.pandasr   ) deregister_matplotlib_converters)r:   importorskippandas.plottingrY   rC   )pd
deregisters     r   r\   r\   s   sC     
		X	&B	< I  Is   & 	33c                  0    t        j                  d      } | S )zFixture to import xarray.xarray)r:   rZ   )xrs    r   r`   r`      s     
		X	&BIr   )r:   r    r   r   r   r   r   fixturerK   
deprecatedrV   r\   r`    r   r   <module>rd      s     
  "6+ 2) 2)j F+ , * 	 	  r   