-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added type hints to Tests/test_font_*.py #7743
Conversation
@@ -30,6 +30,6 @@ class TestDefaultFontLeak(TestTTypeFontLeak): | |||
iterations = 100 | |||
mem_limit = 1024 # k | |||
|
|||
def test_leak(self): | |||
def test_leak(self) -> None: | |||
default_font = ImageFont.load_default() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Tests/test_font_pcf_charsets.py
Outdated
@@ -14,7 +15,7 @@ | |||
|
|||
fontname = "Tests/fonts/ter-x20b.pcf" | |||
|
|||
charsets = { | |||
charsets: dict[str, dict[str, int | str]] = { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Tests/test_font_pcf.py
Outdated
@@ -20,7 +21,7 @@ | |||
pytestmark = skip_unless_feature("zlib") | |||
|
|||
|
|||
def save_font(request, tmp_path): | |||
def save_font(request: pytest.FixtureRequest, tmp_path: PosixPath) -> str: |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
Thanks! |
No description provided.