o
    h                     @   s^   d dl Z d dlmZ d dlmZ d dlZd dlmZ edZ	ed ed dd	 Z
dS )
    N)Path)TemporaryDirectory)subprocess_run_for_testingnbformat	nbconvert	ipykernelc            	      C   s  t tjd } t C}t |d}tddddddd	t|t| g	i tjd
|idd | }t	
|t	j}W d    n1 sAw   Y  W d    n1 sPw   Y  dd |jD }|raJ dd l}|jd d dkrqd}nd}|jd d }|d d d d| dksJ d S )Nztest_nbagg_01.ipynbz	out.ipynbjupyterr   z--tonotebookz	--executez!--ExecutePreprocessor.timeout=500z--output
IPYTHONDIRT)envcheckc                 S   s,   g | ]}| d g D ]	}|jdkr
|q
qS )outputserror)getoutput_type).0celloutput r   w/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/matplotlib/tests/test_backend_nbagg.py
<listcomp>   s    
ztest_ipynb.<locals>.<listcomp>r      )      nbAggr   dataz
text/plain')r   __file__parentr   r   strosenvironopenr   readcurrent_nbformatcellsIPythonversion_info)	nb_pathtmpdirout_pathoutnberrorsr&   expected_backendbackend_outputsr   r   r   
test_ipynb   s0   

$r0   )r    pathlibr   tempfiler   pytestmatplotlib.testingr   importorskipr   r0   r   r   r   r   <module>   s    


