Improve type checking in tests by radarhere · Pull Request #8618 · python-pillow/Pillow
Navigation Menu
{{ message }}
python-pillow / Pillow Public
- Notifications You must be signed in to change notification settings
- Fork 2.4k
Merged
Improve type checking in tests#8618
hugovk merged 4 commits intopython-pillow:mainfrom
Improve type checking in tests#8618
hugovk merged 4 commits intopython-pillow:mainfrom
Conversation
Copy link Copy Markdown
Member
radarhere
commented
Dec 23, 2024
radarhere
commented
This is part of #8362 - I'm hoping to break down that PR into easier-to-review chunks.
In our test suite, this PR
- asserts that a tuple is returned by
getpixel(), rather than float orNone, before index access is used
Lines 1680 to 1682 in 0e3f51d
| def getpixel( | |
| self, xy: tuple[int, int] | list[int] | |
| ) -> float | tuple[int, ...] | None: |
- asserts that
load()does not returnNonebefore pixel access is used
Line 882 in 0e3f51d
| def load(self) -> core.PixelAccess | None: |
- assert that
paletteis not None before trying to access one of its properties
Line 555 in 0e3f51d
| self.palette: ImagePalette.ImagePalette | None = None |
radarhere added 3 commits
December 23, 2024 11:45
radarhere
added
Testing
Type hints
labels
radarhere
force-pushed
the
px
branch
from
889a375 to
f4db366
Compare
hugovk
merged commit
1754125
into
python-pillow:main
radarhere
deleted the
px
branch
radarhere
mentioned this pull request
Merged
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