-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add a click_and_move widget test helper #21780
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
Conversation
02c5675
to
113a0f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, could it also be used in the following cases?
- replace
_resize_rectangle
byclick_and_move
test_rectangle_rotate
test_rectange_add_remove_set
lib/matplotlib/tests/test_widgets.py
Outdated
do_event(tool, 'press', xdata=0, ydata=10, button=1) | ||
do_event(tool, 'onmove', xdata=100, ydata=120, button=1) | ||
do_event(tool, 'release', xdata=100, ydata=120, button=1) | ||
click_and_move(tool, start=[0, 10], end=[100, 120]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer tuples over lists for specifying points.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How blocking is this comment? It's a bit of a pain to change now, but I do agree with you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the liberty to push a commit changing all the lists to tuples. It's actually not painful at all. Regex-Replace: 1min + 1min to check the individual replacements. :)
113a0f0
to
5aa85d6
Compare
@timhoffm Thanks 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the lists to tuples for coordinate positions, but would argue that this doesn't count as a significant contribution that'd warrant another approval.
You may squash-merge.
Addresses part of #21774.