Skip to content

Fix/filter/avoid test warnings#5686

Merged
radarhere merged 5 commits intopython-pillow:masterfrom
hugovk:fix-test-warnings
Aug 24, 2021
Merged

Fix/filter/avoid test warnings#5686
radarhere merged 5 commits intopython-pillow:masterfrom
hugovk:fix-test-warnings

Conversation

@hugovk
Copy link
Copy Markdown
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
Copy Markdown
Member

radarhere commented Aug 24, 2021

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

@hugovk
Copy link
Copy Markdown
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.

2 participants