Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit babc377

Browse files
committed
Move cleanup to the individual checks
1 parent cf66812 commit babc377

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/matplotlib/tests/test_widgets.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def get_event(ax, button=1, xdata=0, ydata=0, key=None, step=1):
6363
return event
6464

6565

66+
@cleanup
6667
def check_rectangle(**kwargs):
6768
ax = plt.gca()
6869
ax.plot([0, 200], [0, 200])
@@ -87,7 +88,6 @@ def onselect(epress, erelease):
8788
assert ax._got_onselect
8889

8990

90-
@cleanup
9191
def test_rectangle_selector():
9292
check_rectangle()
9393
check_rectangle(drawtype='line', useblit=False)
@@ -97,6 +97,7 @@ def test_rectangle_selector():
9797
check_rectangle(rectprops=dict(fill=True))
9898

9999

100+
@cleanup
100101
def check_span(*args, **kwargs):
101102
ax = plt.gca()
102103
ax.plot([0, 200], [0, 200])
@@ -130,13 +131,13 @@ def onmove(vmin, vmax):
130131
assert ax._got_on_move
131132

132133

133-
@cleanup
134134
def test_span_selector():
135135
check_span('horizontal', minspan=10, useblit=True)
136136
check_span('vertical', onmove_callback=True, button=1)
137137
check_span('horizontal', rectprops=dict(fill=True))
138138

139139

140+
@cleanup
140141
def check_lasso_selector(**kwargs):
141142
ax = plt.gca()
142143
ax.plot([0, 200], [0, 200])
@@ -159,7 +160,6 @@ def onselect(verts):
159160
assert ax._got_onselect
160161

161162

162-
@cleanup
163163
def test_lasso_selector():
164164
check_lasso_selector()
165165
check_lasso_selector(useblit=False, lineprops=dict(color='red'))

0 commit comments

Comments
 (0)