diff --git a/tests/utils.py b/tests/utils.py index 63eabbf2f3f..ff046439e29 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -73,18 +73,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):