test: fix test - delete env var before running

This commit is contained in:
Krrish Dholakia 2025-03-11 20:57:57 -07:00
parent e2ae504a81
commit d9c32342fe

View file

@ -137,6 +137,7 @@ def test_router_init_azure_service_principal_with_secret_with_environment_variab
mocked_os_lib: MagicMock,
mocked_credential: MagicMock,
mocked_get_bearer_token_provider: MagicMock,
monkeypatch,
) -> None:
"""
Test router initialization and sample completion using Azure Service Principal with Secret authentication workflow,
@ -145,6 +146,7 @@ def test_router_init_azure_service_principal_with_secret_with_environment_variab
To allow for local testing without real credentials, first must mock Azure SDK authentication functions
and environment variables.
"""
monkeypatch.delenv("AZURE_API_KEY", raising=False)
litellm.enable_azure_ad_token_refresh = True
# mock the token provider function
mocked_func_generating_token = MagicMock(return_value="test_token")