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

Added type hints to additional tests #8118

Merged
merged 4 commits into from
Jun 18, 2024

Conversation

radarhere
Copy link
Member

No description provided.

@@ -16,7 +16,7 @@

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]
Copy link
Member Author

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
^~~~~~~~~~~~~~~~~~~~~~~~

Copy link
Contributor

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?

Copy link
Member Author

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.

@hugovk hugovk merged commit cde0524 into python-pillow:main Jun 18, 2024
55 checks passed
@radarhere radarhere deleted the type_hint_tests branch June 18, 2024 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants