-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
TST: Defer loading Qt framework until test is run. #12163
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
_, SuperModifier, SuperKey = MODIFIER_KEYS[SUPER] | ||
_, ShiftModifier, ShiftKey = MODIFIER_KEYS[SHIFT] | ||
@pytest.fixture | ||
def qt_key(request): |
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.
Can these just take qt4_module as arg? (and so on for the following ones)
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.
They can; I did not do that yet as I was trying to figure out if we can combine these two files somehow.
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.
The general approach looks good, I guess you're going to do more work in later PRs?
Seems there is a slight problem with the order fixtures are run causing issues when neither Qt version is installed. I think I do have a workaround, though it's a bit annoying. |
It's a bit annoying, but using |
If Qt4 and Qt5 are both available, then `test_backend_qt4.py` will force the loading of the Qt4 framework. If the user selected Qt5 tests only, they will not be able to run even though the Qt4 tests never ran either.
If it's not run first, then the `mpl_test_settings` fixture will attempt to switch backends before the skip is triggered.
e101040
to
c741f44
Compare
Oops, turns out |
…163-on-v3.0.x Backport PR #12163 on branch v3.0.x (TST: Defer loading Qt framework until test is run.)
PR Summary
If Qt4 and Qt5 are both available, then
test_backend_qt4.py
will force the loading of the Qt4 framework. If the user selected Qt5 tests only, they will not be able to run even though the Qt4 tests never ran either.I'd really like it if we could consolidate these two files together, but I'm having a little trouble getting a local fixture (which would check for the right Qt and skip otherwise) to run before the global
mpl_test_settings
fixture (which would try to switch the Qt backends and possibly fail).PR Checklist