Skip to content

Commit 5bb5ac8

Browse files
committed
style(test_suod): strip CRLF from TestSUODOptionalImport block
Cleanup follow-up to #676. The new test block landed with CRLF line endings (likely a contributor-side editor / git config artifact) and was the only section flagged by `git diff --cached --check` as trailing whitespace. Normalizes only the new block to LF; the rest of the file keeps its existing CRLF until a broader normalization pass. No behavior change.
1 parent bde67e1 commit 5bb5ac8

1 file changed

Lines changed: 32 additions & 32 deletions

File tree

pyod/test/test_suod.py

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -204,35 +204,35 @@ def tearDown(self):
204204
pass
205205

206206

207-
class TestSUODOptionalImport(unittest.TestCase):
208-
"""Regression for issue #640.
209-
210-
When the optional `suod` package is not installed, importing
211-
`pyod.models.suod` used to print a friendly hint and then crash on
212-
the unconditional `from suod.models.base import SUOD as SUOD_model`.
213-
The fix tolerates the failure at module load and raises an
214-
actionable ImportError only when the user constructs `SUOD()`.
215-
"""
216-
217-
def test_constructor_raises_actionable_error_when_suod_missing(self):
218-
from pyod.models import suod as suod_module
219-
original = suod_module.SUOD_model
220-
original_err = suod_module._SUOD_IMPORT_ERROR
221-
try:
222-
# Simulate suod-not-installed without uninstalling it (which
223-
# would break the rest of the suite).
224-
suod_module.SUOD_model = None
225-
suod_module._SUOD_IMPORT_ERROR = ImportError(
226-
"No module named 'suod'")
227-
with self.assertRaises(ImportError) as ctx:
228-
suod_module.SUOD()
229-
msg = str(ctx.exception)
230-
self.assertIn("pip install suod", msg)
231-
self.assertIn("suod", msg)
232-
finally:
233-
suod_module.SUOD_model = original
234-
suod_module._SUOD_IMPORT_ERROR = original_err
235-
236-
237-
if __name__ == '__main__':
238-
unittest.main()
207+
class TestSUODOptionalImport(unittest.TestCase):
208+
"""Regression for issue #640.
209+
210+
When the optional `suod` package is not installed, importing
211+
`pyod.models.suod` used to print a friendly hint and then crash on
212+
the unconditional `from suod.models.base import SUOD as SUOD_model`.
213+
The fix tolerates the failure at module load and raises an
214+
actionable ImportError only when the user constructs `SUOD()`.
215+
"""
216+
217+
def test_constructor_raises_actionable_error_when_suod_missing(self):
218+
from pyod.models import suod as suod_module
219+
original = suod_module.SUOD_model
220+
original_err = suod_module._SUOD_IMPORT_ERROR
221+
try:
222+
# Simulate suod-not-installed without uninstalling it (which
223+
# would break the rest of the suite).
224+
suod_module.SUOD_model = None
225+
suod_module._SUOD_IMPORT_ERROR = ImportError(
226+
"No module named 'suod'")
227+
with self.assertRaises(ImportError) as ctx:
228+
suod_module.SUOD()
229+
msg = str(ctx.exception)
230+
self.assertIn("pip install suod", msg)
231+
self.assertIn("suod", msg)
232+
finally:
233+
suod_module.SUOD_model = original
234+
suod_module._SUOD_IMPORT_ERROR = original_err
235+
236+
237+
if __name__ == '__main__':
238+
unittest.main()

0 commit comments

Comments
 (0)