Skip to content

Updated test type hint#8482

Merged
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:imagefile
Oct 18, 2024
Merged

Updated test type hint#8482
hugovk merged 1 commit intopython-pillow:mainfrom
radarhere:imagefile

Conversation

@radarhere
Copy link
Member

Minor type hint update. In the following fixture, the return type can be the more specific ImageFile, rather than just Image. The current version was written before #7944 updated the return type of Image.open to ImageFile.

@pytest.fixture
def gradients_image() -> Generator[Image.Image, None, None]:
with Image.open("Tests/images/radial_gradients.png") as im:
im.load()
try:
yield im
finally:
im.close()

@hugovk hugovk merged commit 331e4e7 into python-pillow:main Oct 18, 2024
@radarhere radarhere deleted the imagefile branch October 18, 2024 12:01
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.

2 participants