From 48a178ddf7cff0eb10350f66e71681fba96ffc14 Mon Sep 17 00:00:00 2001 From: Garrett Wright Date: Tue, 23 Jun 2026 09:09:08 -0400 Subject: [PATCH] allow 1 or 2 corruptions in bad mrcfile test issue 1392 --- tests/test_image.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_image.py b/tests/test_image.py index 603ca4480f..794a217c6d 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -2,6 +2,7 @@ import os.path import tempfile from datetime import datetime +from fnmatch import fnmatch from unittest import mock import mrcfile @@ -456,7 +457,9 @@ def test_corrupt_mrc_load(caplog): _ = Image.load(mrc_path) # Check the message prefix - assert f"Image.load of {mrc_path} reporting 1 corruptions" in caplog.text + assert fnmatch( + caplog.text, f"*Image.load of {mrc_path} reporting [1-2] corruptions*" + ) # Check the message contains the file path assert mrc_path in caplog.text