Skip to content
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

Fix/filter/avoid test warnings #5686

Merged
merged 5 commits into from
Aug 24, 2021

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Aug 24, 2021

Running plain pytest warns:

======================================================== warnings summary ========================================================
Tests/test_file_tiff.py: 1 warning
Tests/test_tiff_crashes.py: 13 warnings
  /Users/hugo/github/Pillow/src/PIL/TiffImagePlugin.py:812: UserWarning: Truncated File Read
    warnings.warn(str(msg))

Tests/test_map.py::test_tobytes
  /Users/hugo/github/Pillow/src/PIL/Image.py:2916: DecompressionBombWarning: Image size (151587072 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html

Runing pytest -Wall with all warnings enabled adds some more:

======================================================== warnings summary ========================================================
Tests/test_file_tiff.py: 2 warnings
Tests/test_tiff_crashes.py: 26 warnings
  /Users/hugo/github/Pillow/src/PIL/TiffImagePlugin.py:812: UserWarning: Truncated File Read
    warnings.warn(str(msg))

Tests/test_imagepalette.py::test_reload
  /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_pytest/python.py:183: ResourceWarning: unclosed file <_io.BufferedReader name='Tests/images/hopper.gif'>
    result = testfunction(**testargs)

Tests/test_map.py::test_tobytes
  /Users/hugo/github/Pillow/src/PIL/Image.py:2916: DecompressionBombWarning: Image size (151587072 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html

@hugovk hugovk added the Testing label Aug 24, 2021
@radarhere
Copy link
Member

radarhere commented Aug 24, 2021

For the record, the crash image was removed in #5561

@hugovk
Copy link
Member Author

hugovk commented Aug 24, 2021

Yep, Tests/images/crash-81154a65438ba5aaeca73fd502fa4850fbde60f8.tif shows up when running install_extra_test_images.sh, and we already ignore the other https://github.com/python-pillow/pillow-depends/tree/master/test_images files.

@radarhere radarhere merged commit 8b639f7 into python-pillow:master Aug 24, 2021
@hugovk hugovk deleted the fix-test-warnings branch August 24, 2021 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants