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

Fix putdata() for I;16N on big-endian #7209

Merged
merged 16 commits into from
Mar 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added type hints
  • Loading branch information
radarhere committed Mar 21, 2024
commit a0ab9f488febc1543b8000ee1395dd2cf6fdcd50
6 changes: 3 additions & 3 deletions Tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,15 +1046,15 @@ def test_close_graceful(self, caplog: pytest.LogCaptureFixture) -> None:

class TestImageBytes:
@pytest.mark.parametrize("mode", image_mode_names)
def test_roundtrip_bytes_constructor(self, mode: str):
def test_roundtrip_bytes_constructor(self, mode: str) -> None:
im = hopper(mode)
source_bytes = im.tobytes()

reloaded = Image.frombytes(mode, im.size, source_bytes)
assert reloaded.tobytes() == source_bytes

@pytest.mark.parametrize("mode", image_mode_names)
def test_roundtrip_bytes_method(self, mode: str):
def test_roundtrip_bytes_method(self, mode: str) -> None:
im = hopper(mode)
source_bytes = im.tobytes()

Expand All @@ -1063,7 +1063,7 @@ def test_roundtrip_bytes_method(self, mode: str):
assert reloaded.tobytes() == source_bytes

@pytest.mark.parametrize(("mode", "pixelsize"), image_modes)
def test_getdata_putdata(self, mode: str, pixelsize: int):
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)

Expand Down