From e88f3120291cc208d8d1b46e3766fdbc1cfada82 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 5 Jul 2025 12:57:07 +1000 Subject: [PATCH] Fix unclosed file warning --- Tests/test_file_libtiff.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index c245a5a9b..958e2749f 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -873,8 +873,8 @@ class TestFileLibTiff(LibTiffTestCase): assert im.mode == "RGB" assert im.size == (128, 128) assert im.format == "TIFF" - im2 = hopper() - assert_image_similar(im, im2, 5) + with hopper() as im2: + assert_image_similar(im, im2, 5) except OSError: captured = capfd.readouterr() if "LZMA compression support is not configured" in captured.err: