mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-30 01:52:18 +00:00
test: isolate redis py4 import fallback
This commit is contained in:
parent
5eb2f65380
commit
3c35c46f96
1 changed files with 7 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue