
    P/PhG                     p   d dl Z d dlZd dlZd dlZd dlZd dlmZ ej                            dg d          d             Z	ej        
                    ej        dk    d          ej        
                    ej        dk    o e j                    d k    d	          d
                         Zd Zd Zd ZdS )    N)subprocess_run_for_testingzversion_str, version_tuple))z3.5.0)      r   finalr   )z3.5.0rc2)r   r   r   	candidate   )z3.5.0.dev820+g6768ef8c4c)r   r   r   alpha4  )z3.5.0.post820+g6768ef8c4c)r   r      r	   r
   c                 :    t          j        |           |k    sJ d S )N)
matplotlib_parse_to_version_info)version_strversion_tuples     `/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/matplotlib/tests/test_matplotlib.pytest_parse_to_version_infor      s&     ,[99]JJJJJJ    win32z%chmod() doesn't work as is on Windows)reasonzchmod() doesn't work as rootc                 j   t          j        |           j        }	 t          j        | d           t	          t
          j        ddgi t           j        dt          |           it          j
        dd          }d|j        v sJ 	 t          j        | |           dS # t          j        | |           w xY w)	zETest that a warning is emitted if a temporary configdir must be used.r   -czimport matplotlibMPLCONFIGDIRT)envstderrtextcheckzset the MPLCONFIGDIRN)osstatst_modechmodr   sys
executableenvironstr
subprocessPIPEr   )tmp_pathmodeprocs      r   test_tmpconfigdir_warningr*      s     78$D!
1)^T#67=2:=~s8}}==?T; ; ; &44444
4     4    s   A(B B2c                 ~    t          t          j        ddgi t          j        dt          |           id           d S )Nr   zOimport pathlib; pathlib.Path.home = lambda *args: 1/0; import matplotlib.pyplotr   Tr   r   )r   r!   r"   r   r#   r$   )r'   s    r   test_importable_with_no_homer-   '   sX    	
$	% :rz9>3x==99	G G G G G Gr   c                  (   d } ddl m}m} t           | d                    t          |                    |j                            k    sJ t           | d                    t          |                    |j                            k    sJ dS )z
    Test that the standard backends mentioned in the docstring of
    matplotlib.use() are the same as in matplotlib.rcsetup.
    c                     g }t           j        j                            |           d                             d          D ]:}|                                s n#|d |                    d          D             z  };|S )Nr   
c                 ^    g | ]*}||                                                                 +S  )striplower).0es     r   
<listcomp>zAtest_use_doc_standard_backends.<locals>.parse.<locals>.<listcomp>9   s/    IIIqqI**IIIr   ,)r   use__doc__splitr3   )keybackendslines      r   parsez-test_use_doc_standard_backends.<locals>.parse4   s}    N*0055a8>>tDD 	J 	JD::<< IIDJJsOOIIIIHHr   r   )BackendFilterbackend_registryz- interactive backends:
z- non-interactive backends:
N)matplotlib.backendsr@   rA   setlist_builtinINTERACTIVENON_INTERACTIVE)r?   r@   rA   s      r   test_use_doc_standard_backendsrG   /   s    
   DCCCCCCC12233 --m.GHHIIJ J J J56677 --m.KLLMMN N N N N Nr   c                  j    d} t          t          j        dd| gi t          j        ddid           dS )	z
    When using -OO or export PYTHONOPTIMIZE=2, docstrings are discarded,
    this simple test may prevent something like issue #17970.
    zimport matplotlib as mpl; import matplotlib.pyplot as plt; import matplotlib.cbook as cbook; import matplotlib.patches as mpatchesz-OOr   
MPLBACKEND Tr,   N)r   r!   r"   r   r#   )programs    r   test_importable_with__OOrL   D   sS    	0  	g.,rz,<,,D
 
 
 
 
 
r   )r   r%   r!   pytestr   matplotlib.testingr   markparametrizer   skipifplatformgeteuidr*   r-   rG   rL   r2   r   r   <module>rT      sS   				     



      9 9 9 9 9 9 5 8 8 8  K K K CLG+B  D DCLG+A

0A9  ; ;! !; ;D D!G G GO O O*
 
 
 
 
r   