a
    ¸DfU  ã                   @   sh   d dl Z d dlZd dlZd dl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)Ú_apic                 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   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\(\):ImportWarningZaggT)Úforce)Zaddinivalue_lineÚ
matplotlibÚuseÚ_called_from_pytestZ_init_tests)ÚconfigÚkeyÚvalue© r   úh/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/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)Zautousec                 c   s¸  ddl m} |ƒ Ž d }| j d¡}t ¡ }|d urŒt|jƒdksLJ dƒ‚|j\}|j 	dd¡}| 
¡  d¡rŒtd	d
„ dD ƒƒrŒt d¡ tj ¡  t ¡ š |d urdd lm} z| |¡ W nT ty } z:d| 
¡ v sè|rt d|› d|› d¡ n‚ W Y d }~n
d }~0 0 tj ddg¡ W d   ƒ n1 s@0    Y  z(d V  W |d ur”| d¡ t |¡ n |d ur’| d¡ t |¡ 0 W d   ƒ n1 sª0    Y  d S )Nr   )Ú_cleanup_cmÚbackendé   z(Marker 'backend' must specify 1 backend.Úskip_on_importerrorFZqt5c                 s   s   | ]}t j |¡V  qd S )N)ÚsysÚmodulesÚget)Ú.0Úkr   r   r   Ú	<genexpr>6   ó    z$mpl_test_settings.<locals>.<genexpr>)ZPyQt4ZPySidezQt4 binding already importedZcairozFailed to switch to backend z (z).ZclassicZ_classic_test_patchÚall)Zmatplotlib.testing.decoratorsr   ÚnodeZget_closest_markerr   Úget_backendÚlenÚargsÚkwargsr   ÚlowerÚ
startswithÚanyÚpytestÚskipZtestingÚsetupr   Z'suppress_matplotlib_deprecation_warningZmatplotlib.pyplotZpyplotZswitch_backendÚImportErrorÚstyler   Úclose)Úrequestr   r   Zbackend_markerZprev_backendr   ZpltÚexcr   r   r   Úmpl_test_settings$   sN    
ÿÿ



ÿÿ0

þ

r-   c                  C   s8   t  d¡} zddlm} |ƒ  W n ty2   Y n0 | S )z'Fixture to import and configure pandas.Zpandasr   )Ú deregister_matplotlib_converters)r%   ÚimportorskipZpandas.plottingr.   r(   )ÚpdZ
deregisterr   r   r   r0   S   s    

r0   c                  C   s   t  d¡} | S )zFixture to import xarray.Zxarray)r%   r/   )Úxrr   r   r   r1   `   s    
r1   )
r%   r   r   r   r   r   Zfixturer-   r0   r1   r   r   r   r   Ú<module>   s   

.
