Skip to content

Simplified test code - #8823

Merged
hugovk merged 5 commits into
python-pillow:mainfrom
radarhere:test_fp
Mar 21, 2025
Merged

hugovk merged 5 commits into
python-pillow:mainfrom
radarhere:test_fp

Conversation

@radarhere

Copy link
Copy Markdown
Member

Replace

f = str(tmp_path / "temp.png")

with

f = tmp_path / "temp.png"

where possible.

@hugovk

hugovk commented Mar 19, 2025

Copy link
Copy Markdown
Member

I guess most of these are fine, but are any of these actually testing it works with a string?

@radarhere

Copy link
Copy Markdown
Member Author

Almost all of these changes are about opening and saving. I've added an explicit test for opening and saving an image using a string.

An exception is a call to ImageFont.truetype(), but we already have other tests that pass strings to that -

return ImageFont.truetype(FONT_PATH, FONT_SIZE, layout_engine=layout_engine)

@hugovk
hugovk merged commit 478ccb4 into python-pillow:main Mar 21, 2025
@radarhere
radarhere deleted the test_fp branch March 21, 2025 13:35
@aclark4life aclark4life added the PNG label Oct 8, 2026
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.

3 participants