rL iddlZddlZddlmZddlZddlmZ ddl m Z ejjddZejjdd Zejjdd Zejjdd Zy#e $rejddYwxYw) N)mock)_macosxzThese are mac only testsT)allow_module_levelmacosxcDtjd}|jj|jj j Jtjd}|j |jj j Jy)N)pltfigurecanvasdraw get_renderer _rendererdraw_without_rendering)figs j/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/tests/test_backend_macosx.pytest_cached_rendererrsv **Q-CJJOO :: " " $ . . :: : **Q-C :: " " $ . . :: :cfd}|jtd|tj}t j di5|j jjd|j j}tjj|sJtjddk(sJ dddy#1swYyxYw)Ncb|tk(sJtj|d|d|S)N/test/test/)strosmakedirs)title directoryfilenametmp_paths rnew_choose_save_filez2test_savefig_rcparam..new_choose_save_files;CM))) yk'(F8*--rchoose_save_filezsavefig.directoryrr)setattrrr r mpl rc_contextr toolbar save_figureget_default_filenamerpathexistsrcParams) monkeypatchrr r save_files ` rtest_savefig_rcparamr-s.!35IJ **,C ,h7 8G &&(jszz'F'F'H&IJ ww~~i(((||/0xj4FFFFGGGs BCCc(ddlm}|ddddy)Nripython_in_subprocessosxrMacOSX)))r)matplotlib.testingr0r/s r test_ipythonr72s8%8X!FGrctj\}}|jdggd}tj|d5|j j jj}tjd|dk(sJ dddtj|d5|j j jj}|J dddy#1swY]xYw#1swYyxYw)Nrz,matplotlib.backends._macosx.choose_save_filez foobar.png) return_value) r subplotsimshowrpatchr managerr%r&rremove)raxpropfnames rtest_save_figure_returnrB8sllnGCIIse 9D D| 4% ""**668 , $$$% Dt , ""**668}} %%sA C,/3C8,C58D)rpytestunittestr matplotlibr#matplotlib.pyplotpyplotr matplotlib.backendsr ImportErrorskipmarkbackendrr-r7rBrrrNs E+ X ; ;XGG,XHH X  _EFKK*tDEsB%%CC