Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

test(models): skip the SAM ONNX export test on macOS runners (#4198)

Dmytro Mishkin779c2679681b
diff --git a/tests/models/test_sam_onnx.py b/tests/models/test_sam_onnx.py
index ffc3b9df5..f05846bdb 100644
--- a/tests/models/test_sam_onnx.py
+++ b/tests/models/test_sam_onnx.py
@@ -17,6 +17,8 @@
"""ONNX export tests for SAM (image encoder subgraph)."""
+import sys
+
import pytest
from kornia.models.sam.model import Sam, SamConfig
@@ -31,6 +33,10 @@ def test_sam_has_to_onnx():
@pytest.mark.timeout(120)
+ sys.platform == "darwin",
+ reason="TorchScript tracing of the SAM encoder exceeds the 120s timeout on macOS CI runners",
+)
def test_sam_encoder_to_onnx(tmp_path):
"""Sam.to_onnx() exports the image encoder subgraph with correct output name."""
onnx = pytest.importorskip("onnx")