(ax, selector)
| 808 | |
| 809 | @pytest.mark.parametrize('selector', ['span', 'rectangle']) |
| 810 | def test_selector_clear_method(ax, selector): |
| 811 | if selector == 'span': |
| 812 | tool = widgets.SpanSelector(ax, onselect=noop, direction='horizontal', |
| 813 | interactive=True, |
| 814 | ignore_event_outside=True) |
| 815 | else: |
| 816 | tool = widgets.RectangleSelector(ax, interactive=True) |
| 817 | click_and_drag(tool, start=(10, 10), end=(100, 120)) |
| 818 | assert tool._selection_completed |
| 819 | assert tool.get_visible() |
| 820 | if selector == 'span': |
| 821 | assert tool.extents == (10, 100) |
| 822 | |
| 823 | tool.clear() |
| 824 | assert not tool._selection_completed |
| 825 | assert not tool.get_visible() |
| 826 | |
| 827 | # Do another cycle of events to make sure we can |
| 828 | click_and_drag(tool, start=(10, 10), end=(50, 120)) |
| 829 | assert tool._selection_completed |
| 830 | assert tool.get_visible() |
| 831 | if selector == 'span': |
| 832 | assert tool.extents == (10, 50) |
| 833 | |
| 834 | |
| 835 | def test_span_selector_add_state(ax): |
nothing calls this directly
no test coverage detected
searching dependent graphs…