From 9af8dd3de7626183a9a9ec8973cebc672d690400 Mon Sep 17 00:00:00 2001 From: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com> Date: Mon, 1 Jul 2024 09:10:27 +0200 Subject: [PATCH] Skip faiss tests on Windows to avoid running CI for 360 minutes (#7014) * Refactor require_faiss * Skip faiss tests on Windows --- tests/utils.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/tests/utils.py b/tests/utils.py index be81f24a21a..6448fe79272 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -67,18 +67,7 @@ def parse_flag_from_env(key, default=False): ) -def require_faiss(test_case): - """ - Decorator marking a test that requires Faiss. - - These tests are skipped when Faiss isn't installed. - - """ - try: - import faiss # noqa - except ImportError: - test_case = unittest.skip("test requires faiss")(test_case) - return test_case +require_faiss = pytest.mark.skipif(find_spec("faiss") is None or sys.platform == "win32", reason="test requires faiss") def require_regex(test_case):