a
    
d                     @   sZ   d dl Z d dlmZ d dlZd dlmZ d dlZedZed ed dd Z	dS )	    N)Path)TemporaryDirectorynbformat	nbconvertZ	ipykernelc                  C   s   t tjd } t }t |d}tjddddddd	t|t| g	i tjd
|id |	 }t
|t
j}W d    n1 s0    Y  W d    n1 s0    Y  dd |jD }|rJ d S )Nztest_nbagg_01.ipynbz	out.ipynbZjupyterr   z--toZnotebookz	--executez!--ExecutePreprocessor.timeout=500z--outputZ
IPYTHONDIR)envc                 S   s,   g | ]$}| d g D ]}|jdkr|qqS )outputserror)getoutput_type).0celloutput r   l/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/matplotlib/tests/test_backend_nbagg.py
<listcomp>   s   
ztest_ipynb.<locals>.<listcomp>)r   __file__parentr   
subprocess
check_callstrosenvironopenr   readZcurrent_nbformatcells)Znb_pathtmpdirZout_pathoutnberrorsr   r   r   
test_ipynb   s    

Jr   )
r   pathlibr   r   tempfiler   ZpytestZimportorskipr   r   r   r   r   r   <module>   s   


