Skip to content

Commit 3ce0cc1

Browse files
committed
✅ Switch sequence of contexts
1 parent 16e66c9 commit 3ce0cc1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

CPAC/unet/tests/test_torch.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ def test_import_torch(monkeypatch, readonly, tmp_path, workdir):
4545

4646
@pytest.mark.parametrize("error", [ImportError, ModuleNotFoundError, None])
4747
def test_validate_unet(error):
48-
"""Test that pipeline validation throws error if torch is not
49-
installable.
50-
"""
48+
"""Test that pipeline validation throws error if torch is not installable."""
5149
if error:
5250
import_module = MagicMock(side_effect=error())
53-
with patch("importlib.import_module", import_module):
54-
with pytest.raises(OSError) as os_error:
51+
with pytest.raises(OSError) as os_error:
52+
with patch("importlib.import_module", import_module):
5553
from CPAC.utils.configuration import Preconfiguration
5654

5755
monkey = Preconfiguration("monkey")

0 commit comments

Comments
 (0)