From 95038d61290edb03f2c218784a2faa97b5c5d18a Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Wed, 11 Feb 2026 16:10:22 +0000 Subject: [PATCH] add @needs_mlx decorator on tests --- studio/backend/tests/test_utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/studio/backend/tests/test_utils.py b/studio/backend/tests/test_utils.py index 03e221d336..60a9969edc 100644 --- a/studio/backend/tests/test_utils.py +++ b/studio/backend/tests/test_utils.py @@ -90,6 +90,7 @@ class TestGetDevice: patch("torch.cuda.is_available", return_value=True): assert _reset_and_detect() == DeviceType.CUDA + @needs_mlx def test_returns_mlx_when_on_apple_silicon_with_mlx(self): with patch("utils.hardware.hardware._has_torch", return_value=False), \ patch("utils.hardware.hardware.is_apple_silicon", return_value=True), \ @@ -147,6 +148,7 @@ class TestClearGpuCache: mock_empty.assert_called_once() mock_ipc.assert_called_once() + @needs_mlx def test_mlx_does_not_raise(self): """MLX cache clear is a no-op — should just succeed.""" with patch("utils.hardware.hardware.get_device", return_value=DeviceType.MLX): @@ -324,6 +326,7 @@ class TestFormatErrorMessage: # --- OOM on MLX --- + @needs_mlx def test_mlx_oom(self): err = Exception("MLX backend out of memory") with patch("utils.hardware.get_device", return_value=DeviceType.MLX):