From bba4b098f1d45c85d914ecf4a293686610459bbf Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sun, 30 Mar 2025 12:03:17 +1100 Subject: [PATCH] Assert image type --- Tests/test_file_gif.py | 1 + Tests/test_file_wmf.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py index ae8af96f8..20d58a9dd 100644 --- a/Tests/test_file_gif.py +++ b/Tests/test_file_gif.py @@ -1163,6 +1163,7 @@ def test_append_images(tmp_path: Path) -> None: im.copy().save(out, append_images=ims) with Image.open(out) as reread: + assert isinstance(reread, GifImagePlugin.GifImageFile) assert reread.n_frames == 3 # Tests appending using a generator diff --git a/Tests/test_file_wmf.py b/Tests/test_file_wmf.py index 44e213189..dcf5f000f 100644 --- a/Tests/test_file_wmf.py +++ b/Tests/test_file_wmf.py @@ -103,10 +103,12 @@ def test_load_set_dpi() -> None: if not hasattr(Image.core, "drawwmf"): return + assert isinstance(im, WmfImagePlugin.WmfStubImageFile) im.load(im.info["dpi"]) assert im.size == (1625, 1625) with Image.open("Tests/images/drawing.emf") as im: + assert isinstance(im, WmfImagePlugin.WmfStubImageFile) im.load((72, 144)) assert im.size == (82, 164)