U
    d»{jÑ  ã                   @   s\   d Z ddlZddlmZ ddlZddlmZ ddlm	Z	 ddl
mZmZ dd„ Zd	d
„ ZdS )zL
Backend-loading machinery tests, using variations on the template backend.
é    N)ÚSimpleNamespace)Úpyplot)Úbackend_template)ÚFigureCanvasTemplateÚFigureManagerTemplatec                   C   s$   t  d¡ tt ¡ jƒtks t‚d S )NÚtemplate)ÚmplÚuseÚtypeÚpltÚfigureÚcanvasr   ÚAssertionError© r   r   úe/var/www/html/bwave/python/venv/lib/python3.8/site-packages/matplotlib/tests/test_backend_template.pyÚtest_load_template   s    
r   c                 C   s^   t f ttƒŽ}tjjdœdd„|_|  tj	d|¡ t 
d¡ tt ¡ jƒtksRt‚t ¡  d S )N)ÚFigureClassc                _   s   t t|||Žƒ| ƒS )N)r   r   )Únumr   ÚargsÚkwargsr   r   r   Ú<lambda>   s     ÿz#test_load_old_api.<locals>.<lambda>Úmpl_test_backendzmodule://mpl_test_backend)r   Úvarsr   r   r   ZFigureZnew_figure_managerÚsetitemÚsysÚmodulesr	   r
   r   r   r   r   Zdraw_if_interactive)Zmonkeypatchr   r   r   r   Útest_load_old_api   s    ÿ
r   )Ú__doc__r   Útypesr   Z
matplotlibr   r   r   Zmatplotlib.backendsr   Z$matplotlib.backends.backend_templater   r   r   r   r   r   r   r   Ú<module>   s   