diff --git a/tests/test_litellm/caching/test_valkey_semantic_cache.py b/tests/test_litellm/caching/test_valkey_semantic_cache.py index f128795039d..45564199467 100644 --- a/tests/test_litellm/caching/test_valkey_semantic_cache.py +++ b/tests/test_litellm/caching/test_valkey_semantic_cache.py @@ -543,12 +543,18 @@ def test_valkey_cache_supports_redis_py_4_index_module(): import sys import types - from redis.commands.search.index_definition import IndexDefinition, IndexType + class IndexDefinition: + def __init__(self, *args, **kwargs): + pass + + class IndexType: + pass legacy = types.ModuleType("redis.commands.search.indexDefinition") legacy.IndexDefinition = IndexDefinition legacy.IndexType = IndexType sys.modules[legacy.__name__] = legacy + original_import = builtins.__import__ def compatibility_import(name, *args, **kwargs):