diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py index 75c7019ab..3b60c0860 100644 --- a/Tests/test_file_gif.py +++ b/Tests/test_file_gif.py @@ -1171,6 +1171,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_libtiff.py b/Tests/test_file_libtiff.py index 40f37430c..ce932f2c7 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -1062,8 +1062,8 @@ class TestFileLibTiff(LibTiffTestCase): # Set EXIF Orientation to 2 data = data[:102] + b"\x02" + data[103:] - with Image.open(io.BytesIO(data)) as im: - im = im.transpose(Image.Transpose.FLIP_LEFT_RIGHT) + with Image.open(io.BytesIO(data)) as img: + im = img.transpose(Image.Transpose.FLIP_LEFT_RIGHT) assert_image_equal_tofile(im, "Tests/images/old-style-jpeg-compression.png") def test_open_missing_samplesperpixel(self) -> None: 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)