Added type hints to additional tests#8093
Merged
hugovk merged 1 commit intopython-pillow:mainfrom Jun 1, 2024
Merged
Conversation
hugovk
reviewed
May 31, 2024
|
|
||
| with pytest.raises(ImageCms.PyCMSError, match="Invalid type for Profile"): | ||
| ImageCms.getProfileName(None) | ||
| ImageCms.getProfileName(None) # type: ignore[arg-type] |
Member
There was a problem hiding this comment.
What does this warning look like?
Member
Author
There was a problem hiding this comment.
Tests/test_imagecms.py:212: error: Argument 1 to "getProfileName" has incompatible type "None"; expected
"Union[str, SupportsRead[bytes], CmsProfile, ImageCmsProfile]" [arg-type]
ImageCms.getProfileName(None)
^~~~
The test's intention is to go through
Line 807 in c757439
where
Lines 369 to 371 in c757439
and then
Lines 239 to 240 in c757439
to reach
Line 263 in c757439
The type is deliberately incorrect.
| ImageCms.core.CmsProfile() | ||
| with pytest.raises(TypeError): | ||
| ImageCms.core.CmsProfile(0) | ||
| ImageCms.core.CmsProfile(0) # type: ignore[call-arg] |
Member
Author
There was a problem hiding this comment.
Tests/test_imagecms.py:532: error: Too many arguments for "CmsProfile" [call-arg]
ImageCms.core.CmsProfile(0)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.