
    
3j                     R   S SK r S SKrS SKrS SKJr  S SKrS SKrS SKJr  \R                  R                  S/ SQ5      S 5       r\R                  R                  \R                  S;  SS	9\R                  R                  \R                  S;   =(       a    \ R                  " 5       S :H  S
S	9S 5       5       rS rS rS r\" S5      S 5       r\R                  R                  \R                  S:g  SS	9S 5       r\R                  R                  \R                  S:g  SS	9S 5       rg)    N)patch)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                 <    [         R                  " U 5      U:X  d   eg )N)
matplotlib_parse_to_version_info)version_strversion_tuples     Z/home/wildlama/miniconda3/lib/python3.13/site-packages/matplotlib/tests/test_matplotlib.pytest_parse_to_version_infor      s     ,,[9]JJJ    )linuxdarwinz%chmod() doesn't work on this platform)reasonzchmod() doesn't work as rootc                    [         R                  " U 5      R                  n [         R                  " U S5        [	        [
        R                  SS/0 [         R                  ES[        U 5      0E[        R                  SSS9nSUR                  ;   d   e [         R                  " X5        g! [         R                  " X5        f = f)	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     778$$D!
1)^^T#67=2::=~s8}=??T; &444
  s   A2B, ,Cc                 v    [        [        R                  SS/0 [        R                  ES[        U 5      0ESS9  g )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/   (   s9    	
$	% :rzz9>3x=9	Gr   c                      S n SSK JnJn  [        U " S5      5      [        UR	                  UR
                  5      5      :X  d   e[        U " S5      5      [        UR	                  UR                  5      5      :X  d   eg)zw
Test that the standard backends mentioned in the docstring of
matplotlib.use() are the same as in matplotlib.rcsetup.
c                 X   / n[         R                  R                  R                  U 5      S   R                  S5       Hc  nUR	                  5       (       d    U$ XR                  S5       Vs/ s H)  o3(       d  M  UR	                  5       R                  5       PM+     sn-  nMe     U$ s  snf )Nr   
,)r   use__doc__splitstriplower)keybackendslinees       r   parse-test_use_doc_standard_backends.<locals>.parse5   s    NN**005a8>>tDD::<< JJsOIOqq**OIIH E  Js   ,
B':"B'r   )BackendFilterbackend_registryz- interactive backends:
z- non-interactive backends:
N)matplotlib.backendsr?   r@   setlist_builtinINTERACTIVENON_INTERACTIVE)r=   r?   r@   s      r   test_use_doc_standard_backendsrF   0   s    
 D123 --m.G.GHIJ K J567 --m.K.KLMN O Nr   c                  j    Sn [        [        R                  SSU /0 [        R                  ESS0ESS9  g)	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__OOrK   E   s;    	0  	g.,rzz,<,D
r   z"matplotlib.subprocess.check_outputc                     [         R                  " S/SS9U l        [        R                  " [
        R                  SS9   [
        R                  R                  S5        SSS5        g! , (       d  f       g= f)zY
Test that _get_executable_info raises ExecutableNotFoundError if the
command times out.
mock   )cmdtimeoutz	Timed out)matchinkscapeN)	r'   TimeoutExpiredside_effectpytestraisesr   ExecutableNotFoundError_get_executable_info__wrapped__)mock_check_outputs    r    test_get_executable_info_timeoutr[   V   sR     %/$=$=6(TV$W!	z99	M''33J? 
N	M	Ms    A((
A6win32zWindows-specific testc                 >   U S-  nUR                  SS9  U S-  nUR                  5         [        [        R                  SS/0 [        R
                  E[        U5      [        U5      SS.ESSSS	9nUR                  R                  5       nU[        US
-  5      :X  d   eg)zLTest that on Windows, config/cache dir uses LOCALAPPDATA for fresh installs.AppData/LocalTparentshomer   4import matplotlib; print(matplotlib.get_configdir())rI   LOCALAPPDATAUSERPROFILEr   r   capture_outputr   r   r   N	mkdirr   r#   r$   r   r%   r&   stdoutr7   )r)   localappdata	fake_homer+   	configdirs        r   +test_configdir_uses_localappdata_on_windowsrn   c   s     o-Lt$6!IOO%		?	A@rzz @3|+<	NB@$d4D !!#IL<78888r   c                 b   U S-  nUR                  SS9  U S-  nUR                  5         US-  nUR                  5         [        [        R                  SS/0 [        R
                  E[        U5      [        U5      SS	.ESSSS
9nUR                  R                  5       nU[        U5      :X  d   eg)zR
Test that on Windows, config/cache dir uses %USERPROFILE% if .matplotlib
exists.
r^   Tr_   ra   z.matplotlibr   rb   rI   rc   rf   Nrh   )r)   rk   rl   old_configdirr+   rm   s         r   4test_configdir_uses_userprofile_on_windows_if_existsrq   x   s     o-Lt$6!IOO-M%		?	A@rzz @3|+<	NB@$d4D !!#IM****r   )r   r'   r#   unittest.mockr   rU   r   matplotlib.testingr   markparametrizer   skipifplatformgeteuidr,   r/   rF   rK   r[   rn   rq    r   r   <module>rz      sN   	  
    9 5 8 KK CLL(;;B  DCLL$77MBJJLA<M9  ;!;D!GO*
" +,	@ -	@ CLLG+4KL9 M9( CLLG+4KL+ M+r   