Skip to content

Commit 569a225

Browse files
committed
Use ax fixture in more widget tests
1 parent 8332a74 commit 569a225

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/matplotlib/tests/test_widgets.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ def test_rectangle_minspan(ax, spancoords, minspanx, x1, minspany, y1):
9797
assert kwargs == {}
9898

9999

100-
def test_deprecation_selector_visible_attribute():
101-
ax = get_ax()
100+
def test_deprecation_selector_visible_attribute(ax):
102101
tool = widgets.RectangleSelector(ax, lambda *args: None)
103102

104103
assert tool.get_visible()
@@ -856,8 +855,8 @@ def test_span_selector_animated_artists_callback():
856855
values = np.sin(x)
857856

858857
fig, ax = plt.subplots()
859-
(ln,) = ax.plot(x, values, animated=True)
860-
(ln2, ) = ax.plot([], animated=True)
858+
ln, = ax.plot(x, values, animated=True)
859+
ln2, = ax.plot([], animated=True)
861860

862861
# spin the event loop to let the backend process any pending operations
863862
# before drawing artists
@@ -996,8 +995,7 @@ def test_TextBox(ax, toolbar):
996995

997996

998997
@image_comparison(['check_radio_buttons.png'], style='mpl20', remove_text=True)
999-
def test_check_radio_buttons_image():
1000-
ax = get_ax()
998+
def test_check_radio_buttons_image(ax):
1001999
# Remove this line when this test image is regenerated.
10021000
plt.rcParams['text.kerning_factor'] = 6
10031001

0 commit comments

Comments
 (0)