mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-23 05:34:41 +00:00
test(sdk): finalize optional Redis regression
Assisted-by: OpenAI Codex Signed-off-by: amarrtech <272048731+amarrtech@users.noreply.github.com>
This commit is contained in:
parent
dbdb84d86a
commit
6ab33e4a29
1 changed files with 4 additions and 4 deletions
|
|
@ -14,7 +14,7 @@ from litellm.proxy.proxy_server import ProxyStartupEvent
|
|||
|
||||
|
||||
def test_importing_module_does_not_require_redis(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
original_import = builtins.__import__
|
||||
original_import: Final = builtins.__import__
|
||||
|
||||
def import_without_redis(
|
||||
name: str,
|
||||
|
|
@ -28,12 +28,12 @@ def test_importing_module_does_not_require_redis(monkeypatch: pytest.MonkeyPatch
|
|||
return original_import(name, globals, locals, fromlist, level)
|
||||
|
||||
monkeypatch.setattr(builtins, "__import__", import_without_redis)
|
||||
module_path = Path(__file__).parents[5] / "litellm/proxy/db/db_transaction_queue/redis_update_buffer.py"
|
||||
spec = importlib.util.spec_from_file_location("redis_update_buffer_without_redis", module_path)
|
||||
module_path: Final = Path(__file__).parents[5] / "litellm/proxy/db/db_transaction_queue/redis_update_buffer.py"
|
||||
spec: Final = importlib.util.spec_from_file_location("redis_update_buffer_without_redis", module_path)
|
||||
assert spec is not None
|
||||
assert spec.loader is not None
|
||||
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
module: Final = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue