Skip to content

Commit 2af0501

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent dae4264 commit 2af0501

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/transforms/test_load_image.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import shutil
1616
import tempfile
1717
import unittest
18-
import warnings
1918
from pathlib import Path
2019

2120
import nibabel as nib
@@ -447,23 +446,23 @@ def test_reader_not_installed_exception(self):
447446
self.assertEqual(out.meta["name"], "my test")
448447
out = LoadImage(image_only=True)("test", reader=_MiniReader(is_compatible=False))
449448
self.assertEqual(out.meta["name"], "my test")
450-
449+
451450
def test_raise_on_missing_reader_flag(self):
452451
"""test raise_on_missing_reader flag behavior"""
453452
# Test with flag enabled - should raise exception for unknown reader name
454453
with self.assertRaises(OptionalImportError):
455454
LoadImage(image_only=True, reader="UnknownReaderName", raise_on_missing_reader=True)
456-
455+
457456
# Test with flag disabled (default) - should also raise exception for unknown reader name
458457
# because this is caught before the new flag logic
459458
with self.assertRaises(OptionalImportError):
460459
LoadImage(image_only=True, reader="UnknownReaderName", raise_on_missing_reader=False)
461-
460+
462461
# The flag primarily helps when reader is recognized but dependencies are missing
463462
# Since we're in an ITK test environment, let's just verify the flag exists and doesn't break normal behavior
464463
loader_with_flag = LoadImage(image_only=True, reader="ITKReader", raise_on_missing_reader=False)
465464
loader_without_flag = LoadImage(image_only=True, reader="ITKReader")
466-
465+
467466
# Both should work since ITK is available in this test environment
468467
self.assertIsInstance(loader_with_flag, LoadImage)
469468
self.assertIsInstance(loader_without_flag, LoadImage)

0 commit comments

Comments
 (0)