Trigger events via standard callbacks in widget testing. - #29993
Conversation
|
The problem is that right now do_event takes a (not-standardized) widget method name as parameter. I guess, sure, we could completely change the signature and have a private |
I'm +/-0 here.
OTOH I don't have a good API either. |
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.
timhoffm
left a comment
There was a problem hiding this comment.
Let's go with this. It's an internal pattern. We can always change later if we find something better.

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