Skip to content

Conversation

@radarhere
Copy link
Member

No description provided.


def test_leak(self):
def test_leak(self) -> None:
default_font = ImageFont.load_default()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this test is checking for leaks with a PIL font and was also broken by #7354.

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 created #7748 for this.

fontname = "Tests/fonts/ter-x20b.pcf"

charsets = {
charsets: dict[str, dict[str, int | str]] = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the assert isinstance(...) calls if you use a TypedDict subclass for the 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.

Ok, I've pushed a commit for this.



def save_font(request, tmp_path):
def save_font(request: pytest.FixtureRequest, tmp_path: PosixPath) -> str:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not tmp_path: Path?

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 to update it, both the changes from here and #7732

@hugovk hugovk merged commit be1508f into python-pillow:main Jan 24, 2024
@hugovk
Copy link
Member

hugovk commented Jan 24, 2024

Thanks!

@radarhere radarhere deleted the type_hint_test_font branch January 24, 2024 19:31
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.

4 participants