o
    tBh                     @   s   d dl Z d dlZd dlZd dlmZmZ dd Zdd Ze jddd	d
 Ze jej	ddddd Z
e jdd Ze jdd ZdS )    N)_apicbookc                 C   s:   dD ]
\}}|  || qtjddd dt_t  d S )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.)r   z-network: Tests that reach out to the network.)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value r   r/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/matplotlib/testing/conftest.pypytest_configure   s
   r   c                 C   s
   dt _d S )NF)r
   r   )r   r   r   r   pytest_unconfigure#   s   
r   T)autousec           
      c   s   ddl m} |  d }| jd}|d urFt|jdks"J d|j\}|jdd}t	 }|
 drFtd	d
 dD rFtd ddg}| jd}|d urlt|jdks_J dtjddddd |j\}tj  t E |d urdd lm} z|| W n% ty }	 zd|
 v s|rtd||	 n W Y d }	~	nd }	~	ww tj| W d    n1 sw   Y  zd V  W |d ur|| n|d ur|| w w W d    d S 1 sw   Y  d S )Nr   )_cleanup_cmbackend   z(Marker 'backend' must specify 1 backend.skip_on_importerrorFqt5c                 s   s    | ]	}t j|V  qd S )N)sysmodulesget).0kr   r   r   	<genexpr>9   s    z$mpl_test_settings.<locals>.<genexpr>)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_markerlenargskwargsr   r
   get_backendlower
startswithanypytestskipr   warn_deprecatedtestingsetup'suppress_matplotlib_deprecation_warningmatplotlib.pyplotpyplotswitch_backendImportErrorformatr%   r   )
requestr   r   backend_markerr   prev_backendr%   style_markerpltexcr   r   r   mpl_test_settings'   sl   




"rF   r&   none)r)   c                 c   sj    | j dj\}|d u r| d}| j}tj|j||fd d V  W d    d S 1 s.w   Y  d S )Nbaseline_images)
parameters)r,   r-   r/   getfixturevaluefunctionr   _setattr_cm__wrapped__)r@   	extensionrH   funcr   r   r   mpl_image_comparison_parameters^   s   
"rP   c                  C   s8   t d} zddlm} |  W | S  ty   Y | S w )z'Fixture to import and configure pandas.pandasr   ) deregister_matplotlib_converters)r5   importorskippandas.plottingrR   r>   )pd
deregisterr   r   r   rU   u   s   
rU   c                  C   s   t d} | S )zFixture to import xarray.xarray)r5   rS   )xrr   r   r   rX      s   
rX   )r5   r   r
   r   r   r   r   fixturerF   
deprecatedrP   rU   rX   r   r   r   r   <module>   s    

6
