Merge pull request #3588 from msabramo/msabramo/test_proxy_server_client_no_auth_fake_env_vars

Set fake env vars for `client_no_auth` fixture
This commit is contained in:
Ishaan Jaff 2024-05-11 15:57:28 -07:00 committed by GitHub
commit 19a65ea75b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -109,7 +109,17 @@ def mock_patch_aimage_generation():
@pytest.fixture(scope="function")
def client_no_auth():
def fake_env_vars(monkeypatch):
# Set some fake environment variables
monkeypatch.setenv("OPENAI_API_KEY", "fake_openai_api_key")
monkeypatch.setenv("OPENAI_API_BASE", "http://fake-openai-api-base")
monkeypatch.setenv("AZURE_API_BASE", "http://fake-azure-api-base")
monkeypatch.setenv("AZURE_OPENAI_API_KEY", "fake_azure_openai_api_key")
monkeypatch.setenv("AZURE_SWEDEN_API_BASE", "http://fake-azure-sweden-api-base")
@pytest.fixture(scope="function")
def client_no_auth(fake_env_vars):
# Assuming litellm.proxy.proxy_server is an object
from litellm.proxy.proxy_server import cleanup_router_config_variables