Skip to content

Commit 77ae328

Browse files
skip tests when necessary
1 parent e2ce1a6 commit 77ae328

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/integration/test_query.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from datetime import timedelta
23

34
import pytest
@@ -21,10 +22,9 @@
2122
Text,
2223
Timestamp,
2324
)
25+
from redisvl.redis.connection import compare_versions
2426
from redisvl.redis.utils import array_to_buffer
2527

26-
# TODO expand to multiple schema types and sync + async
27-
2828

2929
@pytest.fixture
3030
def vector_query():
@@ -961,6 +961,14 @@ def missing_fields_index(worker_id, redis_url):
961961
# Create the index
962962
missing_index.create(overwrite=True)
963963

964+
# Skip all missing field tests if Redis version doesn't support INDEXMISSING/INDEXEMPTY (requires Redis 7.4+)
965+
redis_version = missing_index.client.info()["redis_version"]
966+
if not compare_versions(redis_version, "7.4.0"):
967+
missing_index.delete(drop=True) # Clean up before skipping
968+
pytest.skip(
969+
"INDEXMISSING/INDEXEMPTY features require Redis 7.4+ (RediSearch 2.10+)"
970+
)
971+
964972
# Load test data with different missing field scenarios
965973
test_data = [
966974
{

0 commit comments

Comments
 (0)