mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Parametrize test
This commit is contained in:
parent
28f436c94d
commit
533f78e0a2
|
@ -735,8 +735,22 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
assert icc_libtiff is not None
|
assert icc_libtiff is not None
|
||||||
assert icc == icc_libtiff
|
assert icc == icc_libtiff
|
||||||
|
|
||||||
def test_write_icc(self, monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
@pytest.mark.parametrize(
|
||||||
def check_write(libtiff: bool) -> None:
|
"libtiff",
|
||||||
|
(
|
||||||
|
pytest.param(
|
||||||
|
True,
|
||||||
|
marks=pytest.mark.skipif(
|
||||||
|
not Image.core.libtiff_support_custom_tags,
|
||||||
|
reason="Custom tags not supported by older libtiff",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
False,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
def test_write_icc(
|
||||||
|
self, monkeypatch: pytest.MonkeyPatch, tmp_path: Path, libtiff: bool
|
||||||
|
) -> None:
|
||||||
monkeypatch.setattr(TiffImagePlugin, "WRITE_LIBTIFF", libtiff)
|
monkeypatch.setattr(TiffImagePlugin, "WRITE_LIBTIFF", libtiff)
|
||||||
|
|
||||||
with Image.open("Tests/images/hopper.iccprofile.tif") as img:
|
with Image.open("Tests/images/hopper.iccprofile.tif") as img:
|
||||||
|
@ -747,13 +761,6 @@ class TestFileLibTiff(LibTiffTestCase):
|
||||||
with Image.open(out) as reloaded:
|
with Image.open(out) as reloaded:
|
||||||
assert icc_profile == reloaded.info["icc_profile"]
|
assert icc_profile == reloaded.info["icc_profile"]
|
||||||
|
|
||||||
libtiffs = [False]
|
|
||||||
if Image.core.libtiff_support_custom_tags:
|
|
||||||
libtiffs.append(True)
|
|
||||||
|
|
||||||
for libtiff in libtiffs:
|
|
||||||
check_write(libtiff)
|
|
||||||
|
|
||||||
def test_multipage_compression(self) -> None:
|
def test_multipage_compression(self) -> None:
|
||||||
with Image.open("Tests/images/compression.tif") as im:
|
with Image.open("Tests/images/compression.tif") as im:
|
||||||
im.seek(0)
|
im.seek(0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user