o
    h	                     @   s   d dl mZ d dlZd dlZd dlmZ d dlmZ d dl	m
Z
 dZdd Zd	d
 Zedd Zdd Zejje dddd Zejje dddd Zejje dddd ZdS )    )contextmanagerN)has_mpl)io)manage_pluginspilc                   C   s   t d d S )Nr   )r   
use_plugin r   r   W/var/www/html/scripts/venv/lib/python3.10/site-packages/skimage/io/tests/test_plugin.pysetup   s   r
   c                   C   s   t   d S )N)r   reset_pluginsr   r   r   r	   teardown_module   s   r   c                  c   s(    t j } z	dV  W | t _dS | t _w )zDContexts where `preferred_plugins` can be modified w/o side-effects.N)r   preferred_pluginscopy)r   r   r   r	   protect_preferred_plugins   s
   
r   c                   C   s:   t t td W d    d S 1 sw   Y  d S )Nasd)pytestraises
ValueErrorr   r   r   r   r   r	   test_failed_use   s   "r   zmatplotlib not installed)reasonc                  C   sX   t t t jd d \} }tj| t t d t jd d \} }tj| d d S )Nimreadr   
matplotlib)r   r   priority_pluginplugin_storenptestingassert_equal)plugfuncr   r   r	   test_use_priority$   s   

r   c                  C   s   ddl m} m} t > dgdgdt_t  dD ]}tj| d \}}|t| |ks.J qtjd d \}}|t|dksAJ W d    d S 1 sLw   Y  d S )Nr   
pil_pluginmatplotlib_pluginr   r   )allimshow)r   imsaver$   )	skimage.io._pluginsr!   r"   r   r   r   r   r   getattr)r!   r"   plugin_typer   r   r   r   r	   test_load_preferred_plugins_all/   s   "r)   c                  C   s   ddl m} m} t 6 dgtjd< t  tjd d \}}|| jks&J tjd d \}}||j	ks9J |j
W d    d S 1 sDw   Y  d S )Nr   r    r   r   r$   )r&   r!   r"   r   r   r   r   r   r   r$   
__module__)r!   r"   r   r   r   r   r	   "test_load_preferred_plugins_imread?   s   "r+   )
contextlibr   numpyr   r   "skimage._shared._dependency_checksr   skimager   
skimage.ior   r   r
   r   r   r   markskipifr   r)   r+   r   r   r   r	   <module>   s$    
	


