Use monkeypatch by radarhere · Pull Request #8626 · python-pillow/Pillow

Skip to content

Navigation Menu

Sign in

Appearance settings

Conversation

@radarhere

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
    def draft(
    self, mode: str | None, size: tuple[int, int] | None

Labels

2 participants

@radarhere @hugovk