MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test__buttons_callbacks

Function test__buttons_callbacks

lib/matplotlib/tests/test_widgets.py:1246–1260  ·  view source on GitHub ↗

Tests what https://github.com/matplotlib/matplotlib/pull/31031 fixed

(ax, widget)

Source from the content-addressed store, hash-verified

1244
1245@pytest.mark.parametrize("widget", [widgets.RadioButtons, widgets.CheckButtons])
1246def test__buttons_callbacks(ax, widget):
1247 """Tests what https://github.com/matplotlib/matplotlib/pull/31031 fixed"""
1248 on_clicked = mock.Mock(spec=noop, return_value=None)
1249 button = widget(ax, ["Test Button"])
1250 button.on_clicked(on_clicked)
1251 MouseEvent._from_ax_coords(
1252 "button_press_event",
1253 ax,
1254 ax.transData.inverted().transform(ax.transAxes.transform(
1255 # (x, y) of the 0th button defined at `_Buttons._init_layout`
1256 (0.15, 0.5),
1257 )),
1258 1,
1259 )._process()
1260 on_clicked.assert_called_once()
1261
1262
1263def test_slider_slidermin_slidermax_invalid():

Callers

nothing calls this directly

Calls 5

_processMethod · 0.80
on_clickedMethod · 0.45
_from_ax_coordsMethod · 0.45
transformMethod · 0.45
invertedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…