diff --git a/tests/unit/proxy/pass_through_endpoints/test_passthrough_endpoint_router.py b/tests/unit/proxy/pass_through_endpoints/test_passthrough_endpoint_router.py index de1350ab201..deb02b35e8b 100644 --- a/tests/unit/proxy/pass_through_endpoints/test_passthrough_endpoint_router.py +++ b/tests/unit/proxy/pass_through_endpoints/test_passthrough_endpoint_router.py @@ -1,6 +1,7 @@ import asyncio import os import unittest +from typing import Final from unittest.mock import patch import pytest @@ -60,12 +61,12 @@ def test_credential_loaded_after_deployment_registration_still_resolves(): ) -def _team_deployment(model: str, team_id: str, **litellm_params) -> dict: +def _team_deployment(model: str, team_id: str, **litellm_params: str) -> dict[str, object]: return {**_flagged_deployment(model, **litellm_params), "model_info": {"team_id": team_id}} -def test_proxy_wide_deployment_credentials_skip_a_team_deployment_for_the_proxy_wide_one(): - llm_router = litellm.Router( +def test_proxy_wide_deployment_credentials_skip_a_team_deployment_for_the_proxy_wide_one() -> None: + llm_router: Final = litellm.Router( model_list=[ _team_deployment( "watsonx/ibm/granite-3-8b-instruct", @@ -81,14 +82,16 @@ def test_proxy_wide_deployment_credentials_skip_a_team_deployment_for_the_proxy_ ] ) - credentials = _passthrough_router(llm_router).get_proxy_wide_deployment_credentials(custom_llm_provider="watsonx") + credentials: Final = _passthrough_router(llm_router).get_proxy_wide_deployment_credentials( + custom_llm_provider="watsonx" + ) assert credentials is not None assert (credentials.api_key, credentials.api_base) == ("wx-proxy-wide-key", "https://eu-de.ml.cloud.ibm.com") -def test_proxy_wide_deployment_credentials_are_none_when_only_a_team_deployment_is_flagged(): - llm_router = litellm.Router( +def test_proxy_wide_deployment_credentials_are_none_when_only_a_team_deployment_is_flagged() -> None: + llm_router: Final = litellm.Router( model_list=[_team_deployment("watsonx/ibm/granite-3-8b-instruct", "team-a", api_key="wx-team-a-key")] ) diff --git a/tests/unit/proxy/pass_through_endpoints/test_watsonx_proxy_route.py b/tests/unit/proxy/pass_through_endpoints/test_watsonx_proxy_route.py index 8b41f434201..e19612da1ee 100644 --- a/tests/unit/proxy/pass_through_endpoints/test_watsonx_proxy_route.py +++ b/tests/unit/proxy/pass_through_endpoints/test_watsonx_proxy_route.py @@ -6,6 +6,7 @@ and version parameter injection. """ import json +from typing import Final from unittest.mock import AsyncMock, MagicMock, Mock, patch import pytest @@ -557,8 +558,10 @@ async def test_watsonx_route_falls_back_to_env_when_no_deployment_is_flagged(mon @pytest.mark.asyncio -async def test_watsonx_route_falls_back_to_env_when_the_only_flagged_deployment_belongs_to_a_team(monkeypatch): - llm_router = litellm.Router( +async def test_watsonx_route_falls_back_to_env_when_the_only_flagged_deployment_belongs_to_a_team( + monkeypatch: pytest.MonkeyPatch, +) -> None: + llm_router: Final = litellm.Router( model_list=[ { **_watsonx_deployment("wx-team-a-key", "https://team-a.ml.cloud.ibm.com", use_in_pass_through=True),