mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Combine tests through parametrization
This commit is contained in:
parent
533f78e0a2
commit
11ac0c1703
|
@ -47,7 +47,11 @@ def test_iterator_min_frame() -> None:
|
|||
assert i[index] == next(i)
|
||||
|
||||
|
||||
def _test_multipage_tiff() -> None:
|
||||
@pytest.mark.parametrize(
|
||||
"libtiff", (pytest.param(True, marks=skip_unless_feature("libtiff")), False)
|
||||
)
|
||||
def test_multipage_tiff(monkeypatch: pytest.MonkeyPatch, libtiff: bool) -> None:
|
||||
monkeypatch.setattr(TiffImagePlugin, "READ_LIBTIFF", libtiff)
|
||||
with Image.open("Tests/images/multipage.tiff") as im:
|
||||
for index, frame in enumerate(ImageSequence.Iterator(im)):
|
||||
frame.load()
|
||||
|
@ -55,16 +59,6 @@ def _test_multipage_tiff() -> None:
|
|||
frame.convert("RGB")
|
||||
|
||||
|
||||
def test_tiff() -> None:
|
||||
_test_multipage_tiff()
|
||||
|
||||
|
||||
@skip_unless_feature("libtiff")
|
||||
def test_libtiff(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setattr(TiffImagePlugin, "READ_LIBTIFF", True)
|
||||
_test_multipage_tiff()
|
||||
|
||||
|
||||
def test_consecutive() -> None:
|
||||
with Image.open("Tests/images/multipage.tiff") as im:
|
||||
first_frame = None
|
||||
|
|
Loading…
Reference in New Issue
Block a user