Tests what https://github.com/matplotlib/matplotlib/pull/31031 fixed
(ax, widget)
| 1244 | |
| 1245 | @pytest.mark.parametrize("widget", [widgets.RadioButtons, widgets.CheckButtons]) |
| 1246 | def 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 | |
| 1263 | def test_slider_slidermin_slidermax_invalid(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…