geotiff: skip degenerate streaming tests when tifffile is unavailable#1926
Merged
Conversation
The dask streaming degenerate-shape tests added in #1912 use a _read_raw_pixels helper that does a bare ``import tifffile`` to verify on-disk encoding. ``tifffile`` is an optional CI dependency, so when it is not installed the three tests that call this helper error out with ModuleNotFoundError instead of skipping. CI on main has been failing since 15882e6 landed. Other tests in the repo handle this with pytest.importorskip; this change applies the same pattern so the three tests skip cleanly when tifffile is missing.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes CI failures introduced by PR #1912 by replacing a bare import tifffile in a test helper with pytest.importorskip, so tests that depend on the optional tifffile dependency skip cleanly rather than erroring with ModuleNotFoundError.
Changes:
- Use
pytest.importorskip("tifffile")inside the_read_raw_pixelshelper, matching the pattern already used elsewhere in the test suite.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
CI on main has been failing since #1912 (commit 15882e6) landed. The new file
test_dask_streaming_write_degenerate_2026_05_15.pyuses a_read_raw_pixelshelper that does a bareimport tifffile.tifffileis an optional dependency that is not installed in the CI environment, so three tests that call the helper error out withModuleNotFoundErrorinstead of skipping:TestStreamingWriteAllNan::test_all_nan_with_sentinelTestStreamingWriteAllNan::test_all_nan_default_nodataTestStreamingWriteMixedNanInf::test_mixed_nan_plus_minus_infOther tests in the repo handle the same situation with
pytest.importorskip("tifffile")(e.g.test_dask_max_pixels_default_guard_1838.py,test_backend_pixel_parity_matrix_1813.py,test_predictor2_int8.py). This change applies the same pattern in the helper so the three tests skip when tifffile is missing and still run when it is installed.Failed run: https://github.com/xarray-contrib/xarray-spatial/actions/runs/25921856318
Test plan