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

Function test_waitforbuttonpress

lib/matplotlib/tests/test_figure.py:1656–1663  ·  view source on GitHub ↗
(recwarn)

Source from the content-addressed store, hash-verified

1654@pytest.mark.skipif(sys.platform == 'emscripten',
1655 reason='emscripten does not support threads')
1656def test_waitforbuttonpress(recwarn): # recwarn undoes warn filters at exit.
1657 warnings.filterwarnings("ignore", "cannot show the figure")
1658 fig = plt.figure()
1659 assert fig.waitforbuttonpress(timeout=.1) is None
1660 Timer(.1, KeyEvent("key_press_event", fig.canvas, "z")._process).start()
1661 assert fig.waitforbuttonpress() is True
1662 Timer(.1, MouseEvent("button_press_event", fig.canvas, 0, 0, 1)._process).start()
1663 assert fig.waitforbuttonpress() is False
1664
1665
1666def test_kwargs_pass():

Callers

nothing calls this directly

Calls 5

KeyEventClass · 0.90
MouseEventClass · 0.90
figureMethod · 0.80
waitforbuttonpressMethod · 0.80
startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…