8000 Improved selection widget by blink1073 · Pull Request #3502 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Improved selection widget #3502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Nov 13, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move cleanup to the individual checks
  • Loading branch information
blink1073 committed Nov 12, 2014
commit babc377a5d22a320af30261bc65519fc376cd15b
6 changes: 3 additions & 3 deletions lib/matplotlib/tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def get_event(ax, button=1, xdata=0, ydata=0, key=None, step=1):
return event


@cleanup
def check_rectangle(**kwargs):
ax = plt.gca()
ax.plot([0, 200], [0, 200])
Expand All @@ -87,7 +88,6 @@ def onselect(epress, erelease):
assert ax._got_onselect


@cleanup
def test_rectangle_selector():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a @cleanup (from matplotlib.testing.decorators) to this. I suspect that the other failing tests are due the artists form this test leaking out.

check_rectangle()
check_rectangle(drawtype='line', useblit=False)
Expand All @@ -97,6 +97,7 @@ def test_rectangle_selector():
check_rectangle(rectprops=dict(fill=True))


@cleanup
def check_span(*args, **kwargs):
ax = plt.gca()
ax.plot([0, 200], [0, 200])
Expand Down Expand Up @@ -130,13 +131,13 @@ def onmove(vmin, vmax):
assert ax._got_on_move


@cleanup
def test_span_selector():
check_span('horizontal', minspan=10, useblit=True)
check_span('vertical', onmove_callback=True, button=1)
check_span('horizontal', rectprops=dict(fill=True))


@cleanup
def check_lasso_selector(**kwargs):
ax = plt.gca()
ax.plot([0, 200], [0, 200])
Expand All @@ -159,7 +160,6 @@ def onselect(verts):
assert ax._got_onselect


@cleanup
def test_lasso_selector():
check_lasso_selector()
check_lasso_selector(useblit=False, lineprops=dict(color='red'))
Expand Down
0