test(caching): annotate new semantic cache and hosted_vllm test helpers

This commit is contained in:
mateo-berri 2026-08-18 15:20:13 -07:00
parent ef2c30227a
commit 3894455c99
2 changed files with 5 additions and 4 deletions

View file

@ -1167,7 +1167,7 @@ async def test_redis_async_embedding_forwards_full_metadata(monkeypatch):
LONG_PROMPT = " ".join(f"token{i}" for i in range(300))
def _proxy_with_router(monkeypatch, router, model_name):
def _proxy_with_router(monkeypatch: pytest.MonkeyPatch, router: MagicMock, model_name: str) -> None:
import sys
import types
@ -1177,7 +1177,7 @@ def _proxy_with_router(monkeypatch, router, model_name):
monkeypatch.setitem(sys.modules, "litellm.proxy.proxy_server", fake_proxy)
def _token_count(model, text):
def _token_count(model: str, text: str) -> int:
import litellm
return len(litellm.encode(model=model, text=text))
@ -1254,7 +1254,8 @@ def test_redis_semantic_cache_init_stores_embedding_max_input_tokens(monkeypatch
embedding_max_input_tokens=512,
)
assert cache.embedding_max_input_tokens == 512
assert RedisSemanticCache(redis_url="redis://localhost:6379", similarity_threshold=0.8).embedding_max_input_tokens is None
default_cache = RedisSemanticCache(redis_url="redis://localhost:6379", similarity_threshold=0.8)
assert default_cache.embedding_max_input_tokens is None
def test_redis_init_defers_redisvl_construction(monkeypatch):

View file

@ -296,7 +296,7 @@ class TestHostedVLLMEmbeddingTransformation:
{"truncate": "END", "input_type": "query"},
],
)
def test_provider_params_are_sent_at_the_top_level_of_the_request(self, provider_params):
def test_provider_params_are_sent_at_the_top_level_of_the_request(self, provider_params: dict[str, object]) -> None:
from litellm.llms.custom_httpx.http_handler import HTTPHandler
client = HTTPHandler()