Skip to content

Commit 0e11958

Browse files
Skip faiss tests on Windows to avoid running CI for 360 minutes (#7014)
* Refactor require_faiss * Skip faiss tests on Windows
1 parent 2ff15c5 commit 0e11958

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

tests/utils.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,7 @@ def parse_flag_from_env(key, default=False):
7373
)
7474

7575

76-
def require_faiss(test_case):
77-
"""
78-
Decorator marking a test that requires Faiss.
79-
80-
These tests are skipped when Faiss isn't installed.
81-
82-
"""
83-
try:
84-
import faiss # noqa
85-
except ImportError:
86-
test_case = unittest.skip("test requires faiss")(test_case)
87-
return test_case
76+
require_faiss = pytest.mark.skipif(find_spec("faiss") is None or sys.platform == "win32", reason="test requires faiss")
8877

8978

9079
def require_regex(test_case):

0 commit comments

Comments
 (0)