From 1140f6538d03ef0b481773edcc0f8c90f992c7f1 Mon Sep 17 00:00:00 2001 From: Andrew Murray <3112309+radarhere@users.noreply.github.com> Date: Thu, 14 Oct 2021 08:09:36 +1100 Subject: [PATCH] Ensure reset after test failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondrej Baranovič --- Tests/test_file_libtiff.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tests/test_file_libtiff.py b/Tests/test_file_libtiff.py index 2c12efb81..aed1cabc2 100644 --- a/Tests/test_file_libtiff.py +++ b/Tests/test_file_libtiff.py @@ -992,9 +992,10 @@ class TestFileLibTiff(LibTiffTestCase): out = str(tmp_path / "temp.tif") TiffImagePlugin.STRIP_SIZE = 2 ** 18 - im.save(out, compression="tiff_adobe_deflate") - try: + + im.save(out, compression="tiff_adobe_deflate") + with Image.open(out) as im: assert len(im.tag_v2[STRIPOFFSETS]) == 1 finally: