|
7 | 7 | import matplotlib.colors as mcolors
|
8 | 8 | import matplotlib.widgets as widgets
|
9 | 9 | import matplotlib.pyplot as plt
|
10 |
| -from matplotlib.patches import Rectangle |
11 |
| -from matplotlib.lines import Line2D |
12 | 10 | from matplotlib.testing.decorators import check_figures_equal, image_comparison
|
13 | 11 | from matplotlib.testing.widgets import (click_and_drag, do_event, get_ax,
|
14 | 12 | mock_event, noop)
|
@@ -1055,16 +1053,10 @@ def test_check_radio_buttons_image():
|
1055 | 1053 |
|
1056 | 1054 | rax1 = fig.add_axes((0.05, 0.7, 0.2, 0.15))
|
1057 | 1055 | rb1 = widgets.RadioButtons(rax1, ('Radio 1', 'Radio 2', 'Radio 3'))
|
1058 |
| - with pytest.warns(DeprecationWarning, |
1059 |
| - match='The circles attribute was deprecated'): |
1060 |
| - rb1.circles # Trigger the old-style elliptic radiobuttons. |
1061 | 1056 |
|
1062 | 1057 | rax2 = fig.add_axes((0.05, 0.5, 0.2, 0.15))
|
1063 | 1058 | cb1 = widgets.CheckButtons(rax2, ('Check 1', 'Check 2', 'Check 3'),
|
1064 | 1059 | (False, True, True))
|
1065 |
| - with pytest.warns(DeprecationWarning, |
1066 |
| - match='The rectangles attribute was deprecated'): |
1067 |
| - cb1.rectangles # Trigger old-style Rectangle check boxes |
1068 | 1060 |
|
1069 | 1061 | rax3 = fig.add_axes((0.05, 0.3, 0.2, 0.15))
|
1070 | 1062 | rb3 = widgets.RadioButtons(
|
@@ -1164,57 +1156,6 @@ def test_check_button_props(fig_test, fig_ref):
|
1164 | 1156 | cb.set_check_props({**check_props, 's': (24 / 2)**2})
|
1165 | 1157 |
|
1166 | 1158 |
|
1167 |
| -@check_figures_equal(extensions=["png"]) |
1168 |
| -def test_check_buttons_rectangles(fig_test, fig_ref): |
1169 |
| - # Test should be removed once .rectangles is removed |
1170 |
| - cb = widgets.CheckButtons(fig_test.subplots(), ["", ""], |
1171 |
| - [False, False]) |
1172 |
| - with pytest.warns(DeprecationWarning, |
1173 |
| - match='The rectangles attribute was deprecated'): |
1174 |
| - cb.rectangles |
1175 |
| - ax = fig_ref.add_subplot(xticks=[], yticks=[]) |
1176 |
| - ys = [2/3, 1/3] |
1177 |
| - dy = 1/3 |
1178 |
| - w, h = dy / 2, dy / 2 |
1179 |
| - rectangles = [ |
1180 |
| - Rectangle(xy=(0.05, ys[i] - h / 2), width=w, height=h, |
1181 |
| - edgecolor="black", |
1182 |
| - facecolor="none", |
1183 |
| - transform=ax.transAxes |
1184 |
| - ) |
1185 |
| - for i, y in enumerate(ys) |
1186 |
| - ] |
1187 |
| - for rectangle in rectangles: |
1188 |
| - ax.add_patch(rectangle) |
1189 |
| - |
1190 |
| - |
1191 |
| -@check_figures_equal(extensions=["png"]) |
1192 |
| -def test_check_buttons_lines(fig_test, fig_ref): |
1193 |
| - # Test should be removed once .lines is removed |
1194 |
| - cb = widgets.CheckButtons(fig_test.subplots(), ["", ""], [True, True]) |
1195 |
| - with pytest.warns(DeprecationWarning, |
1196 |
| - match='The lines attribute was deprecated'): |
1197 |
| - cb.lines |
1198 |
| - for rectangle in cb._rectangles: |
1199 |
| - rectangle.set_visible(False) |
1200 |
| - ax = fig_ref.add_subplot(xticks=[], yticks=[]) |
1201 |
| - ys = [2/3, 1/3] |
1202 |
| - dy = 1/3 |
1203 |
| - w, h = dy / 2, dy / 2 |
1204 |
| - lineparams = {'color': 'k', 'linewidth': 1.25, |
1205 |
| - 'transform': ax.transAxes, |
1206 |
| - 'solid_capstyle': 'butt'} |
1207 |
| - for i, y in enumerate(ys): |
1208 |
| - x, y = 0.05, y - h / 2 |
1209 |
| - l1 = Line2D([x, x + w], [y + h, y], **lineparams) |
1210 |
| - l2 = Line2D([x, x + w], [y, y + h], **lineparams) |
1211 |
| - |
1212 |
| - l1.set_visible(True) |
1213 |
| - l2.set_visible(True) |
1214 |
| - ax.add_line(l1) |
1215 |
| - ax.add_line(l2) |
1216 |
| - |
1217 |
| - |
1218 | 1159 | def test_slider_slidermin_slidermax_invalid():
|
1219 | 1160 | fig, ax = plt.subplots()
|
1220 | 1161 | # test min/max with floats
|
|
0 commit comments