o
    li                     @   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   d/home/ubuntu/SoloSpeech/.venv/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   Figurenew_figure_managersetitemsysmodulesr
   r   r   r   r   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 )Npyplot_showr   r   r   )r   r   r   r   setattrr   r   r   r   r	   r
   r   showassert_called_withr    r   	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)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   unittest.mockr   
matplotlibr	   r   r   matplotlib.backendsr   $matplotlib.backends.backend_templater   r   r   r!   r(   r*   r   r   r   r   <module>   s    