Only specify image size once

This commit is contained in:
Andrew Murray 2024-03-21 19:16:06 +11:00
parent a0ab9f488f
commit 9c41bf4641

View File

@ -1064,8 +1064,9 @@ class TestImageBytes:
@pytest.mark.parametrize(("mode", "pixelsize"), image_modes)
def test_getdata_putdata(self, mode: str, pixelsize: int) -> None:
start_bytes = bytes(range(2 * 2 * pixelsize))
im = Image.frombytes(mode, (2, 2), start_bytes)
im = Image.new(mode, (2, 2))
source_bytes = bytes(range(im.width * im.height * pixelsize))
im.frombytes(source_bytes)
reloaded = Image.new(mode, im.size)
reloaded.putdata(im.getdata())