o
    g                     @   sl   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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   z2style: Set alternate Matplotlib style temporarily.)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aggT)force)addinivalue_line
matplotlibuse_called_from_pytest_init_tests)configkeyvalue r   Y/home/ubuntu/cloudmapper/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} | 9 d }| jd}|d urt|jdks#J d|j\}|jdd}t	 }|
 drntd	d
 dD rGtd zdd l}W n\ ttfym   zdd l}W n tyj   td Y nw Y n=w |
 drtdd
 dD rtd zdd l}W n  ttfy   zdd l}	W n ty   td Y nw Y nw ddg}
| jd}|d urt|jdksJ d|j\}
tj  t G |d ur
d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 sw   Y  zd V  W |d ur/|| n|d ur;|| w w W d    d S 1 sHw   Y  d S )Nr   )_cleanup_cmbackend   z(Marker 'backend' must specify 1 backend.skip_on_importerrorFqt4c                 s       | ]}|t jv V  qd S Nsysmodules.0kr   r   r   	<genexpr>3       z$mpl_test_settings.<locals>.<genexpr>)PyQt5PySide2zQt5 binding already importedzFailed to import a Qt4 binding.qt5c                 s   r   r   r   r    r   r   r   r#   >   r$   )PyQt4PySidezQt4 binding already importedzFailed to import a Qt5 binding.classic_classic_test_patchstylez$Marker 'style' must specify 1 style.cairoz$Failed to switch to backend {} ({}).)matplotlib.testing.decoratorsr   nodeget_closest_markerlenargskwargsgetr
   get_backendlower
startswithanypytestskipr(   ImportErrorRuntimeErrorr)   r%   r&   testingsetupr   'suppress_matplotlib_deprecation_warningmatplotlib.pyplotpyplotswitch_backendformatr,   r   )requestr   r   backend_markerr   prev_backendr(   r)   r%   r&   r,   style_markerpltexcr   r   r   mpl_test_settings!   s   








$rJ   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/   r0   r2   getfixturevaluefunctionr   _setattr_cm__wrapped__)rD   	extensionrK   funcr   r   r   mpl_image_comparison_parametersi   s   

"rS   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)r9   importorskippandas.plottingrU   r;   )pd
deregisterr   r   r   rX      s   
rX   )r9   r   r
   r   r   r   r   fixturerJ   rS   rX   r   r   r   r   <module>   s    

G
