rL i( ddlZddlZddlZddlmZddlZddlZddlmZejjdgddZ ejjejdk(d ejjejdk7xrejdk(d d Zd Zd ZdZeddZy)N)patch)subprocess_run_for_testingzversion_str, version_tuple))z3.5.0)rfinalr)z3.5.0rc2)rrr candidate)z3.5.0.dev820+g6768ef8c4c)rrralpha4)z3.5.0.post820+g6768ef8c4c)rrr r c8tj||k(sJy)N) matplotlib_parse_to_version_info) version_str version_tuples f/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/tests/test_matplotlib.pytest_parse_to_version_infor s  , ,[ 9] JJ Jwin32z%chmod() doesn't work as is on Windows)reasonzchmod() doesn't work as rootctj|j} tj|dt t j ddgitjdt|itjdd}d|jvsJ tj||y#tj||wxYw) zETest that a warning is emitted if a temporary configdir must be used.r-czimport matplotlib MPLCONFIGDIRT)envstderrtextcheckzset the MPLCONFIGDIRN) osstatst_modechmodrsys executableenvironstr subprocessPIPEr)tmp_pathmodeprocs rtest_tmpconfigdir_warningr+s 778  $ $D! 1) ^^T#6 7=2::=~s8}=??T;&444 4 4 s A2B++Cc|ttjddgitjdt |idy)NrzOimport pathlib; pathlib.Path.home = lambda *args: 1/0; import matplotlib.pyplotrTrr)rr"r#rr$r%)r(s rtest_importable_with_no_homer.(s9  $ % :rzz 9>3x= 9 Grcd}ddlm}m}t|dt|j |j k(sJt|dt|j |j k(sJy)z Test that the standard backends mentioned in the docstring of matplotlib.use() are the same as in matplotlib.rcsetup. c<g}tjjj|djdD]V}|j s|S||jdDcgc]#}|s|j j %c}z }X|Scc}w)Nr  ,)ruse__doc__splitstriplower)keybackendslinees rparsez-test_use_doc_standard_backends..parse5sNN**005a8>>tD JD::< DJJsOIqq*I IH JJs (B0 Br) BackendFilterbackend_registryz- interactive backends: z- non-interactive backends: N)matplotlib.backendsr=r>set list_builtin INTERACTIVENON_INTERACTIVE)r<r=r>s rtest_use_doc_standard_backendsrD0s D 12 3  --m.G.GH I JK J 56 7  --m.K.KL M NO Nrcpd}ttjdd|gitjddidy) 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 MPLBACKENDTr-N)rr"r#rr$)programs rtest_importable_with__OOrIEs;  0  g. ,rzz ,< ,D rz"matplotlib.subprocess.check_outputctjdgd|_tjt j d5t jjddddy#1swYyxYw)ze Test that _get_executable_info raises ExecutableNotFoundError if the command times out. mock)cmdtimeoutz Timed out)matchinkscapeN) r&TimeoutExpired side_effectpytestraisesrExecutableNotFoundError_get_executable_info __wrapped__)mock_check_outputs r test_get_executable_info_timeoutrYVs^%/$=$=6(TV$W! z99 M@''33J?@@@s  A,,A5)rr&r" unittest.mockrrSrmatplotlib.testingrmark parametrizerskipifplatformgeteuidr+r.rDrIrYrrrbs   958 K  KCLLG+BDCLLG+A  0A9; !;D !GO* "+, @- @r