gL i6 ddlZddlZddlZddlmcmZddlZejdZ ejdZ dZ dZ dZ dZdZej d d Zd Zy) NcLtjd}t|dd|S)Npandas_dummy_backendplotcy)N used_dummy)argskwargss h/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pandas/tests/plotting/test_backend.pyzdummy_backend..s)types ModuleTypesetattr)dbs r dummy_backendr s%   0 1B B<= Ir c#jKtjdd5ddddy#1swYyxYww)z*Restore the plotting backend to matplotlibplotting.backend matplotlibN)pandasoption_contextrr r restore_backendrs0   1< @ s3' 303cd}tjt|5tjdddddtj j jdk(sJy#1swY3xYw)Nz9Could not find plotting backend 'not_an_existing_module'.matchrnot_an_existing_moduler)pytestraises ValueErrorr set_optionoptionsplottingbackendmsgs r test_backend_is_not_moduler&s` EC z -H,.FGH >> " " * *l :: :HHs A''A0c|jtjd|tjddtj ddk(sJtj jjd|usJy)Nrr) setitemsysmodulesrr get_optionr"_core_get_plot_backend) monkeypatchrrs r test_backend_is_correctr/!sl %;]K (*@A   / 04J JJ J//0FG=XXr c|jtjd|tjgd}tj ddk(sJ|j ddk(sJy)Nrrr)r#r)r(r)r*r DataFramer+rr.rrdfs r $test_backend_can_be_set_in_plot_callr8+s] %;]K   ) $B   / 0L @@ @ 7717 2l BB Br c|j||jtjd||dz }|j |dz j dt jjjd|usJt jdd5t jjj|usJ dddy#1swYyxYw)Nrzmy_backend-0.0.0.dist-infozentry_points.txts@[pandas_plotting_backends] my_ep_backend = pandas_dummy_backend my_ep_backendr) syspath_prependr(r)r*mkdir write_bytesrr"r,r-r)rtmp_pathr.r dist_infos r test_register_entrypointr@3s) %;]K77I OO##00M ?? 2 2? C} TT T   1? CJ$$668MIIIJJJs -CCctjd}|jtjd|t j jjdk(sJtjtd5t jdddddt j jjdk(sJy#1swY3xYw)Npandas_plot_backendrz6Could not find plotting backend 'pandas_plot_backend'.rr) rrr(r)r*rr!r"r#rrrr )r.modules r (test_setting_backend_without_plot_raisesrDEs   3 4F %:FC >> " " * *l :: : R E ,.CDE >> " " * *l :: : EEs ;CC rcd}tjt|5tjj j ddddy#1swYyxYw)NzVmatplotlib is required for plotting when the default backend "matplotlib" is selected.rr)rr ImportErrorrr"r,r-r$s r test_no_matplotlib_okrGSsI  {# .>// =>>>s *AAc|jtjd|tjddtj dgdi}|j dy)NrrAr1znot a real kind)kind)r(r)r*rr r5rr6s r test_extra_kinds_okrK]sO %;]K (*@A   3 * +BGG"G#r )r)rrpandas.util._test_decoratorsutil_test_decoratorstdrfixturerrr&r/r8r@rDskip_if_installedrGrKrr r rRs ))   ;CJ$ ;l#>$>$r