
    P/Ph                        d dl Z d dlZd dlmZ d dlZd dlmZ 	 d dl	m
Z
 n# e$ r  ej        dd           Y nw xY wej                            d          d             Zej                            d          d	             Zej                            d          d
             Zej                            d          d             ZdS )    N)mock)_macosxzThese are mac only testsT)allow_module_levelmacosxc                  0   t          j        d          } | j                                         | j                                        j        J t          j        d          } |                                  | j                                        j        J d S )N      )pltfigurecanvasdrawget_renderer	_rendererdraw_without_rendering)figs    d/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/matplotlib/tests/test_backend_macosx.pytest_cached_rendererr      s     *Q--CJOO:""$$.:::
*Q--C   :""$$.:::::    c                    fd}|                      t          d|           t          j                    }t	          j        di          5  |j        j                                          d|j        	                                 }t          j                            |          sJ t          j        d          dk    sJ 	 d d d            d S # 1 swxY w Y   d S )Nc                 j    |t                    k    sJ t          j        | d           | d| S )N/test/test/)strosmakedirs)title	directoryfilenametmp_paths      r   new_choose_save_filez2test_savefig_rcparam.<locals>.new_choose_save_file   sI     CMM))))
y'''(((--8---r   choose_save_filezsavefig.directoryr   r   )setattrr   r
   r   mpl
rc_contextr   toolbarsave_figureget_default_filenamer   pathexistsrcParams)monkeypatchr   r    r   	save_files    `   r   test_savefig_rcparamr-      sJ   . . . . . !35IJJJ
*,,C	,h7	8	8 G G
&&(((JJsz'F'F'H'HJJ	w~~i((((( |/0x4F4F4FFFFFFG G G G G G G G G G G G G G G G G Gs   A9CCCc                  0    ddl m}   | dddd           d S )Nr   ipython_in_subprocessosxr   MacOSX))      )   r   )matplotlib.testingr0   r/   s    r   test_ipythonr7   2   s5    888888%8X!F!FGGGGGr   c                     t          j                    \  } }|                    dgg           d}t          j        |d          5  | j        j        j                                        }t          j
        d           |dk    sJ 	 d d d            n# 1 swxY w Y   t          j        |d           5  | j        j        j                                        }|J 	 d d d            d S # 1 swxY w Y   d S )Nr   z,matplotlib.backends._macosx.choose_save_filez
foobar.png)return_value)r
   subplotsimshowr   patchr   managerr%   r&   r   remove)r   axpropfnames       r   test_save_figure_returnrB   8   sr   lnnGCIIse9D	D|	4	4	4 % %
"*6688
	,$$$$$% % % % % % % % % % % % % % % 
Dt	,	,	,  
"*6688}}}}                 s%   A BBB4(C**C.1C.)r   pytestunittestr   
matplotlibr#   matplotlib.pyplotpyplotr
   matplotlib.backendsr   ImportErrorskipmarkbackendr   r-   r7   rB    r   r   <module>rN      s_   				                 E+++++++ E E EFK*tDDDDDDE X	; 	; 	; XG G G, XH H H
 X
 
 
 
 
s   ! ;;