Skip to content
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

Use monkeypatch #8626

Merged
merged 2 commits into from
Dec 27, 2024
Merged

Use monkeypatch #8626

merged 2 commits into from
Dec 27, 2024

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Dec 27, 2024

This is part of #8362 - I'm hoping to break down that PR into easier-to-review chunks.

  1. Uses monkeypatch for
    def im_draft(
    mode: str, size: tuple[int, int]
    ) -> tuple[str, tuple[int, int, float, float]] | None:
    result = draft(mode, size)
    assert result is not None
    return result
    im.draft = im_draft
  2. Updates the type arguments in the mock method to match

    Pillow/src/PIL/Image.py

    Lines 1326 to 1327 in f9767fb

    def draft(
    self, mode: str | None, size: tuple[int, int] | None

@hugovk hugovk merged commit 4db5be1 into python-pillow:main Dec 27, 2024
48 checks passed
@radarhere radarhere deleted the monkeypatch branch December 27, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants