Skip to content

Commit 72a098b

Browse files
committed
Added test
1 parent c2203a1 commit 72a098b

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Tests/images/hopper_resized.gif

5.1 KB
Loading

Tests/test_image_resize.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ def test_unknown_filter(self):
135135
with pytest.raises(ValueError):
136136
self.resize(hopper(), (10, 10), 9)
137137

138+
def test_cross_platform(self, tmp_path):
139+
# This test is intended for only check for consistent behaviour across
140+
# platforms. So if a future Pillow change requires that the test file
141+
# be updated, that is okay.
142+
im = hopper().resize((64, 64))
143+
temp_file = str(tmp_path / "temp.gif")
144+
im.save(temp_file)
145+
146+
with Image.open(temp_file) as reloaded:
147+
with Image.open("Tests/images/hopper_resized.gif") as expected:
148+
assert_image_equal(reloaded, expected)
149+
138150

139151
@pytest.fixture
140152
def gradients_image():

0 commit comments

Comments
 (0)