rL iddlZddlZddlZddlmZdZdZej ddZej dZej d Z ej d Z y) N)_apicdD]\}}|j||tjdddt_tjy)N))markersz*flaky: (Provided by pytest-rerunfailures.))rz&timeout: (Provided by pytest-timeout.))rz6backend: Set alternate Matplotlib backend temporarily.)rz3baseline_images: Compare output against references.)rz.pytz: Tests that require pytz to be installed.)filterwarningserror)rz?ignore:.*The py23 module has been deprecated:DeprecationWarning)rz]ignore:DynamicImporter.find_spec\(\) not found; falling back to find_module\(\):ImportWarningaggT)force)addinivalue_line matplotlibuse_called_from_pytest _init_tests)configkeyvalues a/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/testing/conftest.pypytest_configurersM  , U U+ ,NN5%%)J"cdt_y)NF)r r )rs rpytest_unconfigurer s %*J"rT)autousec # Kddlm}|5d}|jjd}t j }|t |jdk(sJd|j\}|jjdd}|jjdr'td d Drtjd tjj!t#j$5|ddlm} |j+|tj.j1ddgddd d|'j3dt j0| dddy#t,$r<}d |jvsrtjd |d|dnYd}~d}~wwxYw#1swYxYw#|'j3dt j0|wwxYw#1swYyxYww)Nr) _cleanup_cmbackendz(Marker 'backend' must specify 1 backend.skip_on_importerrorFqt5c3ZK|]#}tjj|%yw)N)sysmodulesget).0ks r z$mpl_test_settings..6sGas{{q)Gs)+)PyQt4PySidezQt4 binding already importedcairozFailed to switch to backend z (z).classic_classic_test_patchall)matplotlib.testing.decoratorsrnodeget_closest_markerr get_backendlenargskwargsr!lower startswithanypytestskiptestingsetupr'suppress_matplotlib_deprecation_warningmatplotlib.pyplotpyplotswitch_backend ImportErrorstyler close)requestrrbackend_marker prev_backendrpltexcs rmpl_test_settingsrE$s9 (- 88C!--/  %~**+q0 ;: ;0%**HG"0"7"7";";%u#. }}))%0G3FGGKK >?  "  9 9 ; E"0 &&w/    )-B!C D! E" - " % |,Q(-(-2#'--/15H $B'.ir#b%:;;  E E(" % |,#M(-(-swHC5H GF !GH G)H7 H G 2G;GGGG H+G??HH Hcltjd} ddlm}||S#t$rY|SwxYw)a Fixture to import and configure pandas. Using this fixture, the test is skipped when pandas is not installed. Use this fixture instead of importing pandas in test files. Examples -------- Request the pandas fixture by passing in ``pd`` as an argument to the test :: def test_matshow_pandas(pd): df = pd.DataFrame({'x':[1,2,3], 'y':[4,5,6]}) im = plt.figure().subplots().matshow(df) np.testing.assert_array_equal(im.get_array(), df) pandasr) deregister_matplotlib_converters)r5 importorskippandas.plottingrHr=)pd deregisters rrKrKSsC   X &B  <  I   I s & 33c0tjd}|S)a Fixture to import xarray so that the test is skipped when xarray is not installed. Use this fixture instead of importing xrray in test files. Examples -------- Request the xarray fixture by passing in ``xr`` as an argument to the test :: def test_imshow_xarray(xr): ds = xr.DataArray(np.random.randn(2, 3)) im = plt.figure().subplots().imshow(ds) np.testing.assert_array_equal(im.get_array(), ds) xarray)r5rI)xrs rrOrOms"   X &B Ircjddlmd}fd}|jd||jd|y)aH Replace texts with placeholder rectangles. The rectangle size only depends on the font size and the number of characters. It is thus insensitive to font properties and rendering details. This should be used for tests that depend on text geometries but not the actual text rendering, e.g. layout tests. r) RectanglecR|j}t||zdz }d}|||fS)a Replace ``_get_text_metrics_with_cache`` with fixed results. The usual ``renderer.get_text_width_height_descent`` would depend on font metrics; instead the fixed results are based on font size and the length of the string only. gS?r)get_sizer/)renderertextfontpropismathdpiheightwidthdescents r#patched_get_text_metrics_with_cachez>text_placeholders..patched_get_text_metrics_with_caches7""$D F"U*fg%%rc|||_|jsy|jdk(ry|j}|j|j |j |jd}|j|y)z Replace ``Text.draw`` with a fixed bounding box Rectangle. The bounding box corresponds to ``Text.get_window_extent``, which ultimately depends on the above patched ``_get_text_metrics_with_cache``. Nnone) facecolor edgecolor) _renderer get_visibleget_textget_window_extentp0rZrY get_colordraw)selfrTbboxrectrQs rpatched_text_drawz,text_placeholders..patched_text_drawsu  %DN!  ==?b %%'$**dkk#'>>#3vG (rz,matplotlib.text._get_text_metrics_with_cachezmatplotlib.text.Text.drawN)matplotlib.patchesrQsetattr) monkeypatchr\rlrQs @rtext_placeholdersrps:-& $F;=35FGr) r5rr rrrfixturerErKrOrprrrss 2++-+-\2(/H/Hr