o
    i                     @   sx   d Z ddlZddlm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d Zdd ZdS )zL
Backend-loading machinery tests, using variations on the template backend.
    N)SimpleNamespace)	MagicMock)pyplot)backend_template)FigureCanvasTemplateFigureManagerTemplatec                   C   s$   t d tt jtksJ d S )Ntemplate)mplusetypepltfigurecanvasr    r   r   u/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/python3.10/site-packages/matplotlib/tests/test_backend_template.pytest_load_template   s   
r   c                 C   sb   t di tt}tjjddd|_| tj	d| t
d tt jtks+J t  d S )N)FigureClassc                _   s   t t||i || S )N)r   r   )numr   argskwargsr   r   r   <lambda>   s   z#test_load_old_api.<locals>.<lambda>mpl_test_backendmodule://mpl_test_backendr   )r   varsr   r	   r   ZFigureZnew_figure_managersetitemsysmodulesr
   r   r   r   r   Zdraw_if_interactive)monkeypatchr   r   r   r   test_load_old_api   s   
r   c                 C   sV   t di tt}t }| |jd| | tjd| t	
d t  |  d S )NZpyplot_showr   r   r   )r   r   r   r   setattrr   r   r   r   r	   r
   r   showassert_called_withr   r   Z	mock_showr   r   r   	test_show!   s   
r#   c                 C   sX   t di tt}t }| j|d|dd | tjd| t	d t
  |  d S )Nr    F)Zraisingr   r   r   )r   r   r   r   r   r   r   r   r	   r
   r   r    r!   r"   r   r   r   test_show_old_global_api,   s   
r$   )__doc__r   typesr   Zunittest.mockr   Z
matplotlibr	   r   r   Zmatplotlib.backendsr   Z$matplotlib.backends.backend_templater   r   r   r   r#   r$   r   r   r   r   <module>   s    