Added type hints to additional tests by radarhere · Pull Request #8118 · python-pillow/Pillow

def test_sanity() -> None:
im = hopper()
assert im.thumbnail((100, 100)) is None
assert im.thumbnail((100, 100)) is None # type: ignore[func-returns-value]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this ignore, mypy reports

Tests/test_image_thumbnail.py:19: error: "thumbnail" of "Image" does not return a value (it only ever returns None) [func-returns-value]
assert im.thumbnail((100, 100)) is None
^~~~~~~~~~~~~~~~~~~~~~~~

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this line just be im.thumbnail((100, 100)), without the assert?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I’ve pushed a commit.