ó
    “’¤jÉ  ã                   ó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   Úalphaé4  )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     Ú®C:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\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                  5        S3UR                  ;   d   e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MPLCONFIGDIR (Ú)zset the MPLCONFIGDIRN)ÚosÚstatÚst_modeÚchmodr   ÚsysÚ
executableÚenvironÚstrÚ
subprocessÚPIPEÚresolver   )Útmp_pathÚmodeÚprocs      r   Útest_tmpconfigdir_warningr.      s¸   € ô �7Š7�8Ó×$Ñ$€Dð	!Ü
�Š�˜1ÔÜ)Ü�^‰^˜TÐ#6Ð7Ø=”2—:‘:Ð=˜~¬s°8«}Ñ=Ü—?‘?¨°Tñ;ˆð   × 0Ñ 0Ó 2Ð3°1Ð5¸¿¹ÓDÐDÐDØ%¨¯©Ó4Ð4Ñ4ä
�Š�Õ øŒ�Š�Õ ús   ¢BC Ã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_homer1   )   s9   € ÜÜ	�‰˜ð
$ð	%ð :Œr�z‰zÐ9˜>¬3¨x«=Ñ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>.parse6   sŠ   € ØˆÜ—N‘N×*Ñ*×0Ñ0°Ó5°aÑ8×>Ñ>¸tÖDˆDØ—:‘:—<‘<Øàˆð ·J±J¸s´OÓI²O¨qÃqÓ*˜Ÿ™›Ÿ™Ö*±OÑIÑIŠHñ Eð ˆùò Js   Á,
B'Á:"B'r   )ÚBackendFilterÚbackend_registryz- interactive backends:
z- non-interactive backends:
N)Úmatplotlib.backendsrA   rB   ÚsetÚlist_builtinÚINTERACTIVEÚNON_INTERACTIVE)r?   rA   rB   s      r   Útest_use_doc_standard_backendsrH   1   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.
z‚import matplotlib as mpl; import matplotlib.pyplot as plt; import matplotlib.cbook as cbook; import matplotlib.patches as mpatchesz-OOr   Ú
MPLBACKENDÚ Tr0   N)r   r$   r%   r    r&   )Úprograms    r   Útest_importable_with__OOrM   F   s;   € ð	0ð ô Ü	�‰˜  gÐ.Ø,Œr�z‰zÐ,˜<¨Ñ,°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]   W   sR   € ô %/×$=Ò$=À6À(ÐTVÑ$WÐÔ!ä	�Š”z×9Ñ9ÀÓ	MÜ×'Ñ'×3Ñ3°JÔ?÷ 
N×	MÖ	Mús   ¿ 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())rK   ©ÚLOCALAPPDATAÚUSERPROFILEr   ©r   Úcapture_outputr   r   r   N©	Úmkdirr   r$   r%   r    r&   r'   Ústdoutr9   )r+   ÚlocalappdataÚ	fake_homer-   Ú	configdirs        r   Ú+test_configdir_uses_localappdata_on_windowsrp   d   sª   € ð ˜oÑ-€LØ×Ñ˜tÐÑ$à˜6Ñ!€IØ‡O�OÔä%Ü	�‰˜Ø	?ð	Að@Œr�z‰zð @¬3¨|Ó+<Ü 	›N¸Bò@à $¨dñ4€Dð —‘×!Ñ!Ó#€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`   Tra   rc   z.matplotlibr   rd   rK   re   rh   Nrj   )r+   rm   rn   Úold_configdirr-   ro   s         r   Ú4test_configdir_uses_userprofile_on_windows_if_existsrs   y   s»   € ð ˜oÑ-€LØ×Ñ˜tÐÑ$Ø˜6Ñ!€IØ‡O�OÔØ Ñ-€MØ×ÑÔä%Ü	�‰˜Ø	?ð	Að@Œr�z‰zð @¬3¨|Ó+<Ü 	›N¸Bò@à $¨dñ4€Dð —‘×!Ñ!Ó#€Iàœ˜MÓ*Ó*Ð*Ñ*r   )r    r(   r$   Úunittest.mockr   rW   r   Úmatplotlib.testingr   ÚmarkÚparametrizer   ÚskipifÚplatformÚgeteuidr.   r1   rH   rM   r]   rp   rs   © r   r   Ú<module>r|      sN  ðÛ 	Û Û 
Ý ã ã Ý 9ð ‡�×ÑÐ5ò 8ó ñKóðKð ‡�×Ñ�C—L‘LÐ(;Ñ;ØBð ð Dà‡�×Ñ�C—L‘LÐ$7Ñ7×M¸B¿JºJ»LÈAÑ<MØ9ð ð ;ñ!ó;óDð!òGòOò*
ñ" Ð+Ó,ñ	@ó -ð	@ð ‡�×Ñ�C—L‘L GÑ+Ð4KÐÐLñ9ó Mð9ð( ‡�×Ñ�C—L‘L GÑ+Ð4KÐÐLñ+ó Mñ+r   