Skip to content

Commit 510de50

Browse files
committed
Moved test_get_child_images to test_file_libtiff.py
1 parent 0ad275f commit 510de50

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

Tests/test_file_libtiff.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,3 +1067,21 @@ def test_save_zero(self, compression, tmp_path):
10671067
out = str(tmp_path / "temp.tif")
10681068
with pytest.raises(SystemError):
10691069
im.save(out, compression=compression)
1070+
1071+
@pytest.mark.parametrize(
1072+
"path, sizes",
1073+
(
1074+
("Tests/images/hopper.tif", ()),
1075+
("Tests/images/child_ifd.tiff", (16, 8)),
1076+
("Tests/images/child_ifd_jpeg.tiff", (20,)),
1077+
),
1078+
)
1079+
def test_get_child_images(self, path, sizes):
1080+
with Image.open(path) as im:
1081+
ims = im.get_child_images()
1082+
1083+
assert len(ims) == len(sizes)
1084+
for i, im in enumerate(ims):
1085+
w = sizes[i]
1086+
expected = Image.new("RGB", (w, w), "#f00")
1087+
assert_image_similar(im, expected, 1)

Tests/test_file_tiff.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,24 +84,6 @@ def test_context_manager(self):
8484
with Image.open("Tests/images/multipage.tiff") as im:
8585
im.load()
8686

87-
@pytest.mark.parametrize(
88-
"path, sizes",
89-
(
90-
("Tests/images/hopper.tif", ()),
91-
("Tests/images/child_ifd.tiff", (16, 8)),
92-
("Tests/images/child_ifd_jpeg.tiff", (20,)),
93-
),
94-
)
95-
def test_get_child_images(self, path, sizes):
96-
with Image.open(path) as im:
97-
ims = im.get_child_images()
98-
99-
assert len(ims) == len(sizes)
100-
for i, im in enumerate(ims):
101-
w = sizes[i]
102-
expected = Image.new("RGB", (w, w), "#f00")
103-
assert_image_similar(im, expected, 1)
104-
10587
def test_mac_tiff(self):
10688
# Read RGBa images from macOS [@PIL136]
10789

0 commit comments

Comments
 (0)