U
    Fvf                     @   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 d}t |d}tjddddddd	t|t| g	tjd
|id |	 }t
|t
j}W 5 Q R X W 5 Q R X dd |jD }|rt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   G/tmp/pip-unpacked-wheel-7vhvci0g/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AssertionError)Znb_pathZtmpdirZout_pathoutnberrorsr   r   r   
test_ipynb   s"    
   
"r   )
r   pathlibr   r   tempfiler   ZpytestZimportorskipr   r   r   r   r   r   <module>   s   


