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):