a
    
d	                     @   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   e/var/www/html/stable-diffusion-webui/venv/lib/python3.9/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 _n| t _0 dS )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   s8   t t td W d    n1 s*0    Y  d S )Nasd)pytestZ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npZtestingZassert_equal)plugfuncr   r   r	   test_use_priority$   s    

r   c                  C   s   ddl m} m} t z dgdgdt_t  dD ](}tj| d \}}|t| |ks4J q4tjd d \}}|t|dksJ W d    n1 s0    Y  d S )Nr   
pil_pluginmatplotlib_pluginr   r   )allimshow)r   Zimsaver!   )	skimage.io._pluginsr   r   r   r   r   r   r   getattr)r   r   Zplugin_typer   r   r   r   r	   test_load_preferred_plugins_all/   s    r$   c                  C   s   ddl m} m} t j dgtjd< t  tjd d \}}|| jksLJ tjd d \}}||j	ksrJ |j
W d    n1 s0    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   Z"skimage._shared._dependency_checksr   Zskimager   Z
skimage.ior   r   r
   r   r   r   markZskipifr   r$   r&   r   r   r   r	   <module>   s"   
	


