Register reusable platform and VTK conditional skip markers#296
Open
banesullivan wants to merge 1 commit into
Open
Register reusable platform and VTK conditional skip markers#296banesullivan wants to merge 1 commit into
banesullivan wants to merge 1 commit into
Conversation
user27182
reviewed
May 18, 2026
| return uses_egl() | ||
|
|
||
|
|
||
| def _needs_vtk_version_skip_reason(item_mark: pytest.Mark) -> str | None: |
Contributor
There was a problem hiding this comment.
I'd personally rather see needs_vtk_version kept inside pyvista, and moved from its test suite into core, maybe _vtk_utilities.
Reason being that I'd like to move pv.vtk_version_info checks from inside filters that require newer VTK versions to use a decorator instead
@_needs_vtk_version(9, 3, 0)
def contour_labels(So basically it can be used for runtime checks, or adapted for testing.
I made a commit a few days ago to start this but didn't get far pyvista/pyvista#8684
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Downstream PyVista projects keep reinventing
skip_egl,skip_mac,skip_windows, andneeds_vtk_version, or fall back to rawskipIf/importorskipthat is harder to read and easy to get wrong. This registers all four markers and theirpytest_runtest_setupevaluation in the plugin.needs_vtk_versionaccepts the positional form (needs_vtk_version(9, 3)meaning at least 9.3) and explicitat_least=/less_than=bounds, pads version tuples so(9, 3)compares correctly against(9, 3, 0), and raises a clearUsageErroron a malformed marker. EGL detection falls back to running the test if PyVista's internal gl_checks module is unavailable on an older release.The markers are opt-in by nature: the hook only acts on tests that carry them.
resolves #275