The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix: cleanup tests
Krrish Dholakiac7e2bfc577ba
diff --git a/tests/batches_tests/test_fine_tuning_api.py b/tests/batches_tests/test_fine_tuning_api.pyindex 034f4e1b495..5dfbc0de71d 100644--- a/tests/batches_tests/test_fine_tuning_api.py+++ b/tests/batches_tests/test_fine_tuning_api.py@@ -406,29 +406,6 @@ def test_convert_basic_openai_request_to_vertex_request():)[email protected](reason="skipping - we run mock tests for vertex ai")-async def test_create_vertex_fine_tune_jobs():- verbose_logger.setLevel(logging.DEBUG)- # load_vertex_ai_credentials()-- vertex_credentials = os.getenv("GCS_PATH_SERVICE_ACCOUNT")- print("creating fine tuning job")- create_fine_tuning_response = await litellm.acreate_fine_tuning_job(- model="gemini-1.0-pro-002",- custom_llm_provider="vertex_ai",- training_file="gs://cloud-samples-data/ai-platform/generative_ai/sft_train_data.jsonl",- vertex_project="pathrise-convert-1606954137718",- vertex_location="us-central1",- vertex_credentials=vertex_credentials,- )- print("vertex ai create fine tuning response=", create_fine_tuning_response)-- assert create_fine_tuning_response.id is not None- assert create_fine_tuning_response.model == "gemini-1.0-pro-002"- assert create_fine_tuning_response.object == "fine_tuning.job"--@pytest.mark.asyncioasync def test_mock_openai_create_fine_tune_job():"""Test that create_fine_tuning_job sends correct parameters to OpenAI"""@@ -536,7 +513,6 @@ async def test_mock_openai_retrieve_fine_tune_job():except Exception as e:print("error=", e)-# Verify the requestmock_retrieve.assert_called_once_with(fine_tuning_job_id="ft-123")@@ -544,7 +520,9 @@ async def test_mock_openai_retrieve_fine_tune_job():@pytest.mark.asyncioasync def test_mock_azure_create_fine_tune_job_with_azure_specific_params():"""Test that Azure-specific parameters are passed through extra_body"""- from openai.types.fine_tuning.fine_tuning_job import Hyperparameters as OAIHyperparameters+ from openai.types.fine_tuning.fine_tuning_job import (+ Hyperparameters as OAIHyperparameters,+ )from litellm.types.utils import LiteLLMFineTuningJobmock_response = LiteLLMFineTuningJob(@@ -564,7 +542,9 @@ async def test_mock_azure_create_fine_tune_job_with_azure_specific_params():async def mock_async_create(*args, **kwargs):return mock_response- with patch("litellm.llms.azure.fine_tuning.handler.AzureOpenAIFineTuningAPI.create_fine_tuning_job") as mock_create:+ with patch(+ "litellm.llms.azure.fine_tuning.handler.AzureOpenAIFineTuningAPI.create_fine_tuning_job"+ ) as mock_create:mock_create.return_value = mock_async_create()response = await litellm.acreate_fine_tuning_job(@@ -575,10 +555,7 @@ async def test_mock_azure_create_fine_tune_job_with_azure_specific_params():api_key="test-key",api_version="2025-04-01-preview",trainingType=1,- hyperparameters={- "n_epochs": 3,- "prompt_loss_weight": 0.1- },+ hyperparameters={"n_epochs": 3, "prompt_loss_weight": 0.1},)# Verify the request@@ -590,7 +567,7 @@ async def test_mock_azure_create_fine_tune_job_with_azure_specific_params():assert create_data["model"] == "gpt-4.1-mini-2025-04-14"assert create_data["training_file"] == "file-123"assert create_data["hyperparameters"] == {"n_epochs": 3}-+# Azure-specific parameters should be in extra_bodyassert "extra_body" in create_dataassert create_data["extra_body"]["trainingType"] == 1diff --git a/tests/batches_tests/test_openai_batches_and_files.py b/tests/batches_tests/test_openai_batches_and_files.pyindex e4e1180eb13..0aed224c256 100644--- a/tests/batches_tests/test_openai_batches_and_files.py+++ b/tests/batches_tests/test_openai_batches_and_files.py@@ -54,7 +54,7 @@ def load_vertex_ai_credentials():print("loading vertex ai credentials")os.environ["GCS_FLUSH_INTERVAL"] = "1"filepath = os.path.dirname(os.path.abspath(__file__))- vertex_key_path = filepath + "/pathrise-convert-1606954137718.json"+ vertex_key_path = filepath + "/vertex_key.json"# Read the existing content of the file or create an empty dictionarytry:diff --git a/tests/image_gen_tests/test_image_generation.py b/tests/image_gen_tests/test_image_generation.pyindex aca5c41de38..b22a18b49b8 100644--- a/tests/image_gen_tests/test_image_generation.py+++ b/tests/image_gen_tests/test_image_generation.py@@ -113,7 +113,7 @@ class TestVertexImageGeneration(BaseImageGenTest):litellm.in_memory_llm_clients_cache = InMemoryCache()return {"model": "vertex_ai/imagen-3.0-fast-generate-001",- "vertex_ai_project": "pathrise-convert-1606954137718",+ "vertex_ai_project": "litellm-ci-cd","vertex_ai_location": "us-central1","n": 1,}@@ -129,7 +129,7 @@ class TestVertexAIGeminiImageGeneration(BaseImageGenTest):litellm.in_memory_llm_clients_cache = InMemoryCache()return {"model": "vertex_ai/gemini-2.5-flash-image",- "vertex_ai_project": "pathrise-convert-1606954137718",+ "vertex_ai_project": "litellm-ci-cd","vertex_ai_location": "us-central1","n": 1,"size": "1024x1024",diff --git a/tests/litellm_utils_tests/test_secret_manager.py b/tests/litellm_utils_tests/test_secret_manager.pyindex 7569c673ece..a3e7a8496f0 100644--- a/tests/litellm_utils_tests/test_secret_manager.py+++ b/tests/litellm_utils_tests/test_secret_manager.py@@ -226,7 +226,7 @@ def test_google_secret_manager():"""Test that we can get a secret from Google Secret Manager"""- os.environ["GOOGLE_SECRET_MANAGER_PROJECT_ID"] = "pathrise-convert-1606954137718"+ os.environ["GOOGLE_SECRET_MANAGER_PROJECT_ID"] = "litellm-ci-cd"from litellm.secret_managers.google_secret_manager import GoogleSecretManager@@ -252,7 +252,7 @@ def test_google_secret_manager_read_in_memory():from litellm.secret_managers.google_secret_manager import GoogleSecretManagerload_vertex_ai_credentials()- os.environ["GOOGLE_SECRET_MANAGER_PROJECT_ID"] = "pathrise-convert-1606954137718"+ os.environ["GOOGLE_SECRET_MANAGER_PROJECT_ID"] = "litellm-ci-cd"secret_manager = GoogleSecretManager()secret_manager.cache.cache_dict["UNIQUE_KEY"] = Nonesecret_manager.cache.cache_dict["UNIQUE_KEY_2"] = "lite-llm"@@ -337,6 +337,7 @@ def test_get_secret_with_access_mode():litellm._key_management_settings = KeyManagementSettings()del os.environ[test_secret_name]+def test_key_management_settings_defaults():"""Test that KeyManagementSettings initializes with correct default values.diff --git a/tests/local_testing/test_exceptions.py b/tests/local_testing/test_exceptions.pyindex 123442d1cf6..e02d9e21171 100644--- a/tests/local_testing/test_exceptions.py+++ b/tests/local_testing/test_exceptions.py@@ -24,7 +24,7 @@ from litellm import ( # AuthenticationError,; RateLimitError,; ServiceUnavailabembedding,)-litellm.vertex_project = "pathrise-convert-1606954137718"+litellm.vertex_project = "litellm-ci-cd"litellm.vertex_location = "us-central1"litellm.num_retries = 0diff --git a/tests/old_proxy_tests/tests/test_vtx_sdk_embedding.py b/tests/old_proxy_tests/tests/test_vtx_sdk_embedding.pyindex ff7f835a8da..a71718a204a 100644--- a/tests/old_proxy_tests/tests/test_vtx_sdk_embedding.py+++ b/tests/old_proxy_tests/tests/test_vtx_sdk_embedding.py@@ -37,7 +37,7 @@ class CredentialsWrapper(Credentials):credentials = CredentialsWrapper(token=LITELLM_PROXY_API_KEY)vertexai.init(- project="pathrise-convert-1606954137718",+ project="litellm-ci-cd",location="us-central1",api_endpoint=LITELLM_PROXY_BASE,credentials=credentials,diff --git a/tests/proxy_unit_tests/adroit-crow-413218-bc47f303efc9.json b/tests/proxy_unit_tests/adroit-crow-413218-bc47f303efc9.jsondeleted file mode 100644index 7e02c821360..00000000000--- a/tests/proxy_unit_tests/adroit-crow-413218-bc47f303efc9.json+++ /dev/null@@ -1,13 +0,0 @@-{- "type": "service_account",- "project_id": "pathrise-convert-1606954137718",- "private_key_id": "",- "private_key": "",- "client_email": "test-adroit-crow@pathrise-convert-1606954137718.iam.gserviceaccount.com",- "client_id": "104886546564708740969",- "auth_uri": "https://accounts.google.com/o/oauth2/auth",- "token_uri": "https://oauth2.googleapis.com/token",- "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",- "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test-adroit-crow%40pathrise-convert-1606954137718.iam.gserviceaccount.com",- "universe_domain": "googleapis.com"-}