Skip to content
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

Fix qt key mods #20868

Merged
merged 2 commits into from
Aug 20, 2021
Merged

Fix qt key mods #20868

merged 2 commits into from
Aug 20, 2021

Conversation

tacaswell
Copy link
Member

PR Summary

Fixes a Qt test. It looks like we had a test that never actually worked (the assert happened in a callback so the failure was ignored) which meant that the parameterized tests always passed. When the test was fixed to raise on error this brought to light a miss-match between the computed and expected results which is also fixed.

PR Checklist

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (run flake8 on changed files to check).
  • [N/A] New features are documented, with examples if plot related.
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • Conforms to Matplotlib style conventions (install flake8-docstrings and run flake8 --docstring-convention=all).
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).

@tacaswell tacaswell added this to the v3.5.0 milestone Aug 20, 2021
Otherwise we ignore the failures
As part of a4c504c the modified was
changed from SuperModifer to MetaModifier.  Under the new scheme of testing
the keys we were correctly noting that SuperModifier is not in the Qt Modifier
enum (the super keys come in through "SpecialKeys").  However, because the
failures were happening in a callback and being ignored, we did not notice this
change.  It is likely that this test never worked for the same reason.
@timhoffm timhoffm merged commit 54b105b into matplotlib:master Aug 20, 2021
@tacaswell tacaswell deleted the fix_qt_key_mods branch August 21, 2021 17:09
@greglucas
Copy link
Contributor

FYI: I just ran the latest tests and these are now failing for me and I'm wondering if it has to do with being on a mac? The tests look like they are swapping cmd/ctrl, so I tried swapping the modifier keys on my system and that didn't help.

FAILED lib/matplotlib/tests/test_backend_qt.py::test_correct_key[Qt5Agg-control] - AssertionError: assert 'cmd+a' == 'ctrl+a'
FAILED lib/matplotlib/tests/test_backend_qt.py::test_correct_key[Qt5Agg-alt_control] - AssertionError: assert 'alt+cmd' == 'alt+control'
FAILED lib/matplotlib/tests/test_backend_qt.py::test_correct_key[Qt5Agg-control_alt] - AssertionError: assert 'cmd+alt' == 'ctrl+alt'
FAILED lib/matplotlib/tests/test_backend_qt.py::test_correct_key[Qt5Agg-modifier_order] - AssertionError: assert 'cmd+alt+ctrl+á' == 'ctrl+alt+super+á'
FAILED lib/matplotlib/tests/test_backend_qt.py::test_correct_key[Qt5Agg-backspace_mod] - AssertionError: assert 'cmd+backspace' == 'ctrl+backspace'
FAILED lib/matplotlib/tests/test_backend_qt.py::test_correct_key[QtAgg-control] - AssertionError: assert 'cmd+a' == 'ctrl+a'
FAILED lib/matplotlib/tests/test_backend_qt.py::test_correct_key[QtAgg-alt_control] - AssertionError: assert 'alt+cmd' == 'alt+control'
FAILED lib/matplotlib/tests/test_backend_qt.py::test_correct_key[QtAgg-control_alt] - AssertionError: assert 'cmd+alt' == 'ctrl+alt'
FAILED lib/matplotlib/tests/test_backend_qt.py::test_correct_key[QtAgg-modifier_order] - AssertionError: assert 'cmd+alt+ctrl+á' == 'ctrl+alt+super+á'
FAILED lib/matplotlib/tests/test_backend_qt.py::test_correct_key[QtAgg-backspace_mod] - AssertionError: assert 'cmd+backspace' == 'ctrl+backspace'

It looks like these may be getting skipped on the macos-latest CI?

SKIPPED [22] lib/matplotlib/tests/test_backend_qt.py:168: No usable Qt bindings

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.

4 participants