Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

fix: skip dynamo test for visual prompter (#2874)

João Gustavo A. Amorimf6bf86927215
diff --git a/conftest.py b/conftest.py
index 5f31dac81..e7d00f6ab 100644
--- a/conftest.py
+++ b/conftest.py
@@ -129,6 +129,10 @@ def pytest_generate_tests(metafunc):
# Exclude any blacklisted device/dtype combinations.
params = [combo for combo in product(device_names, dtype_names) if combo not in DEVICE_DTYPE_BLACKLIST]
metafunc.parametrize("device_name,dtype_name", params)
+ elif device_names is not None and dtype_names is None and optimizer_backends_names is not None:
+ params = product(device_names, optimizer_backends_names)
+ metafunc.parametrize("device_name,optimizer_backend", params)
+
elif device_names is not None:
metafunc.parametrize("device_name", device_names)
elif dtype_names is not None:
diff --git a/tests/contrib/test_prompter.py b/tests/contrib/test_prompter.py
index 3118937cd..99069f1ab 100644
--- a/tests/contrib/test_prompter.py
+++ b/tests/contrib/test_prompter.py
@@ -3,7 +3,6 @@ import torch
from kornia.contrib.models.sam import SamConfig
from kornia.contrib.visual_prompter import VisualPrompter
-from kornia.utils._compat import torch_version
from testing.base import BaseTester
@@ -85,8 +84,7 @@ class TestVisualPrompter(BaseTester):
@pytest.mark.skip(reason="Unnecessary test")
def test_module(self): ...
- @pytest.mark.skipif(torch_version() in {"2.0.0", "2.0.1", "2.1.2"}, reason="Not working on 2.0.x and 2.1.x")
- def test_dynamo(self, device):
+ def test_dynamo(self, device, torch_optimizer):
dtype = torch.float32
batch_size = 1
N = 2