-
Couldn't load subscription status.
- Fork 217
Fix #1122: Reinstate graphics APIs #1123
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
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
|
/ok to test |
|
|
||
| @pytest.mark.skipif(PySide6 is None, reason="PySide6 not installed") | ||
| def test_graphics_api_smoketest(): | ||
| from PySide6 import QtGui, QtOpenGL |
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.
Seems like we can avoid a bunch of the noisy skipif and imports by using importorskip here:
| from PySide6 import QtGui, QtOpenGL | |
| PySide6 = pytest.importorskip("PySide6") | |
| QtGui = PySide6.QtGui | |
| QtOpenGL = PySide6.QtOpenGL |
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 didn't know about the importorskip trick.
Still need to import the subpackages explicitly, though. PySide6 doesn't import everything automatically.
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.
You can pass a dotted path to importorskip, making this code even shorter:
QtGui = pytest.importorksip("PySide6.QtGui")
# etc
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.
Didn't realize they were subpackages, otherwise I would've made that my original suggestion!
Co-authored-by: Leo Fang <leo80042@gmail.com>
|
/ok to test |
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 additional skip can be done later if desired.
|
|
||
|
|
||
| def test_graphics_api_smoketest(): | ||
| _ = pytest.importorskip("PySide6") |
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 don't love skippable tests because I feel too much complexity is introduced from the lack of symmetry between local and ci builds. For example, there is a potential for the tests to bit-rot if they aren't run frequently enough by devs or the ci runners.
|
/ok to test |
|
/ok to test |
|
I have updated this to use the |
|
/ok to test |
* Fix #1122: Reinstate graphics APIs * Add a test * Update cuda_bindings/tests/test_graphics_apis.py Co-authored-by: Leo Fang <leo80042@gmail.com> * Use importorskip * Improve tests * Fix test * Fix Windows tests --------- Co-authored-by: Leo Fang <leo80042@gmail.com> (cherry picked from commit 73da391)
|
Successfully created backport PR for |
|
* Fix #1122: Reinstate graphics APIs (#1123) * Fix #1122: Reinstate graphics APIs * Add a test * Update cuda_bindings/tests/test_graphics_apis.py Co-authored-by: Leo Fang <leo80042@gmail.com> * Use importorskip * Improve tests * Fix test * Fix Windows tests --------- Co-authored-by: Leo Fang <leo80042@gmail.com> (cherry picked from commit 73da391) * [pre-commit.ci] auto code formatting --------- Co-authored-by: Michael Droettboom <mdboom@gmail.com> Co-authored-by: Leo Fang <leo80042@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
These inadvertently got commented out in #914.