(fig_test, fig_ref)
| 1221 | |
| 1222 | @check_figures_equal() |
| 1223 | def test_check_button_props(fig_test, fig_ref): |
| 1224 | label_props = {'color': ['red'], 'fontsize': [24]} |
| 1225 | frame_props = {'facecolor': 'green', 'edgecolor': 'blue', 'linewidth': 2} |
| 1226 | check_props = {'facecolor': 'red', 'linewidth': 2} |
| 1227 | |
| 1228 | widgets.CheckButtons(fig_ref.subplots(), ['tea', 'coffee'], [True, True], |
| 1229 | label_props=label_props, frame_props=frame_props, |
| 1230 | check_props=check_props) |
| 1231 | |
| 1232 | cb = widgets.CheckButtons(fig_test.subplots(), ['tea', 'coffee'], |
| 1233 | [True, True]) |
| 1234 | cb.set_label_props(label_props) |
| 1235 | # Setting the label size automatically increases default marker size, so we |
| 1236 | # need to do that here as well. |
| 1237 | cb.set_frame_props({**frame_props, 's': (24 / 2)**2}) |
| 1238 | # FIXME: Axes.scatter promotes facecolor to edgecolor on unfilled markers, |
| 1239 | # but Collection.update doesn't do that (it forgot the marker already). |
| 1240 | # This means we cannot pass facecolor to both setters directly. |
| 1241 | check_props['edgecolor'] = check_props.pop('facecolor') |
| 1242 | cb.set_check_props({**check_props, 's': (24 / 2)**2}) |
| 1243 | |
| 1244 | |
| 1245 | @pytest.mark.parametrize("widget", [widgets.RadioButtons, widgets.CheckButtons]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…