Skip to content

Commit 369321e

Browse files
author
Cipher
committed
fix: remove duplicate local imports causing isort errors
OptionalImportError and logging were imported both at module level and again inside the test_unspecified_reader_falls_back_silently() method. Remove the duplicate local imports since they're already available at the module level (where we moved them earlier per MONAI style). Keep the local import of SUPPORTED_READERS since it's only needed in this one test method. This fixes isort formatting check failure. Signed-off-by: Cipher <cipher@openclaw.ai>
1 parent 08bd231 commit 369321e

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

tests/transforms/test_load_image.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,6 @@ def test_unspecified_reader_falls_back_silently(self):
528528
# Force the fallback path by simulating missing optional dependencies.
529529
# Patch the constructor to raise OptionalImportError for some readers,
530530
# then verify LoadImage still instantiates and logs warnings.
531-
from monai.utils import OptionalImportError
532-
533-
# Patch SUPPORTED_READERS entries to raise OptionalImportError
534-
# This simulates optional packages not being installed
535531
from monai.transforms.io.array import SUPPORTED_READERS
536532

537533
# Patch a few readers to fail (e.g., ITKReader)

0 commit comments

Comments
 (0)