From 6f2856d9ee495afff3c02b4eb0d69f42423cec1d Mon Sep 17 00:00:00 2001 From: FangFuxin <38530078+lajiyuan@users.noreply.github.com> Date: Fri, 12 Jan 2024 18:24:46 +0800 Subject: [PATCH] Update Tests/test_file_png.py Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- Tests/test_file_png.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index e5b3ada1a2b..52063d0374e 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -781,9 +781,8 @@ class MyStdOut: def test_end_truncated_filed(self): ImageFile.LOAD_TRUNCATED_IMAGES = True try: - img = Image.open("Tests/images/end_trunc_file.png") - img.load() - assert img is not None + with Image.open("Tests/images/end_trunc_file.png") as im: + assert_image_equal_tofile(im, "Tests/images/hopper.png") finally: ImageFile.LOAD_TRUNCATED_IMAGES = False