MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_polygon_selector_remove

Function test_polygon_selector_remove

lib/matplotlib/tests/test_widgets.py:1602–1616  ·  view source on GitHub ↗
(ax, idx, draw_bounding_box)

Source from the content-addressed store, hash-verified

1600@pytest.mark.parametrize('idx', [1, 2, 3])
1601@pytest.mark.parametrize('draw_bounding_box', [False, True])
1602def test_polygon_selector_remove(ax, idx, draw_bounding_box):
1603 verts = [(50, 50), (150, 50), (50, 150)]
1604 event_sequence = [polygon_place_vertex(ax, verts[0]),
1605 polygon_place_vertex(ax, verts[1]),
1606 polygon_place_vertex(ax, verts[2]),
1607 # Finish the polygon
1608 polygon_place_vertex(ax, verts[0])]
1609 # Add an extra point
1610 event_sequence.insert(idx, polygon_place_vertex(ax, (200, 200)))
1611 # Remove the extra point
1612 event_sequence.append(polygon_remove_vertex(ax, (200, 200)))
1613 # Flatten list of lists
1614 event_sequence = functools.reduce(operator.iadd, event_sequence, [])
1615 check_polygon_selector(event_sequence, verts, 2,
1616 draw_bounding_box=draw_bounding_box)
1617
1618
1619@pytest.mark.parametrize('draw_bounding_box', [False, True])

Callers

nothing calls this directly

Calls 3

polygon_place_vertexFunction · 0.85
polygon_remove_vertexFunction · 0.85
check_polygon_selectorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…