Skip to content

Conversation

@radarhere
Copy link
Member

https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests states

To ensure that no warnings are emitted, use:

def test_warning():
    with warnings.catch_warnings():
        warnings.simplefilter("error")
        ...

However, in #6076, I decided not to add warnings.simplefilter("error"). I've now concluded that was a mistake, and that this doesn't turn warnings into errors as intended - if I add warnings.warn("This should cause a failure"), the test suite still passes. Restoring simplefilter, only then does it fail like it should.

@hugovk hugovk merged commit 35ddbb4 into python-pillow:main Oct 26, 2024
43 checks passed
@radarhere radarhere deleted the warnings branch October 26, 2024 06:41
radarhere added a commit to radarhere/Pillow that referenced this pull request Feb 1, 2025
radarhere added a commit to radarhere/Pillow that referenced this pull request Feb 1, 2025
fdintino pushed a commit to fdintino/Pillow that referenced this pull request Feb 3, 2025
* Removed skip_unless_feature on methods when class is already skipped

* Test speed less than slowest and greater than fastest

* Updated type hints

* Only access angle when AVIF_TRANSFORM_IROT flag is present

* Added AVIF_ROOT

* Only define normalize_quantize_value if it will be used

* Build libavif after libjpeg

* Use rgb.rowBytes in overflow check

* Group EXIF info

* Removed __loaded

* If brew is not installed, use /usr prefix

* Sort AVIF codecs alphabetically

* Updated rav1e license

* Fixed catching warning, as per python-pillow#8505

* Simplified code

* Fixed typos

* Test further scenarios

* Use y* to parse bytes

---------

Co-authored-by: Andrew Murray <[email protected]>
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