Skip to content

Trigger events via standard callbacks in widget testing. #29993

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented May 1, 2025

Sending actual events through the whole event processing pipeline is a more complete test, reveals a few minor issues (see changes below), and avoids being linked to the rather nonstandard widget method names ("press" or "_click"?).

The coordinates in the "move first vertex after completing the polygon" subtest of test_polygon_selector(draw_bounding_box=True) were altered because the original coordinates would actually not work in a real case, as the mouse-drag would actually also trigger the polygon-rescaling behavior.

The coordinates in test_rectangle_{drag,resize} were altered because for the original coordinates, the click_and_drag would actually be ignore()d due to starting (just) outside of the axes.

Closes #22720.

PR summary

PR checklist

Sending actual events through the whole event processing pipeline is a
more complete test, reveals a few minor issues (see changes below), and
avoids being linked to the rather nonstandard widget method names
("press" or "_click"?).

The coordinates in the "move first vertex after completing the polygon"
subtest of test_polygon_selector(draw_bounding_box=True) were altered
because the original coordinates would actually not work in a real case,
as the mouse-drag would actually also trigger the polygon-rescaling
behavior.

The coordinates in test_rectangle_{drag,resize} were altered because for
the original coordinates, the click_and_drag would actually be ignore()d
due to starting (just) outside of the axes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MNT]: Generalize widget mouse testing
1 participant