Skip to content

Suppress tifffile DeprecationWarning in test_plugin_deprecation_on_imread - #8138

Merged
stefanv merged 3 commits into
scikit-image:mainfrom
blink1073:suppress-deprecation-warning
Apr 29, 2026
Merged

stefanv merged 3 commits into
scikit-image:mainfrom
blink1073:suppress-deprecation-warning

Conversation

@blink1073

@blink1073 blink1073 commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #8135

tifffile raises DeprecationWarning: Setting the shape on a NumPy array has been deprecated in NumPy 2.5 during io.imread calls on TIFF files. This causes test_plugin_deprecation_on_imread to fail because the test's pytest.warns(FutureWarning) context sees an unexpected warning.

This PR wraps the io.imread call in an additional pytest.warns(DeprecationWarning) context to suppress it until tifffile > 2026.4.11 is released with a fix.

…read

tifffile raises "DeprecationWarning: Setting the shape on a NumPy array
has been deprecated in NumPy 2.5". Suppress it until tifffile > 2026.4.11
fixes the issue upstream.
@greptile-apps

greptile-apps Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "Suppress tifffile DeprecationWarning in ..." | Re-trigger Greptile

Comment thread tests/skimage/io/test_io.py Resolved
@greptile-apps

greptile-apps Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "address greptile review" | Re-trigger Greptile

Comment thread tests/skimage/io/test_io.py Resolved
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Reviews (3): Last reviewed commit: "Update tests/skimage/io/test_io.py" | Re-trigger Greptile

@stefanv

stefanv commented Apr 29, 2026

Copy link
Copy Markdown
Member

This is a better fix than mine. Please just add a note in TODO.txt so we remember to remove.

@blink1073

Copy link
Copy Markdown
Contributor Author

This is a better fix than mine. Please just add a note in TODO.txt so we remember to remove.

That seems redundant, since the test itself will go away as part of the removal of the io plugins in the next release.

@stefanv

stefanv commented Apr 29, 2026

Copy link
Copy Markdown
Member

Yes, you're right of course!

@stefanv
stefanv merged commit 495c1c9 into scikit-image:main Apr 29, 2026
21 of 22 checks passed
@stefanv stefanv added this to the 0.27 milestone Apr 29, 2026
@stefanv stefanv added the 🔧 type: Maintenance Refactoring and maintenance of internals label Apr 29, 2026
matthew-brett added a commit that referenced this pull request May 12, 2026
* origin/main: (85 commits)
  Drop Python 3.11 Support (#8153)
  undo change to benchmark workflow
  address review
  Update pyodide CI test to match the pattern used by numpy (#8140)
  Update .github/workflows/_build_linux_for_python_x.yaml
  Update .github/workflows/_test_linux_for_python_x.yaml
  Suppress tifffile DeprecationWarning in test_plugin_deprecation_on_imread (#8138)
  fix yaml
  fix yaml
  Update .github/workflows/test-linux.yaml
  Update .github/workflows/_test_linux_for_python_x.yaml
  Update .github/workflows/test-linux.yaml
  Update .github/workflows/test-linux.yaml
  Move tests back to doc build
  Fill out .PHONY targets
  Apply suggestions from code review
  Remove unused imports (apply commit hooks)
  Improve inserted docstring note of `deprecated_func` (#8095)
  address review
  Update doc/source/index.rst
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI failure 🔧 type: Maintenance Refactoring and maintenance of internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⚠ nightly test failed on main

2 participants