Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does that mean none of this is tested?
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.
It only gets triggered when dragging a legend, afaik mpl isn't testing any interactivity, is it?
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 think it's possible to test interactivity. However, whoever put the typo in didn't test, or tested the wrong thing, so perhaps add to the PR description whatever test you are using to ensure this is the correct fix?
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.
It is possible to test the interactive code, but I think that is way too big of an ask to get a 1 line patch in!
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.
Yes, sorry, I wasn't meaning to ask for that if its hard, but at least some idea how this should be tested manually.
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.
@daniilS, since you seem to be doing some interactive PRs, you might be interested in taking a look here for how zoom and other interactive things like widgets are tested: https://github.com/matplotlib/matplotlib/blob/b636e9ed82b930ad4bde0b51360855fa79a7b438/lib/matplotlib/tests/test_backend_bases.py#LL142C3-L142C3
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.
@greglucas good point - I think all my other PRs were visual changes or toolbar behaviour which is hard to test automatically, but I might be able to write a test for dragging legends as the interaction is happening entirely within the axes.