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
test: drop the cwd-relative sys.path.insert calls from the test suite (#37802)
yuneng-jiang6a0d03914c0e
diff --git a/test-quality-budget.json b/test-quality-budget.jsonindex c16b34b9395..0dea4e8fe93 100644--- a/test-quality-budget.json+++ b/test-quality-budget.json@@ -6,7 +6,7 @@"limit": 742},"TQ003": {- "limit": 1068+ "limit": 62},"TQ004": {"limit": 469diff --git a/tests/agent_tests/local_only_agent_tests/test_a2a.py b/tests/agent_tests/local_only_agent_tests/test_a2a.pyindex 16ff545db14..e2e73808b95 100644--- a/tests/agent_tests/local_only_agent_tests/test_a2a.py+++ b/tests/agent_tests/local_only_agent_tests/test_a2a.py@@ -6,8 +6,6 @@ Run with:"""import asyncio-import os-import sysimport jsonfrom typing import Optionalfrom uuid import uuid4@@ -18,9 +16,6 @@ import litellmfrom litellm.integrations.custom_logger import CustomLoggerfrom litellm.types.utils import StandardLoggingPayload-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom a2a.types import MessageSendParams, SendMessageRequestdiff --git a/tests/agent_tests/local_only_agent_tests/test_a2a_completion_bridge.py b/tests/agent_tests/local_only_agent_tests/test_a2a_completion_bridge.pyindex 4369bb800af..ff7e9da0368 100644--- a/tests/agent_tests/local_only_agent_tests/test_a2a_completion_bridge.py+++ b/tests/agent_tests/local_only_agent_tests/test_a2a_completion_bridge.py@@ -10,13 +10,10 @@ Prerequisites:- LangGraph server running on localhost:2024"""-import os-import sysfrom uuid import uuid4import pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom a2a.types import MessageSendParams, SendMessageRequest, SendStreamingMessageRequestdiff --git a/tests/audio_tests/conftest.py b/tests/audio_tests/conftest.pyindex c4ff576e5bd..21e7c868641 100644--- a/tests/audio_tests/conftest.py+++ b/tests/audio_tests/conftest.py@@ -1,9 +1,6 @@-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))from tests._vcr_conftest_common import ( # noqa: E402,F401VerboseReporterState,diff --git a/tests/audio_tests/test_audio_speech.py b/tests/audio_tests/test_audio_speech.pyindex fb9e679699a..f5a0cef6049 100644--- a/tests/audio_tests/test_audio_speech.py+++ b/tests/audio_tests/test_audio_speech.py@@ -4,7 +4,6 @@import asyncioimport osimport random-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -13,9 +12,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom pathlib import Pathfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/audio_tests/test_whisper.py b/tests/audio_tests/test_whisper.pyindex 333d806fe41..ba0ec02a02f 100644--- a/tests/audio_tests/test_whisper.py+++ b/tests/audio_tests/test_whisper.py@@ -4,7 +4,6 @@import asyncioimport loggingimport os-import sysimport timeimport tracebackfrom typing import Optional@@ -41,9 +40,6 @@ def _audio_file2():load_dotenv()-sys.path.insert(- 0, os.path.abspath("../")-) # Adds the parent directory to the system pathfrom litellm import Routerdiff --git a/tests/batches_tests/conftest.py b/tests/batches_tests/conftest.pyindex e1899a22b6c..b46726c0c85 100644--- a/tests/batches_tests/conftest.py+++ b/tests/batches_tests/conftest.py@@ -1,12 +1,7 @@import asyncio-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm # noqa: E402,F401from tests._vcr_conftest_common import ( # noqa: E402,F401diff --git a/tests/batches_tests/test_batch_rate_limits.py b/tests/batches_tests/test_batch_rate_limits.pyindex ae02c1be12c..b44b8435cd9 100644--- a/tests/batches_tests/test_batch_rate_limits.py+++ b/tests/batches_tests/test_batch_rate_limits.py@@ -5,14 +5,10 @@ Integration Tests for Batch Rate Limitsimport asyncioimport jsonimport os-import sysimport pytestfrom fastapi import HTTPException-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import DualCachediff --git a/tests/batches_tests/test_batches_logging_unit_tests.py b/tests/batches_tests/test_batches_logging_unit_tests.pyindex 62b6f5b08e4..5211b3ecb29 100644--- a/tests/batches_tests/test_batches_logging_unit_tests.py+++ b/tests/batches_tests/test_batches_logging_unit_tests.py@@ -1,15 +1,10 @@import asyncioimport json-import os-import sysimport tracebackfrom unittest.mock import AsyncMock, MagicMock, patchfrom dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport loggingimport timediff --git a/tests/batches_tests/test_bedrock_files_and_batches.py b/tests/batches_tests/test_bedrock_files_and_batches.pyindex b9045cc43d6..336fd7dd953 100644--- a/tests/batches_tests/test_bedrock_files_and_batches.py+++ b/tests/batches_tests/test_bedrock_files_and_batches.py@@ -3,15 +3,11 @@import asyncioimport json as json_moduleimport os-import sysimport tracebackimport tempfilefrom dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport pytestdiff --git a/tests/batches_tests/test_fine_tuning_api.py b/tests/batches_tests/test_fine_tuning_api.pyindex bd6672a52e9..41b47c1ee68 100644--- a/tests/batches_tests/test_fine_tuning_api.py+++ b/tests/batches_tests/test_fine_tuning_api.py@@ -1,12 +1,7 @@-import os-import sysimport tracebackimport jsonimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom openai import APITimeoutError as Timeoutimport litellmdiff --git a/tests/batches_tests/test_openai_batches_and_files.py b/tests/batches_tests/test_openai_batches_and_files.pyindex e849b087681..ebd7fde7971 100644--- a/tests/batches_tests/test_openai_batches_and_files.py+++ b/tests/batches_tests/test_openai_batches_and_files.py@@ -3,14 +3,10 @@import asyncioimport jsonimport os-import sysimport tempfilefrom dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport loggingimport timediff --git a/tests/code_coverage_tests/bedrock_pricing.py b/tests/code_coverage_tests/bedrock_pricing.pyindex b2c9e78b06c..5984dd8b3a4 100644--- a/tests/code_coverage_tests/bedrock_pricing.py+++ b/tests/code_coverage_tests/bedrock_pricing.py@@ -1,7 +1,5 @@import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import litellmimport requestsfrom bs4 import BeautifulSoupdiff --git a/tests/code_coverage_tests/check_spanattributes_value_usage.py b/tests/code_coverage_tests/check_spanattributes_value_usage.pyindex b180c572e73..6d1daa45fc7 100644--- a/tests/code_coverage_tests/check_spanattributes_value_usage.py+++ b/tests/code_coverage_tests/check_spanattributes_value_usage.py@@ -27,10 +27,8 @@ import astimport osimport refrom typing import List, Tuple-import sys# Add parent directory to path so we can import litellm-sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/code_coverage_tests/enforce_llms_folder_style.py b/tests/code_coverage_tests/enforce_llms_folder_style.pyindex 04a95b45196..a284cf9e1a9 100644--- a/tests/code_coverage_tests/enforce_llms_folder_style.py+++ b/tests/code_coverage_tests/enforce_llms_folder_style.py@@ -1,8 +1,6 @@import astimport os-import sys-sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/code_coverage_tests/test_router_strategy_async.py b/tests/code_coverage_tests/test_router_strategy_async.pyindex 05bdca10f45..80bfcad4453 100644--- a/tests/code_coverage_tests/test_router_strategy_async.py+++ b/tests/code_coverage_tests/test_router_strategy_async.py@@ -4,14 +4,9 @@ Test that all cache calls in async functions in router_strategy/ are async"""import os-import sysfrom typing import Dict, List, Tupleimport ast-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path-import osclass AsyncCacheCallVisitor(ast.NodeVisitor):diff --git a/tests/documentation_tests/test_api_docs.py b/tests/documentation_tests/test_api_docs.pyindex 2faac371c39..d8536f13b9c 100644--- a/tests/documentation_tests/test_api_docs.py+++ b/tests/documentation_tests/test_api_docs.py@@ -4,11 +4,7 @@ import osfrom dataclasses import dataclassimport argparseimport re-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/documentation_tests/test_exception_types.py b/tests/documentation_tests/test_exception_types.pyindex 87e128605c4..f554c4b38d4 100644--- a/tests/documentation_tests/test_exception_types.py+++ b/tests/documentation_tests/test_exception_types.py@@ -11,9 +11,6 @@ import re# Backup the original sys.pathoriginal_sys_path = sys.path.copy()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmpublic_exceptions = litellm.LITELLM_EXCEPTION_TYPESdiff --git a/tests/documentation_tests/test_router_settings.py b/tests/documentation_tests/test_router_settings.pyindex a1b6f1dac1d..75032f80dfa 100644--- a/tests/documentation_tests/test_router_settings.py+++ b/tests/documentation_tests/test_router_settings.py@@ -2,11 +2,7 @@ import osimport reimport inspectfrom typing import Type-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/documentation_tests/test_standard_logging_payload.py b/tests/documentation_tests/test_standard_logging_payload.pyindex cdb51411833..22f7b71033f 100644--- a/tests/documentation_tests/test_standard_logging_payload.py+++ b/tests/documentation_tests/test_standard_logging_payload.py@@ -1,12 +1,7 @@-import osimport re-import sysfrom typing import get_type_hints-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm.types.utils import StandardLoggingPayloaddiff --git a/tests/enterprise/conftest.py b/tests/enterprise/conftest.pyindex 8b23ba2998e..4c95f967bc4 100644--- a/tests/enterprise/conftest.py+++ b/tests/enterprise/conftest.py@@ -3,13 +3,9 @@import asyncioimport importlibimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm@@ -31,9 +27,6 @@ def setup_and_teardown():This fixture reloads litellm before every function. To speed up testing by removing callbacks being chained."""curr_dir = os.getcwd() # Get the current working directory- sys.path.insert(- 0, os.path.abspath("../..")- ) # Adds the project directory to the system pathfrom litellm import Routerdiff --git a/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py b/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.pyindex b6c9cd0294b..05886e4b7f6 100644--- a/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py+++ b/tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py@@ -1,7 +1,4 @@-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport loggingdiff --git a/tests/enterprise/litellm_enterprise/integrations/test_custom_guardrail.py b/tests/enterprise/litellm_enterprise/integrations/test_custom_guardrail.pyindex 8a29e5c1ced..c6e48061698 100644--- a/tests/enterprise/litellm_enterprise/integrations/test_custom_guardrail.py+++ b/tests/enterprise/litellm_enterprise/integrations/test_custom_guardrail.py@@ -1,9 +1,4 @@-import os-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.types.guardrails import GuardrailEventHooks, Modediff --git a/tests/enterprise/litellm_enterprise/integrations/test_prometheus.py b/tests/enterprise/litellm_enterprise/integrations/test_prometheus.pyindex 6c4a008c823..7315f2b9881 100644--- a/tests/enterprise/litellm_enterprise/integrations/test_prometheus.py+++ b/tests/enterprise/litellm_enterprise/integrations/test_prometheus.py@@ -3,15 +3,10 @@ Mock prometheus unit tests, these don't rely on LLM API calls"""import json-import os-import sysimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import patchdiff --git a/tests/enterprise/litellm_enterprise/integrations/test_prometheus_unit_tests.py b/tests/enterprise/litellm_enterprise/integrations/test_prometheus_unit_tests.pyindex f5c39fb86ae..28fd03daf37 100644--- a/tests/enterprise/litellm_enterprise/integrations/test_prometheus_unit_tests.py+++ b/tests/enterprise/litellm_enterprise/integrations/test_prometheus_unit_tests.py@@ -9,16 +9,12 @@ except Exception:PrometheusLogger = Noneimport asyncio-import sysfrom dotenv import load_dotenvload_dotenv()import os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom unittest.mock import MagicMockimport pytestdiff --git a/tests/enterprise/litellm_enterprise/proxy/auth/test_route_checks.py b/tests/enterprise/litellm_enterprise/proxy/auth/test_route_checks.pyindex f90ac9abb7d..265abbe95cf 100644--- a/tests/enterprise/litellm_enterprise/proxy/auth/test_route_checks.py+++ b/tests/enterprise/litellm_enterprise/proxy/auth/test_route_checks.py@@ -1,10 +1,6 @@import os-import sysfrom unittest.mock import MagicMock, patch-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport pytestfrom fastapi import HTTPExceptiondiff --git a/tests/enterprise/litellm_enterprise/proxy/guardrails/test_apply_guardrail_endpoint.py b/tests/enterprise/litellm_enterprise/proxy/guardrails/test_apply_guardrail_endpoint.pyindex e5074c44210..4f44a4adeed 100644--- a/tests/enterprise/litellm_enterprise/proxy/guardrails/test_apply_guardrail_endpoint.py+++ b/tests/enterprise/litellm_enterprise/proxy/guardrails/test_apply_guardrail_endpoint.py@@ -2,13 +2,10 @@Test the /guardrails/apply_guardrail endpoint"""-import os-import sysfrom unittest.mock import AsyncMock, Mock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from fastapi import HTTPExceptiondiff --git a/tests/enterprise/litellm_enterprise/proxy/guardrails/test_bedrock_apply_guardrail.py b/tests/enterprise/litellm_enterprise/proxy/guardrails/test_bedrock_apply_guardrail.pyindex 6b6b5d768dd..463076229e9 100644--- a/tests/enterprise/litellm_enterprise/proxy/guardrails/test_bedrock_apply_guardrail.py+++ b/tests/enterprise/litellm_enterprise/proxy/guardrails/test_bedrock_apply_guardrail.py@@ -2,13 +2,10 @@Test the Bedrock guardrail apply_guardrail functionality"""-import os-import sysfrom unittest.mock import AsyncMock, Mock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/enterprise/litellm_enterprise/proxy/management_endpoints/test_project_endpoints_prisma.py b/tests/enterprise/litellm_enterprise/proxy/management_endpoints/test_project_endpoints_prisma.pyindex ed6735a7126..34a0d1c9f7a 100644--- a/tests/enterprise/litellm_enterprise/proxy/management_endpoints/test_project_endpoints_prisma.py+++ b/tests/enterprise/litellm_enterprise/proxy/management_endpoints/test_project_endpoints_prisma.py@@ -1,5 +1,4 @@import os-import sysimport tracebackfrom litellm._uuid import uuidfrom unittest import mock@@ -10,7 +9,6 @@ from fastapi import Requestload_dotenv()import time-sys.path.insert(0, os.path.abspath("../.."))import loggingimport pytestdiff --git a/tests/guardrails_tests/conftest.py b/tests/guardrails_tests/conftest.pyindex f2f65645c3d..6eeb0924341 100644--- a/tests/guardrails_tests/conftest.py+++ b/tests/guardrails_tests/conftest.py@@ -7,13 +7,9 @@import importlibimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom tests._vcr_conftest_common import ( # noqa: E402,F401@@ -122,7 +118,6 @@ def setup_and_teardown():Module-scoped setup. Reloads litellm only in single-process mode(skipped under xdist to avoid cross-worker interference)."""- sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/guardrails_tests/test_bedrock_guardrails.py b/tests/guardrails_tests/test_bedrock_guardrails.pyindex 8b22cc0eb73..43d088268eb 100644--- a/tests/guardrails_tests/test_bedrock_guardrails.py+++ b/tests/guardrails_tests/test_bedrock_guardrails.py@@ -1,9 +1,6 @@-import sys-import osimport io, asyncioimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy.guardrails.guardrail_hooks.bedrock_guardrails import (BedrockGuardrail,diff --git a/tests/guardrails_tests/test_custom_guardrail.py b/tests/guardrails_tests/test_custom_guardrail.pyindex 9d7efeecdca..3c88ed53cd3 100644--- a/tests/guardrails_tests/test_custom_guardrail.py+++ b/tests/guardrails_tests/test_custom_guardrail.py@@ -3,11 +3,8 @@ Test custom guardrail + unit tests for guardrails"""import io-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport gzipdiff --git a/tests/guardrails_tests/test_deepkeep_guardrails.py b/tests/guardrails_tests/test_deepkeep_guardrails.pyindex d06610f3f4c..74bdea2e0b9 100644--- a/tests/guardrails_tests/test_deepkeep_guardrails.py+++ b/tests/guardrails_tests/test_deepkeep_guardrails.py@@ -1,5 +1,4 @@import os-import sysfrom unittest.mock import patch, AsyncMockfrom httpx import Response, Request@@ -13,9 +12,6 @@ from litellm.proxy.guardrails.guardrail_hooks.deepkeep.deepkeep import ()from litellm.exceptions import GuardrailRaisedException-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy.guardrails.init_guardrails import init_guardrails_v2diff --git a/tests/guardrails_tests/test_dynamoai_guardrails.py b/tests/guardrails_tests/test_dynamoai_guardrails.pyindex 6f0ea00165b..4f56f7cd444 100644--- a/tests/guardrails_tests/test_dynamoai_guardrails.py+++ b/tests/guardrails_tests/test_dynamoai_guardrails.py@@ -2,11 +2,8 @@Test DynamoAI Guardrails integration"""-import sys-import osimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.proxy.guardrails.guardrail_hooks.dynamoai import DynamoAIGuardrailsfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/guardrails_tests/test_eu_ai_act_article5.py b/tests/guardrails_tests/test_eu_ai_act_article5.pyindex f7384667481..d17e56c7450 100644--- a/tests/guardrails_tests/test_eu_ai_act_article5.py+++ b/tests/guardrails_tests/test_eu_ai_act_article5.py@@ -8,11 +8,9 @@ Tests 40 different sentences to validate the conditional matching logic:- identifier or block word alone should ALLOW"""-import sysimport osimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.content_filter import (ContentFilterGuardrail,@@ -162,7 +160,6 @@ def content_filter_guardrail():"""Initialize content filter guardrail with EU AI Act Article 5 template."""# Get absolute path to the policy template- import oscontent_filter_dir = os.path.join(os.path.dirname(__file__),diff --git a/tests/guardrails_tests/test_eu_ai_act_french_3_scenarios.py b/tests/guardrails_tests/test_eu_ai_act_french_3_scenarios.pyindex 221ca5aa6e6..cfc59030076 100644--- a/tests/guardrails_tests/test_eu_ai_act_french_3_scenarios.py+++ b/tests/guardrails_tests/test_eu_ai_act_french_3_scenarios.py@@ -7,11 +7,9 @@ Tests the exact 3 scenarios requested:3. Request 3: Safe query in French that should pass (allowed)"""-import sysimport osimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.content_filter import (ContentFilterGuardrail,diff --git a/tests/guardrails_tests/test_guardrail_load_balancing.py b/tests/guardrails_tests/test_guardrail_load_balancing.pyindex 4f71f83c433..2e71d2c99a3 100644--- a/tests/guardrails_tests/test_guardrail_load_balancing.py+++ b/tests/guardrails_tests/test_guardrail_load_balancing.py@@ -2,11 +2,8 @@Test guardrail load balancing through the Router and ProxyLogging."""-import os-import sysfrom unittest.mock import MagicMock, patch, AsyncMock-sys.path.insert(0, os.path.abspath("../.."))import litellmimport pytestdiff --git a/tests/guardrails_tests/test_guardrails_config.py b/tests/guardrails_tests/test_guardrails_config.pyindex aaacb607261..5160954b0eb 100644--- a/tests/guardrails_tests/test_guardrails_config.py+++ b/tests/guardrails_tests/test_guardrails_config.py@@ -2,8 +2,6 @@## Unit Tests for guardrails configimport asyncioimport inspect-import os-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -15,7 +13,6 @@ from pydantic import BaseModelimport litellm.litellm_core_utilsimport litellm.litellm_core_utils.litellm_logging-sys.path.insert(0, os.path.abspath("../.."))from typing import Any, List, Literal, Optional, Tuple, Unionfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/guardrails_tests/test_javelin_guardrails.py b/tests/guardrails_tests/test_javelin_guardrails.pyindex 62655a3c077..a2e7747d657 100644--- a/tests/guardrails_tests/test_javelin_guardrails.py+++ b/tests/guardrails_tests/test_javelin_guardrails.py@@ -1,10 +1,7 @@-import sys-import osimport pytestfrom unittest.mock import AsyncMock, patchfrom fastapi import HTTPException-sys.path.insert(0, os.path.abspath("../.."))from litellm.proxy.guardrails.guardrail_hooks.javelin import JavelinGuardrailimport litellmfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/guardrails_tests/test_lakera_v2.py b/tests/guardrails_tests/test_lakera_v2.pyindex 74e19350192..a71759862b2 100644--- a/tests/guardrails_tests/test_lakera_v2.py+++ b/tests/guardrails_tests/test_lakera_v2.py@@ -1,12 +1,9 @@-import sys-import osimport io, asyncioimport pytestimport timefrom litellm import mock_completionfrom unittest.mock import MagicMock, AsyncMock, patch-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy.guardrails.guardrail_hooks.lakera_ai_v2 import LakeraAIGuardrailfrom litellm.types.guardrails import PiiEntityType, PiiActiondiff --git a/tests/guardrails_tests/test_lasso_guardrails.py b/tests/guardrails_tests/test_lasso_guardrails.pyindex 75b571e236b..fd585623744 100644--- a/tests/guardrails_tests/test_lasso_guardrails.py+++ b/tests/guardrails_tests/test_lasso_guardrails.py@@ -1,5 +1,4 @@import os-import sysfrom fastapi.exceptions import HTTPExceptionfrom unittest.mock import patchfrom httpx import Response, Request@@ -14,9 +13,6 @@ from litellm.proxy.guardrails.guardrail_hooks.lasso.lasso import (LassoGuardrailAPIError,)-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy.guardrails.init_guardrails import init_guardrails_v2diff --git a/tests/guardrails_tests/test_presidio_pii.py b/tests/guardrails_tests/test_presidio_pii.pyindex edc63bd9419..b3b2a790ba8 100644--- a/tests/guardrails_tests/test_presidio_pii.py+++ b/tests/guardrails_tests/test_presidio_pii.py@@ -1,10 +1,8 @@-import sysimport osimport pytestfrom litellm import mock_completionfrom unittest.mock import patch-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy.guardrails.guardrail_hooks.presidio import (_OPTIONAL_PresidioPIIMasking,diff --git a/tests/guardrails_tests/test_semantic_guard.py b/tests/guardrails_tests/test_semantic_guard.pyindex c9f4a902895..92c55507568 100644--- a/tests/guardrails_tests/test_semantic_guard.py+++ b/tests/guardrails_tests/test_semantic_guard.py@@ -3,9 +3,7 @@ Tests for the Semantic Guard guardrail — embedding-based prompt injection dete"""import os-import sys-sys.path.insert(0, os.path.abspath("../.."))from unittest.mock import MagicMockdiff --git a/tests/guardrails_tests/test_sg_mas_ai_guardrails.py b/tests/guardrails_tests/test_sg_mas_ai_guardrails.pyindex e587d666a79..385fee93ab4 100644--- a/tests/guardrails_tests/test_sg_mas_ai_guardrails.py+++ b/tests/guardrails_tests/test_sg_mas_ai_guardrails.py@@ -10,11 +10,9 @@ for Singapore financial institutions:5. sg_mas_model_security — Adversarial attacks on financial AI"""-import sysimport osimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.content_filter import (ContentFilterGuardrail,diff --git a/tests/guardrails_tests/test_sg_pdpa_guardrails.py b/tests/guardrails_tests/test_sg_pdpa_guardrails.pyindex 42c3a15f9f6..1e8b8a48b85 100644--- a/tests/guardrails_tests/test_sg_pdpa_guardrails.py+++ b/tests/guardrails_tests/test_sg_pdpa_guardrails.py@@ -15,11 +15,9 @@ Each sub-guardrail validates:- identifier or block word alone → ALLOW (no match)"""-import sysimport osimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.content_filter import (ContentFilterGuardrail,diff --git a/tests/guardrails_tests/test_tracing_guardrails.py b/tests/guardrails_tests/test_tracing_guardrails.pyindex 46f4f3e6e9b..bd8b7bad33f 100644--- a/tests/guardrails_tests/test_tracing_guardrails.py+++ b/tests/guardrails_tests/test_tracing_guardrails.py@@ -1,4 +1,3 @@-import sysimport osimport io, asyncioimport json@@ -7,7 +6,6 @@ import timefrom litellm import mock_completionfrom unittest.mock import MagicMock, AsyncMock, patch-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy.guardrails.guardrail_hooks.presidio import (_OPTIONAL_PresidioPIIMasking,diff --git a/tests/image_gen_tests/base_image_generation_test.py b/tests/image_gen_tests/base_image_generation_test.pyindex ab46bd36feb..c50b09d329c 100644--- a/tests/image_gen_tests/base_image_generation_test.py+++ b/tests/image_gen_tests/base_image_generation_test.py@@ -2,14 +2,9 @@ import asyncioimport httpximport jsonimport pytest-import sysfrom typing import Any, Dict, List, Optionalfrom unittest.mock import MagicMock, Mock, patch-import os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.exceptions import BadRequestErrorfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerdiff --git a/tests/image_gen_tests/conftest.py b/tests/image_gen_tests/conftest.pyindex 9f808c11161..7e9a5c0d629 100644--- a/tests/image_gen_tests/conftest.py+++ b/tests/image_gen_tests/conftest.py@@ -1,12 +1,7 @@import asyncio-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm # noqa: E402,F401from tests._vcr_conftest_common import ( # noqa: E402,F401diff --git a/tests/image_gen_tests/test_bedrock_image_gen_unit_tests.py b/tests/image_gen_tests/test_bedrock_image_gen_unit_tests.pyindex c4d0f5fc773..1be3ca0745d 100644--- a/tests/image_gen_tests/test_bedrock_image_gen_unit_tests.py+++ b/tests/image_gen_tests/test_bedrock_image_gen_unit_tests.py@@ -1,14 +1,9 @@import logging-import os-import sysimport tracebackfrom dotenv import load_dotenvfrom openai.types.image import Image-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm.llms.bedrock.image_generation.amazon_nova_canvas_transformation import (AmazonNovaCanvasConfig,@@ -18,13 +13,9 @@ logging.basicConfig(level=logging.DEBUG)load_dotenv()import asyncio-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestfrom litellm.llms.bedrock.image_generation.cost_calculator import cost_calculatorfrom litellm.types.utils import ImageResponse, ImageObject-import osimport litellmfrom litellm.llms.bedrock.image_generation.amazon_stability3_transformation import (diff --git a/tests/image_gen_tests/test_fal_ai_image_generation.py b/tests/image_gen_tests/test_fal_ai_image_generation.pyindex 23032e44ded..d33f2c4262e 100644--- a/tests/image_gen_tests/test_fal_ai_image_generation.py+++ b/tests/image_gen_tests/test_fal_ai_image_generation.py@@ -1,11 +1,8 @@import asyncio-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import aimage_generationdiff --git a/tests/image_gen_tests/test_image_edits.py b/tests/image_gen_tests/test_image_edits.pyindex ca8ec3bbe32..0c2f57066e8 100644--- a/tests/image_gen_tests/test_image_edits.py+++ b/tests/image_gen_tests/test_image_edits.py@@ -1,6 +1,5 @@import loggingimport os-import sysimport tracebackimport asynciofrom typing import Optional@@ -11,9 +10,6 @@ from unittest.mock import patch, AsyncMockimport jsonfrom abc import ABC, abstractmethod-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.utils import ImageResponsediff --git a/tests/image_gen_tests/test_image_generation.py b/tests/image_gen_tests/test_image_generation.pyindex 9047557c493..02cee2e8a00 100644--- a/tests/image_gen_tests/test_image_generation.py+++ b/tests/image_gen_tests/test_image_generation.py@@ -3,14 +3,10 @@import loggingimport os-import sysimport tracebackfrom unittest.mock import AsyncMock, MagicMock, patch-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom dotenv import load_dotenvfrom openai.types.image import Image@@ -19,7 +15,6 @@ from litellm.caching import InMemoryCachelogging.basicConfig(level=logging.DEBUG)load_dotenv()import asyncio-import osimport pytestimport litellmdiff --git a/tests/image_gen_tests/test_image_variation.py b/tests/image_gen_tests/test_image_variation.pyindex 301835057a7..b566385bb8a 100644--- a/tests/image_gen_tests/test_image_variation.py+++ b/tests/image_gen_tests/test_image_variation.py@@ -2,14 +2,9 @@## This tests the litellm support for the openai /generations endpointimport logging-import os-import sysimport traceback-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom dotenv import load_dotenvfrom openai.types.image import Image@@ -18,7 +13,6 @@ from litellm.caching import InMemoryCachelogging.basicConfig(level=logging.DEBUG)load_dotenv()import asyncio-import osimport pytestimport litellmdiff --git a/tests/image_gen_tests/test_xinference.py b/tests/image_gen_tests/test_xinference.pyindex 6dd56daf193..3dc4fee85da 100644--- a/tests/image_gen_tests/test_xinference.py+++ b/tests/image_gen_tests/test_xinference.py@@ -1,14 +1,9 @@import logging-import os-import sysimport tracebackimport pytestimport jsonfrom unittest.mock import Mock, patch, AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.types.utils import ImageObjectdiff --git a/tests/integration/test_oci_integration.py b/tests/integration/test_oci_integration.pyindex 94b8930bce8..231a3bd8445 100644--- a/tests/integration/test_oci_integration.py+++ b/tests/integration/test_oci_integration.py@@ -20,12 +20,10 @@ Run only these tests:import mathimport os-import sysfrom typing import NamedTuple, Optionalimport pytest-sys.path.insert(0, os.path.abspath("../.."))# ---------------------------------------------------------------------------# Fixtures / helpersdiff --git a/tests/litellm_utils_tests/base_token_counter_test.py b/tests/litellm_utils_tests/base_token_counter_test.pyindex 9af14dc9f47..ddce27522c2 100644--- a/tests/litellm_utils_tests/base_token_counter_test.py+++ b/tests/litellm_utils_tests/base_token_counter_test.py@@ -10,16 +10,11 @@ Usage:the abstract methods to provide provider-specific configuration."""-import os-import sysfrom abc import ABC, abstractmethodfrom typing import Any, Dict, List, Optionalimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm.llms.base_llm.base_utils import BaseTokenCounterfrom litellm.types.utils import TokenCountResponsediff --git a/tests/litellm_utils_tests/conftest.py b/tests/litellm_utils_tests/conftest.pyindex 39ea4299f35..002ed594d3f 100644--- a/tests/litellm_utils_tests/conftest.py+++ b/tests/litellm_utils_tests/conftest.py@@ -2,14 +2,9 @@import asyncioimport importlib-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm # noqa: E402,F401from tests._vcr_conftest_common import ( # noqa: E402,F401@@ -38,9 +33,6 @@ def setup_and_teardown():"""This fixture reloads litellm before every function. To speed up testing by removing callbacks being chained."""- sys.path.insert(- 0, os.path.abspath("../..")- ) # Adds the project directory to the system pathimportlib.reload(litellm)diff --git a/tests/litellm_utils_tests/test_aiohttp_handler.py b/tests/litellm_utils_tests/test_aiohttp_handler.pyindex 14c80d0e0bd..9fdac5ca23d 100644--- a/tests/litellm_utils_tests/test_aiohttp_handler.py+++ b/tests/litellm_utils_tests/test_aiohttp_handler.py@@ -1,6 +1,5 @@import asyncioimport copy-import sysimport timefrom datetime import datetimefrom unittest import mock@@ -10,11 +9,7 @@ from dotenv import load_dotenvfrom litellm.types.utils import StandardCallbackDynamicParamsload_dotenv()-import os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport pytestimport litellmdiff --git a/tests/litellm_utils_tests/test_anthropic_token_counter.py b/tests/litellm_utils_tests/test_anthropic_token_counter.pyindex 028586203a5..df3d198b6cf 100644--- a/tests/litellm_utils_tests/test_anthropic_token_counter.py+++ b/tests/litellm_utils_tests/test_anthropic_token_counter.py@@ -5,14 +5,10 @@ Tests for the Anthropic token counter implementation using the base test suite."""import os-import sysfrom typing import Any, Dict, Listimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm.llms.anthropic.count_tokens import AnthropicTokenCounterfrom litellm.llms.base_llm.base_utils import BaseTokenCounterdiff --git a/tests/litellm_utils_tests/test_azure_ai_anthropic_token_counter.py b/tests/litellm_utils_tests/test_azure_ai_anthropic_token_counter.pyindex 2686c28cb1c..50631eb9341 100644--- a/tests/litellm_utils_tests/test_azure_ai_anthropic_token_counter.py+++ b/tests/litellm_utils_tests/test_azure_ai_anthropic_token_counter.py@@ -5,14 +5,10 @@ Tests for the Azure AI Anthropic token counter implementation using the base tes"""import os-import sysfrom typing import Any, Dict, Listimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm.llms.azure_ai.anthropic.count_tokens import AzureAIAnthropicTokenCounterfrom litellm.llms.base_llm.base_utils import BaseTokenCounterdiff --git a/tests/litellm_utils_tests/test_bedrock_token_counter.py b/tests/litellm_utils_tests/test_bedrock_token_counter.pyindex 9fb2463e8b5..683949fc5c7 100644--- a/tests/litellm_utils_tests/test_bedrock_token_counter.py+++ b/tests/litellm_utils_tests/test_bedrock_token_counter.py@@ -9,15 +9,11 @@ counting, the test will be skipped."""import os-import sysfrom typing import Any, Dict, Listfrom unittest.mock import patchimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm.llms.base_llm.base_utils import BaseTokenCounterfrom litellm.llms.bedrock.count_tokens.bedrock_token_counter import BedrockTokenCounterdiff --git a/tests/litellm_utils_tests/test_cyberark.py b/tests/litellm_utils_tests/test_cyberark.pyindex 71daf35a265..9172e33af10 100644--- a/tests/litellm_utils_tests/test_cyberark.py+++ b/tests/litellm_utils_tests/test_cyberark.py@@ -3,14 +3,12 @@ Integration test for CyberArk Conjur Secret Manager."""import os-import sysimport pytestimport yamlfrom dotenv import load_dotenvload_dotenv()-sys.path.insert(0, os.path.abspath("../.."))from unittest.mock import AsyncMock, MagicMock, patchfrom litellm._uuid import uuiddiff --git a/tests/litellm_utils_tests/test_get_secret.py b/tests/litellm_utils_tests/test_get_secret.pyindex eec67b5d765..048e668467c 100644--- a/tests/litellm_utils_tests/test_get_secret.py+++ b/tests/litellm_utils_tests/test_get_secret.py@@ -1,12 +1,7 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, Mock, patch-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmdiff --git a/tests/litellm_utils_tests/test_hashicorp.py b/tests/litellm_utils_tests/test_hashicorp.pyindex 1d98debef2c..ac9d4af3f53 100644--- a/tests/litellm_utils_tests/test_hashicorp.py+++ b/tests/litellm_utils_tests/test_hashicorp.py@@ -1,14 +1,10 @@import os-import sysimport pytestfrom dotenv import load_dotenvload_dotenv()import httpx-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import patch, MagicMockimport loggingfrom litellm._logging import verbose_loggerdiff --git a/tests/litellm_utils_tests/test_health_check.py b/tests/litellm_utils_tests/test_health_check.pyindex 9a17aaeea87..cfdddd20263 100644--- a/tests/litellm_utils_tests/test_health_check.py+++ b/tests/litellm_utils_tests/test_health_check.py@@ -2,14 +2,10 @@# This tests if ahealth_check() actually worksimport os-import sysimport pytestfrom unittest.mock import AsyncMock, patch-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport litellmdiff --git a/tests/litellm_utils_tests/test_logging_callback_manager.py b/tests/litellm_utils_tests/test_logging_callback_manager.pyindex 517ba6befd7..ebd5b473ebb 100644--- a/tests/litellm_utils_tests/test_logging_callback_manager.py+++ b/tests/litellm_utils_tests/test_logging_callback_manager.py@@ -1,14 +1,10 @@import jsonimport os-import sysimport timefrom datetime import datetimefrom unittest.mock import AsyncMock, patch, MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.integrations.custom_logger import CustomLoggerfrom litellm.litellm_core_utils.logging_callback_manager import LoggingCallbackManagerdiff --git a/tests/litellm_utils_tests/test_proxy_budget_reset.py b/tests/litellm_utils_tests/test_proxy_budget_reset.pyindex 83891b55fb5..9f6e1f4c3f7 100644--- a/tests/litellm_utils_tests/test_proxy_budget_reset.py+++ b/tests/litellm_utils_tests/test_proxy_budget_reset.py@@ -1,6 +1,4 @@import asyncio-import os-import sysfrom datetime import datetime, timedelta, timezonefrom unittest.mock import AsyncMock, MagicMock, patch@@ -11,9 +9,6 @@ load_dotenv()from litellm.proxy._types import LiteLLM_BudgetTableFull-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.common_utils.reset_budget_job import ResetBudgetJobdiff --git a/tests/litellm_utils_tests/test_secret_manager.py b/tests/litellm_utils_tests/test_secret_manager.pyindex 012889ee00c..4ba928dacd7 100644--- a/tests/litellm_utils_tests/test_secret_manager.py+++ b/tests/litellm_utils_tests/test_secret_manager.py@@ -1,6 +1,5 @@import base64import os-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -12,9 +11,6 @@ load_dotenv()import tempfilefrom uuid import uuid4-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmfrom litellm.llms.azure.azure import get_azure_ad_token_from_oidcdiff --git a/tests/litellm_utils_tests/test_utils.py b/tests/litellm_utils_tests/test_utils.pyindex 0a5327d2662..67f2e1ce06d 100644--- a/tests/litellm_utils_tests/test_utils.py+++ b/tests/litellm_utils_tests/test_utils.py@@ -1,6 +1,5 @@import copyimport logging-import sysimport timefrom datetime import datetimefrom unittest import mock@@ -12,9 +11,6 @@ from litellm.types.utils import StandardCallbackDynamicParamsload_dotenv()import os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport pytestimport litellmdiff --git a/tests/litellm_utils_tests/test_validate_tool_choice.py b/tests/litellm_utils_tests/test_validate_tool_choice.pyindex 07f8c9ed8f4..b8246fe0deb 100644--- a/tests/litellm_utils_tests/test_validate_tool_choice.py+++ b/tests/litellm_utils_tests/test_validate_tool_choice.py@@ -1,8 +1,5 @@import pytest-import sys-import os-sys.path.insert(0, os.path.abspath("../.."))from litellm.utils import validate_chat_completion_tool_choicediff --git a/tests/llm_responses_api_testing/base_responses_api.py b/tests/llm_responses_api_testing/base_responses_api.pyindex 99ca9fb17b5..74c0478b08b 100644--- a/tests/llm_responses_api_testing/base_responses_api.py+++ b/tests/llm_responses_api_testing/base_responses_api.py@@ -1,17 +1,12 @@import httpximport jsonimport pytest-import sysfrom typing import Any, Dict, List, Optionalfrom unittest.mock import MagicMock, Mock, patch-import osfrom litellm._uuid import uuidimport timeimport base64-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom abc import ABC, abstractmethoddiff --git a/tests/llm_responses_api_testing/conftest.py b/tests/llm_responses_api_testing/conftest.pyindex 72f70b9ead7..5501d99cb22 100644--- a/tests/llm_responses_api_testing/conftest.py+++ b/tests/llm_responses_api_testing/conftest.py@@ -2,14 +2,9 @@import asyncioimport importlib-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm # noqa: E402@@ -77,9 +72,6 @@ def setup_and_teardown():"""This fixture reloads litellm before every function. To speed up testing by removing callbacks being chained."""- sys.path.insert(- 0, os.path.abspath("../..")- ) # Adds the project directory to the system pathimportlib.reload(litellm)diff --git a/tests/llm_responses_api_testing/test_anthropic_responses_api.py b/tests/llm_responses_api_testing/test_anthropic_responses_api.pyindex 0ca159219df..8ed85aaa209 100644--- a/tests/llm_responses_api_testing/test_anthropic_responses_api.py+++ b/tests/llm_responses_api_testing/test_anthropic_responses_api.py@@ -1,5 +1,3 @@-import os-import sysimport pytestimport asynciofrom typing import Optional@@ -13,7 +11,6 @@ from litellm.responses.litellm_completion_transformation.transformation import (from litellm.types.utils import ModelResponse-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.integrations.custom_logger import CustomLoggerimport jsondiff --git a/tests/llm_responses_api_testing/test_anthropic_tool_result_empty_call_id.py b/tests/llm_responses_api_testing/test_anthropic_tool_result_empty_call_id.pyindex 08b1c1784e7..28621c6531f 100644--- a/tests/llm_responses_api_testing/test_anthropic_tool_result_empty_call_id.py+++ b/tests/llm_responses_api_testing/test_anthropic_tool_result_empty_call_id.py@@ -11,12 +11,9 @@ The issue occurs when:3. The message is sent to Anthropic without a corresponding tool_use block"""-import os-import sysimport pytestfrom unittest.mock import patch, MagicMock-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.responses.litellm_completion_transformation.transformation import (LiteLLMCompletionResponsesConfig,diff --git a/tests/llm_responses_api_testing/test_anthropic_tool_result_fix.py b/tests/llm_responses_api_testing/test_anthropic_tool_result_fix.pyindex d7c15c7609f..d203b0f6917 100644--- a/tests/llm_responses_api_testing/test_anthropic_tool_result_fix.py+++ b/tests/llm_responses_api_testing/test_anthropic_tool_result_fix.py@@ -5,13 +5,10 @@ This test verifies that when using previous_response_id with tool_result,the fix ensures tool_calls are added to the previous assistant message."""-import os-import sysimport pytestimport jsonfrom unittest.mock import patch, AsyncMock-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.responses.litellm_completion_transformation.transformation import (LiteLLMCompletionResponsesConfig,diff --git a/tests/llm_responses_api_testing/test_azure_responses_api.py b/tests/llm_responses_api_testing/test_azure_responses_api.pyindex 79990a88496..6f1bb440341 100644--- a/tests/llm_responses_api_testing/test_azure_responses_api.py+++ b/tests/llm_responses_api_testing/test_azure_responses_api.py@@ -1,10 +1,8 @@import os-import sysimport pytestimport asynciofrom unittest.mock import patch, AsyncMock-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.integrations.custom_logger import CustomLoggerimport jsondiff --git a/tests/llm_responses_api_testing/test_base_responses_api_streaming_iterator.py b/tests/llm_responses_api_testing/test_base_responses_api_streaming_iterator.pyindex 5388c5aef83..bd617587cf3 100644--- a/tests/llm_responses_api_testing/test_base_responses_api_streaming_iterator.py+++ b/tests/llm_responses_api_testing/test_base_responses_api_streaming_iterator.py@@ -13,15 +13,12 @@ response tracking and logging."""import json-import os-import sysfrom datetime import datetimefrom typing import Any, Dict, Optionalfrom unittest.mock import Mock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.constants import STREAM_SSE_DONE_STRINGfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjdiff --git a/tests/llm_responses_api_testing/test_google_ai_studio_responses_api.py b/tests/llm_responses_api_testing/test_google_ai_studio_responses_api.pyindex 3ed92bd760d..d84e9cc66e3 100644--- a/tests/llm_responses_api_testing/test_google_ai_studio_responses_api.py+++ b/tests/llm_responses_api_testing/test_google_ai_studio_responses_api.py@@ -1,9 +1,7 @@import os-import sysimport pytestfrom unittest.mock import patch, AsyncMock-sys.path.insert(0, os.path.abspath("../.."))import litellmimport jsonfrom base_responses_api import BaseResponsesAPITestdiff --git a/tests/llm_responses_api_testing/test_openai_responses_api.py b/tests/llm_responses_api_testing/test_openai_responses_api.pyindex d614c40f5d0..5f77d5a5477 100644--- a/tests/llm_responses_api_testing/test_openai_responses_api.py+++ b/tests/llm_responses_api_testing/test_openai_responses_api.py@@ -1,5 +1,4 @@import os-import sysimport pytestimport asynciofrom typing import Optional, cast@@ -10,7 +9,6 @@ from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingimport timeimport json-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.integrations.custom_logger import CustomLoggerfrom litellm.types.utils import StandardLoggingPayloaddiff --git a/tests/llm_translation/base_audio_transcription_unit_tests.py b/tests/llm_translation/base_audio_transcription_unit_tests.pyindex 71f2aa79ce5..76401b456fa 100644--- a/tests/llm_translation/base_audio_transcription_unit_tests.py+++ b/tests/llm_translation/base_audio_transcription_unit_tests.py@@ -1,15 +1,11 @@import httpximport jsonimport pytest-import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMock, Mock, patchimport osfrom litellm._uuid import uuid-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import transcriptionfrom litellm.litellm_core_utils.get_supported_openai_params import (diff --git a/tests/llm_translation/base_embedding_unit_tests.py b/tests/llm_translation/base_embedding_unit_tests.pyindex 30a9dcc0da3..1a88f0e9d6b 100644--- a/tests/llm_translation/base_embedding_unit_tests.py+++ b/tests/llm_translation/base_embedding_unit_tests.py@@ -2,14 +2,10 @@ import asyncioimport httpximport jsonimport pytest-import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMock, Mock, patchimport os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import embeddingfrom litellm.exceptions import BadRequestErrordiff --git a/tests/llm_translation/base_llm_unit_tests.py b/tests/llm_translation/base_llm_unit_tests.pyindex 6d845f4b2f1..1a33422a31c 100644--- a/tests/llm_translation/base_llm_unit_tests.py+++ b/tests/llm_translation/base_llm_unit_tests.py@@ -10,9 +10,6 @@ import timeimport base64import inspect-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.exceptions import BadRequestErrorfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerdiff --git a/tests/llm_translation/base_rerank_unit_tests.py b/tests/llm_translation/base_rerank_unit_tests.pyindex 57878c8f171..df7dd33d7b0 100644--- a/tests/llm_translation/base_rerank_unit_tests.py+++ b/tests/llm_translation/base_rerank_unit_tests.py@@ -2,14 +2,10 @@ import asyncioimport httpximport jsonimport pytest-import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMock, Mock, patchimport os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.exceptions import BadRequestErrorfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerdiff --git a/tests/llm_translation/conftest.py b/tests/llm_translation/conftest.pyindex f5b71236e92..8532af2851c 100644--- a/tests/llm_translation/conftest.py+++ b/tests/llm_translation/conftest.py@@ -7,14 +7,9 @@import asyncioimport importlib-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm # noqa: E402@@ -123,7 +118,6 @@ def event_loop():@pytest.fixture(scope="function", autouse=True)def setup_and_teardown(event_loop): # Add event_loop as a dependency- sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/llm_translation/realtime/base_realtime_tests.py b/tests/llm_translation/realtime/base_realtime_tests.pyindex 1a2c6ff6a9c..964e1d0ac59 100644--- a/tests/llm_translation/realtime/base_realtime_tests.py+++ b/tests/llm_translation/realtime/base_realtime_tests.py@@ -8,14 +8,12 @@ across different providers (OpenAI, xAI, etc.)import asyncioimport jsonimport os-import sysfrom abc import ABC, abstractmethodfrom typing import Optional, Tuple, Unionimport pytestimport websockets-sys.path.insert(0, os.path.abspath("../../.."))import litellmdiff --git a/tests/llm_translation/realtime/test_openai_realtime.py b/tests/llm_translation/realtime/test_openai_realtime.pyindex 0e50e2792d6..add22117590 100644--- a/tests/llm_translation/realtime/test_openai_realtime.py+++ b/tests/llm_translation/realtime/test_openai_realtime.py@@ -1,13 +1,9 @@import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport pytestfrom websockets.exceptions import ConnectionClosedError, ConnectionClosedOK-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.types.realtime import RealtimeQueryParamsdiff --git a/tests/llm_translation/realtime/test_openai_realtime_simple.py b/tests/llm_translation/realtime/test_openai_realtime_simple.pyindex 073c1ce11af..93451a6617e 100644--- a/tests/llm_translation/realtime/test_openai_realtime_simple.py+++ b/tests/llm_translation/realtime/test_openai_realtime_simple.py@@ -5,12 +5,9 @@ Tests OpenAI's Realtime API through LiteLLM's realtime interface.Uses the base test class to ensure consistent behavior across providers."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from tests.llm_translation.realtime.base_realtime_tests import BaseRealtimeTestdiff --git a/tests/llm_translation/realtime/test_xai_realtime.py b/tests/llm_translation/realtime/test_xai_realtime.pyindex 8ffcb3db30d..19cf8624c48 100644--- a/tests/llm_translation/realtime/test_xai_realtime.py+++ b/tests/llm_translation/realtime/test_xai_realtime.py@@ -5,13 +5,10 @@ Tests xAI's Grok Voice Agent API through LiteLLM's realtime interface.Uses the base test class to ensure consistent behavior across providers."""-import os-import sysfrom typing import Tupleimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from tests.llm_translation.realtime.base_realtime_tests import BaseRealtimeTestdiff --git a/tests/llm_translation/test_a2a.py b/tests/llm_translation/test_a2a.pyindex ec260acd1ae..1f647092abf 100644--- a/tests/llm_translation/test_a2a.py+++ b/tests/llm_translation/test_a2a.py@@ -6,11 +6,9 @@ streaming and non-streaming requests."""import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/llm_translation/test_anthropic_completion.py b/tests/llm_translation/test_anthropic_completion.pyindex ab1c67dffbf..8c55014955f 100644--- a/tests/llm_translation/test_anthropic_completion.py+++ b/tests/llm_translation/test_anthropic_completion.py@@ -3,7 +3,6 @@import asyncioimport os-import sysimport tracebackfrom dotenv import load_dotenv@@ -15,9 +14,6 @@ from litellm.llms.anthropic.chat import ModelResponseIteratorload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom typing import Optionalfrom unittest.mock import MagicMock, patchdiff --git a/tests/llm_translation/test_azure_agents.py b/tests/llm_translation/test_azure_agents.pyindex 6a737cc102b..e0741471582 100644--- a/tests/llm_translation/test_azure_agents.py+++ b/tests/llm_translation/test_azure_agents.py@@ -25,9 +25,7 @@ See: https://learn.microsoft.com/en-us/azure/ai-foundry/agents/quickstartimport jsonimport os-import sys-sys.path.insert(0, os.path.abspath("../.."))import pytestfrom unittest.mock import MagicMockdiff --git a/tests/llm_translation/test_azure_ai.py b/tests/llm_translation/test_azure_ai.pyindex 553f9102246..5be6ade80ab 100644--- a/tests/llm_translation/test_azure_ai.py+++ b/tests/llm_translation/test_azure_ai.py@@ -3,7 +3,6 @@import asyncioimport os-import sysimport tracebackfrom dotenv import load_dotenv@@ -20,9 +19,6 @@ from litellm.llms.custom_httpx.http_handler import HTTPHandlerload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom typing import Optionalfrom unittest.mock import MagicMock, patchdiff --git a/tests/llm_translation/test_azure_o_series.py b/tests/llm_translation/test_azure_o_series.pyindex ab122d3ff6a..1a2d672af71 100644--- a/tests/llm_translation/test_azure_o_series.py+++ b/tests/llm_translation/test_azure_o_series.py@@ -1,12 +1,8 @@import jsonimport os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, patch, MagicMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpxdiff --git a/tests/llm_translation/test_azure_openai.py b/tests/llm_translation/test_azure_openai.pyindex 0deb20900a7..0fa72b45ed8 100644--- a/tests/llm_translation/test_azure_openai.py+++ b/tests/llm_translation/test_azure_openai.py@@ -1,9 +1,5 @@-import sysimport os-sys.path.insert(- 0, os.path.abspath("../../")-) # Adds the parent directory to the system pathimport httpximport pytest@@ -103,7 +99,6 @@ from unittest.mock import MagicMock, patchfrom openai import AzureOpenAIimport litellmfrom litellm import completion-import os@pytest.mark.parametrize(diff --git a/tests/llm_translation/test_bedrock_agentcore.py b/tests/llm_translation/test_bedrock_agentcore.pyindex 40774cf3d60..0087eb5b326 100644--- a/tests/llm_translation/test_bedrock_agentcore.py+++ b/tests/llm_translation/test_bedrock_agentcore.py@@ -2,13 +2,10 @@Test Bedrock AgentCore integration"""-import os-import sysfrom dotenv import load_dotenvload_dotenv()-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom unittest.mock import MagicMock, Mock, patchdiff --git a/tests/llm_translation/test_bedrock_agents.py b/tests/llm_translation/test_bedrock_agents.pyindex 6371224def9..1685dd220d2 100644--- a/tests/llm_translation/test_bedrock_agents.py+++ b/tests/llm_translation/test_bedrock_agents.py@@ -1,5 +1,3 @@-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -10,9 +8,6 @@ load_dotenv()import ioimport json-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, Mock, patchimport pytestdiff --git a/tests/llm_translation/test_bedrock_anthropic_regression.py b/tests/llm_translation/test_bedrock_anthropic_regression.pyindex 8b8ce0a6cc8..8f2974f531c 100644--- a/tests/llm_translation/test_bedrock_anthropic_regression.py+++ b/tests/llm_translation/test_bedrock_anthropic_regression.py@@ -11,13 +11,10 @@ feature parity and prevent regression of previously fixed issues."""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import completiondiff --git a/tests/llm_translation/test_bedrock_completion.py b/tests/llm_translation/test_bedrock_completion.pyindex 6ee6e5d1493..550e82fb5bb 100644--- a/tests/llm_translation/test_bedrock_completion.py+++ b/tests/llm_translation/test_bedrock_completion.py@@ -4,7 +4,6 @@ Tests Bedrock Completion + Rerank endpoints# @pytest.mark.skip(reason="AWS Suspended Account")import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -15,9 +14,6 @@ load_dotenv()import ioimport json-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, Mock, patchimport pytestdiff --git a/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.py b/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.pyindex 5d2fab15a8f..dad2fdbf065 100644--- a/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.py+++ b/tests/llm_translation/test_bedrock_dynamic_auth_params_unit_tests.py@@ -1,14 +1,9 @@# tests/llm_translation/test_base_aws_llm.py-import osimport jsonimport pytestfrom unittest.mock import patchfrom botocore.credentials import Credentials-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.custom_httpx.http_handler import HTTPHandlerdiff --git a/tests/llm_translation/test_bedrock_embedding.py b/tests/llm_translation/test_bedrock_embedding.pyindex e343b8856a7..56baed141da 100644--- a/tests/llm_translation/test_bedrock_embedding.py+++ b/tests/llm_translation/test_bedrock_embedding.py@@ -1,15 +1,11 @@import jsonimport os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, Mock, patchimport pytestimport base64import httpx-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.custom_httpx.http_handler import HTTPHandler, AsyncHTTPHandlerdiff --git a/tests/llm_translation/test_bedrock_gpt_oss.py b/tests/llm_translation/test_bedrock_gpt_oss.pyindex 0a595ad7114..4af81ee81f7 100644--- a/tests/llm_translation/test_bedrock_gpt_oss.py+++ b/tests/llm_translation/test_bedrock_gpt_oss.py@@ -1,13 +1,8 @@from base_llm_unit_tests import BaseLLMChatTestimport jsonimport pytest-import sys-import osfrom unittest.mock import patch, Mock, MagicMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.bedrock.chat.converse_transformation import AmazonConverseConfigfrom litellm.llms.custom_httpx.http_handler import HTTPHandlerdiff --git a/tests/llm_translation/test_bedrock_invoke_tests.py b/tests/llm_translation/test_bedrock_invoke_tests.pyindex 901b43542f7..cf53899ecf6 100644--- a/tests/llm_translation/test_bedrock_invoke_tests.py+++ b/tests/llm_translation/test_bedrock_invoke_tests.py@@ -1,11 +1,7 @@from base_llm_unit_tests import BaseLLMChatTestimport pytest-import sysimport os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.types.llms.bedrock import BedrockInvokeNovaRequestdiff --git a/tests/llm_translation/test_bedrock_llama.py b/tests/llm_translation/test_bedrock_llama.pyindex b18928747eb..6c1a7073c13 100644--- a/tests/llm_translation/test_bedrock_llama.py+++ b/tests/llm_translation/test_bedrock_llama.py@@ -1,11 +1,6 @@from base_llm_unit_tests import BaseLLMChatTestimport pytest-import sys-import os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/llm_translation/test_bedrock_mantle.py b/tests/llm_translation/test_bedrock_mantle.pyindex 46a0c653005..70919a07bb9 100644--- a/tests/llm_translation/test_bedrock_mantle.py+++ b/tests/llm_translation/test_bedrock_mantle.py@@ -9,14 +9,11 @@ Tests use a fake/mocked HTTP layer to verify the full request pipeline:"""import json-import os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.llms.custom_httpx.http_handler import HTTPHandlerdiff --git a/tests/llm_translation/test_bedrock_moonshot.py b/tests/llm_translation/test_bedrock_moonshot.pyindex a82d1c6f029..3bf047c51a5 100644--- a/tests/llm_translation/test_bedrock_moonshot.py+++ b/tests/llm_translation/test_bedrock_moonshot.py@@ -14,13 +14,11 @@ This test suite verifies:from base_llm_unit_tests import BaseLLMChatTestimport httpximport pytest-import sysimport osimport jsonfrom typing import Optionalfrom unittest.mock import AsyncMock, Mock, patch-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.llms.bedrock.common_utils import get_bedrock_chat_configfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerdiff --git a/tests/llm_translation/test_bedrock_nova_embedding.py b/tests/llm_translation/test_bedrock_nova_embedding.pyindex 9795dc3d8d5..c4fd0724884 100644--- a/tests/llm_translation/test_bedrock_nova_embedding.py+++ b/tests/llm_translation/test_bedrock_nova_embedding.py@@ -11,15 +11,10 @@ Tests cover:"""import json-import os-import sysfrom unittest.mock import MagicMock, Mock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.bedrock.embed.amazon_nova_transformation import (diff --git a/tests/llm_translation/test_bedrock_nova_json.py b/tests/llm_translation/test_bedrock_nova_json.pyindex 7531891c4ef..754ef4e3525 100644--- a/tests/llm_translation/test_bedrock_nova_json.py+++ b/tests/llm_translation/test_bedrock_nova_json.py@@ -1,11 +1,6 @@from base_llm_unit_tests import BaseLLMChatTestimport pytest-import sys-import os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/llm_translation/test_cohere.py b/tests/llm_translation/test_cohere.pyindex 0eb0b1b33fe..729f42f8984 100644--- a/tests/llm_translation/test_cohere.py+++ b/tests/llm_translation/test_cohere.py@@ -1,5 +1,3 @@-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -7,9 +5,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport jsonimport pytestdiff --git a/tests/llm_translation/test_containers_api.py b/tests/llm_translation/test_containers_api.pyindex 7fb0c6d21d6..c5248516a1c 100644--- a/tests/llm_translation/test_containers_api.py+++ b/tests/llm_translation/test_containers_api.py@@ -5,12 +5,10 @@ Tests the container files endpoints using LiteLLM SDK methods."""import os-import sysimport timeimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.containers import (create_container,diff --git a/tests/llm_translation/test_convert_dict_to_image.py b/tests/llm_translation/test_convert_dict_to_image.pyindex 62a7eec8cbb..df6e2bcb4a3 100644--- a/tests/llm_translation/test_convert_dict_to_image.py+++ b/tests/llm_translation/test_convert_dict_to_image.py@@ -1,11 +1,6 @@import json-import os-import sysfrom datetime import datetime-sys.path.insert(- 0, os.path.abspath("../../")-) # Adds the parent directory to the system pathimport litellmimport pytestdiff --git a/tests/llm_translation/test_databricks.py b/tests/llm_translation/test_databricks.pyindex 3a224231667..46caae0e7bd 100644--- a/tests/llm_translation/test_databricks.py+++ b/tests/llm_translation/test_databricks.py@@ -6,11 +6,7 @@ import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMock, Mock, patch, ANY-import os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.exceptions import BadRequestErrorfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerdiff --git a/tests/llm_translation/test_deepgram.py b/tests/llm_translation/test_deepgram.pyindex 204d6c01cf8..855d570488b 100644--- a/tests/llm_translation/test_deepgram.py+++ b/tests/llm_translation/test_deepgram.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom base_audio_transcription_unit_tests import BaseLLMAudioTranscriptionTestdiff --git a/tests/llm_translation/test_elevenlabs.py b/tests/llm_translation/test_elevenlabs.pyindex b6c838d2300..9dc4a1d09ed 100644--- a/tests/llm_translation/test_elevenlabs.py+++ b/tests/llm_translation/test_elevenlabs.py@@ -1,5 +1,4 @@import os-import sysfrom typing import Any, Dict@@ -7,9 +6,6 @@ import pytestfrom unittest.mock import patch, MagicMockimport httpx-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom base_audio_transcription_unit_tests import BaseLLMAudioTranscriptionTestdiff --git a/tests/llm_translation/test_evals_api.py b/tests/llm_translation/test_evals_api.pyindex 4a55663e669..ba6b5edf3cd 100644--- a/tests/llm_translation/test_evals_api.py+++ b/tests/llm_translation/test_evals_api.py@@ -4,13 +4,11 @@ Tests for Evals API operations across providersimport hashlibimport os-import sysfrom abc import ABC, abstractmethodfrom typing import Optionalimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.types.llms.openai_evals import (diff --git a/tests/llm_translation/test_fireworks_ai_translation.py b/tests/llm_translation/test_fireworks_ai_translation.pyindex 27059581e4d..e20134fc1bf 100644--- a/tests/llm_translation/test_fireworks_ai_translation.py+++ b/tests/llm_translation/test_fireworks_ai_translation.py@@ -1,11 +1,6 @@-import os-import sysimport jsonimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.litellm_core_utils.get_supported_openai_params import (get_supported_openai_params,diff --git a/tests/llm_translation/test_gemini.py b/tests/llm_translation/test_gemini.pyindex 310a2e2c20c..0c3eca52dde 100644--- a/tests/llm_translation/test_gemini.py+++ b/tests/llm_translation/test_gemini.py@@ -1,11 +1,7 @@import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathsfrom base_llm_unit_tests import BaseLLMChatTestfrom litellm.llms.vertex_ai.context_caching.transformation import (diff --git a/tests/llm_translation/test_gpt4o_audio.py b/tests/llm_translation/test_gpt4o_audio.pyindex a50d07406d4..0f20119e4ef 100644--- a/tests/llm_translation/test_gpt4o_audio.py+++ b/tests/llm_translation/test_gpt4o_audio.py@@ -1,12 +1,7 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpxdiff --git a/tests/llm_translation/test_hosted_vllm_embedding_e2e.py b/tests/llm_translation/test_hosted_vllm_embedding_e2e.pyindex 4b887013357..23ad63ab6da 100644--- a/tests/llm_translation/test_hosted_vllm_embedding_e2e.py+++ b/tests/llm_translation/test_hosted_vllm_embedding_e2e.py@@ -5,13 +5,9 @@ This test verifies that the hosted_vllm provider works correctly with real API e"""import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/llm_translation/test_huggingface_chat_completion.py b/tests/llm_translation/test_huggingface_chat_completion.pyindex cdf3f9ef76f..90e6c2adb8d 100644--- a/tests/llm_translation/test_huggingface_chat_completion.py+++ b/tests/llm_translation/test_huggingface_chat_completion.py@@ -3,15 +3,10 @@ Test HuggingFace LLM"""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchfrom base_llm_unit_tests import BaseLLMChatTest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestdiff --git a/tests/llm_translation/test_hyperbolic.py b/tests/llm_translation/test_hyperbolic.pyindex 006d31c88e6..78817fbd902 100644--- a/tests/llm_translation/test_hyperbolic.py+++ b/tests/llm_translation/test_hyperbolic.py@@ -1,13 +1,9 @@import os-import sysfrom datetime import datetimefrom unittest.mock import MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import get_llm_provider@@ -76,7 +72,6 @@ def test_hyperbolic_in_provider_lists():def test_hyperbolic_models_configuration():"""Test that Hyperbolic models are properly configured"""import json- import os# Load model configuration directly from the JSON filejson_path = os.path.join(diff --git a/tests/llm_translation/test_infinity.py b/tests/llm_translation/test_infinity.pyindex 5ca3d377fd7..1829113e045 100644--- a/tests/llm_translation/test_infinity.py+++ b/tests/llm_translation/test_infinity.py@@ -1,25 +1,15 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport litellm-import os-import sysfrom unittest.mock import patch, MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom test_rerank import assert_response_shapefrom base_embedding_unit_tests import BaseLLMEmbeddingTestdiff --git a/tests/llm_translation/test_jina_ai.py b/tests/llm_translation/test_jina_ai.pyindex 00810369ed7..81527293a00 100644--- a/tests/llm_translation/test_jina_ai.py+++ b/tests/llm_translation/test_jina_ai.py@@ -1,12 +1,7 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom base_rerank_unit_tests import BaseLLMRerankTestdiff --git a/tests/llm_translation/test_langgraph.py b/tests/llm_translation/test_langgraph.pyindex fa3a7f91b6b..3d0de508e7c 100644--- a/tests/llm_translation/test_langgraph.py+++ b/tests/llm_translation/test_langgraph.py@@ -19,9 +19,7 @@ Non-streaming:"""import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import pytestdiff --git a/tests/llm_translation/test_litellm_proxy_provider.py b/tests/llm_translation/test_litellm_proxy_provider.pyindex 7a917c226df..1cb805bf9ba 100644--- a/tests/llm_translation/test_litellm_proxy_provider.py+++ b/tests/llm_translation/test_litellm_proxy_provider.py@@ -1,14 +1,9 @@import json-import osimport re-import sysfrom datetime import datetimefrom io import BytesIOfrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport litellmfrom litellm import completion, embeddingdiff --git a/tests/llm_translation/test_llm_response_utils/test_convert_dict_to_chat_completion.py b/tests/llm_translation/test_llm_response_utils/test_convert_dict_to_chat_completion.pyindex 8c7390d3d04..b6e30ddc711 100644--- a/tests/llm_translation/test_llm_response_utils/test_convert_dict_to_chat_completion.py+++ b/tests/llm_translation/test_llm_response_utils/test_convert_dict_to_chat_completion.py@@ -1,11 +1,6 @@import json-import os-import sysfrom datetime import datetime-sys.path.insert(- 0, os.path.abspath("../../../")-) # Adds the parent directory to the system pathimport litellmimport pytestdiff --git a/tests/llm_translation/test_llm_response_utils/test_get_headers.py b/tests/llm_translation/test_llm_response_utils/test_get_headers.pyindex f0cc7ca61f1..380f89bbdd4 100644--- a/tests/llm_translation/test_llm_response_utils/test_get_headers.py+++ b/tests/llm_translation/test_llm_response_utils/test_get_headers.py@@ -1,11 +1,6 @@import json-import os-import sysfrom datetime import datetime-sys.path.insert(- 0, os.path.abspath("../../")-) # Adds the parent directory to the system pathimport litellmimport pytestdiff --git a/tests/llm_translation/test_minimax_tts.py b/tests/llm_translation/test_minimax_tts.pyindex e10b32fb39b..660e49b664f 100644--- a/tests/llm_translation/test_minimax_tts.py+++ b/tests/llm_translation/test_minimax_tts.py@@ -3,15 +3,11 @@ Tests for MiniMax Text-to-Speech integration"""import os-import sysfrom pathlib import Pathfrom unittest.mock import MagicMock, Mock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import speechdiff --git a/tests/llm_translation/test_mistral_api.py b/tests/llm_translation/test_mistral_api.pyindex 62f69e616ab..9e2f726a020 100644--- a/tests/llm_translation/test_mistral_api.py+++ b/tests/llm_translation/test_mistral_api.py@@ -1,6 +1,4 @@import asyncio-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -12,9 +10,6 @@ from litellm.llms.anthropic.chat import ModelResponseIteratorload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom typing import Optionalfrom unittest.mock import MagicMock, patchdiff --git a/tests/llm_translation/test_morph.py b/tests/llm_translation/test_morph.pyindex a24ace5ca6d..b91d1810d38 100644--- a/tests/llm_translation/test_morph.py+++ b/tests/llm_translation/test_morph.py@@ -1,12 +1,8 @@"""Unit tests for Morph provider integration."""import os-import sysfrom unittest.mock import patch-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import MorphChatConfig, get_llm_providerdiff --git a/tests/llm_translation/test_nvidia_nim.py b/tests/llm_translation/test_nvidia_nim.pyindex 79c792d1644..7ee4f347f72 100644--- a/tests/llm_translation/test_nvidia_nim.py+++ b/tests/llm_translation/test_nvidia_nim.py@@ -1,12 +1,7 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpxdiff --git a/tests/llm_translation/test_openai.py b/tests/llm_translation/test_openai.pyindex 405dbb0e6ec..2b9abdec5d0 100644--- a/tests/llm_translation/test_openai.py+++ b/tests/llm_translation/test_openai.py@@ -1,13 +1,8 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, patchfrom typing import Optional-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpxdiff --git a/tests/llm_translation/test_openai_o1.py b/tests/llm_translation/test_openai_o1.pyindex dbaf20717a0..e188a3af647 100644--- a/tests/llm_translation/test_openai_o1.py+++ b/tests/llm_translation/test_openai_o1.py@@ -1,12 +1,8 @@import jsonimport os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, patch, MagicMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpxdiff --git a/tests/llm_translation/test_openrouter.py b/tests/llm_translation/test_openrouter.pyindex 8fbb8803d11..8ecf9b4a8a2 100644--- a/tests/llm_translation/test_openrouter.py+++ b/tests/llm_translation/test_openrouter.py@@ -1,10 +1,5 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathsimport litellmdiff --git a/tests/llm_translation/test_optional_params.py b/tests/llm_translation/test_optional_params.pyindex 814f5a235e1..997f5b3b73f 100644--- a/tests/llm_translation/test_optional_params.py+++ b/tests/llm_translation/test_optional_params.py@@ -2,14 +2,11 @@# This tests if get_optional_params works as expectedimport asyncioimport inspect-import os-import sysimport timeimport tracebackimport pytest-sys.path.insert(0, os.path.abspath("../.."))from unittest.mock import MagicMock, patchimport litellmdiff --git a/tests/llm_translation/test_perplexity_reasoning.py b/tests/llm_translation/test_perplexity_reasoning.pyindex 2ea28b76696..61fbc9d7824 100644--- a/tests/llm_translation/test_perplexity_reasoning.py+++ b/tests/llm_translation/test_perplexity_reasoning.py@@ -1,13 +1,9 @@import jsonimport os-import sysfrom unittest.mock import patch, MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import completiondiff --git a/tests/llm_translation/test_prompt_caching.py b/tests/llm_translation/test_prompt_caching.pyindex eb4703fd677..341973168e8 100644--- a/tests/llm_translation/test_prompt_caching.py+++ b/tests/llm_translation/test_prompt_caching.py@@ -1,12 +1,7 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpxdiff --git a/tests/llm_translation/test_prompt_factory.py b/tests/llm_translation/test_prompt_factory.pyindex 1b4c8a82cf4..a90a3df584e 100644--- a/tests/llm_translation/test_prompt_factory.py+++ b/tests/llm_translation/test_prompt_factory.py@@ -1,11 +1,8 @@#### What this tests ##### This tests if prompts are being correctly formatted-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))from typing import Listdiff --git a/tests/llm_translation/test_replicate.py b/tests/llm_translation/test_replicate.pyindex 8972d115882..eb8987f5444 100644--- a/tests/llm_translation/test_replicate.py+++ b/tests/llm_translation/test_replicate.py@@ -4,13 +4,10 @@ Unit tests for Replicate provider, particularly testing DeepSeek modelsimport asyncioimport json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, Mock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import completiondiff --git a/tests/llm_translation/test_rerank.py b/tests/llm_translation/test_rerank.pyindex cb254542009..3009928c9bc 100644--- a/tests/llm_translation/test_rerank.py+++ b/tests/llm_translation/test_rerank.py@@ -1,7 +1,6 @@import asyncioimport jsonimport os-import sysimport tracebackfrom dotenv import load_dotenv@@ -10,11 +9,7 @@ load_dotenv()import iofrom typing import Optional, Dict-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path-import osfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestdiff --git a/tests/llm_translation/test_router_llm_translation_tests.py b/tests/llm_translation/test_router_llm_translation_tests.pyindex 26456ab0a35..10807adf356 100644--- a/tests/llm_translation/test_router_llm_translation_tests.py+++ b/tests/llm_translation/test_router_llm_translation_tests.py@@ -4,13 +4,9 @@ Uses litellm.Router, ensures router.completion and router.acompletion pass BaseLimport asyncioimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom base_llm_unit_tests import BaseLLMChatTestdiff --git a/tests/llm_translation/test_skills_api.py b/tests/llm_translation/test_skills_api.pyindex e1830e50ef9..aeab5f0da3e 100644--- a/tests/llm_translation/test_skills_api.py+++ b/tests/llm_translation/test_skills_api.py@@ -3,7 +3,6 @@ Tests for Skills API operations across providers"""import os-import sysimport zipfilefrom abc import ABC, abstractmethodfrom contextlib import contextmanager@@ -12,7 +11,6 @@ from typing import Optionalimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.types.llms.anthropic_skills import (@@ -143,7 +141,6 @@ class BaseSkillsAPITest(ABC):"""Test listing skills."""- import oscustom_llm_provider = self.get_custom_llm_provider()api_key = self.get_api_key()diff --git a/tests/llm_translation/test_text_completion.py b/tests/llm_translation/test_text_completion.pyindex 38d2dd95de7..7f81a6a3449 100644--- a/tests/llm_translation/test_text_completion.py+++ b/tests/llm_translation/test_text_completion.py@@ -1,11 +1,6 @@import json-import os-import sysfrom datetime import datetime-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmimport pytestdiff --git a/tests/llm_translation/test_text_completion_unit_tests.py b/tests/llm_translation/test_text_completion_unit_tests.pyindex 55026ba0542..d741786ad44 100644--- a/tests/llm_translation/test_text_completion_unit_tests.py+++ b/tests/llm_translation/test_text_completion_unit_tests.py@@ -1,6 +1,4 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMockimport pytest@@ -8,9 +6,6 @@ import httpxfrom respx import MockRouterfrom unittest.mock import patch, MagicMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.types.utils import TextCompletionResponsediff --git a/tests/llm_translation/test_together_ai.py b/tests/llm_translation/test_together_ai.pyindex 387e61656ea..c371caefa5e 100644--- a/tests/llm_translation/test_together_ai.py+++ b/tests/llm_translation/test_together_ai.py@@ -5,13 +5,9 @@ Test TogetherAI LLMfrom base_llm_unit_tests import BaseLLMChatTestimport jsonimport os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmimport pytestdiff --git a/tests/llm_translation/test_triton.py b/tests/llm_translation/test_triton.pyindex f9ab3bfaff7..a5d66809421 100644--- a/tests/llm_translation/test_triton.py+++ b/tests/llm_translation/test_triton.py@@ -1,6 +1,4 @@import json-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -9,9 +7,6 @@ load_dotenv()import iofrom unittest.mock import AsyncMock, MagicMock, patch-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmdiff --git a/tests/llm_translation/test_unit_test_bedrock_invoke.py b/tests/llm_translation/test_unit_test_bedrock_invoke.pyindex 586b04384d5..e6cf4695089 100644--- a/tests/llm_translation/test_unit_test_bedrock_invoke.py+++ b/tests/llm_translation/test_unit_test_bedrock_invoke.py@@ -1,5 +1,3 @@-import os-import sysimport tracebackfrom dotenv import load_dotenvimport litellm.types@@ -10,7 +8,6 @@ import jsonload_dotenv()import io-sys.path.insert(0, os.path.abspath("../.."))from unittest.mock import AsyncMock, Mock, patchdiff --git a/tests/llm_translation/test_voyage_ai.py b/tests/llm_translation/test_voyage_ai.pyindex 30f2844fbfa..208e01110da 100644--- a/tests/llm_translation/test_voyage_ai.py+++ b/tests/llm_translation/test_voyage_ai.py@@ -1,12 +1,8 @@import jsonimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchdiff --git a/tests/llm_translation/test_watsonx.py b/tests/llm_translation/test_watsonx.pyindex 5857394d0ff..0ccc2ba85f3 100644--- a/tests/llm_translation/test_watsonx.py+++ b/tests/llm_translation/test_watsonx.py@@ -1,10 +1,5 @@import json-import os-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import completion, embeddingfrom litellm.llms.custom_httpx.http_handler import HTTPHandlerdiff --git a/tests/llm_translation/test_xai.py b/tests/llm_translation/test_xai.pyindex f0945e6e165..7a121afc3fa 100644--- a/tests/llm_translation/test_xai.py+++ b/tests/llm_translation/test_xai.py@@ -1,12 +1,8 @@import jsonimport os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpxdiff --git a/tests/load_tests/test_datadog_load_test.py b/tests/load_tests/test_datadog_load_test.pyindex f4328b71b1b..3dfc3fc6da4 100644--- a/tests/load_tests/test_datadog_load_test.py+++ b/tests/load_tests/test_datadog_load_test.py@@ -1,7 +1,5 @@-import sysimport os-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport litellmdiff --git a/tests/load_tests/test_langsmith_load_test.py b/tests/load_tests/test_langsmith_load_test.pyindex cf9fe526b74..84400d6974b 100644--- a/tests/load_tests/test_langsmith_load_test.py+++ b/tests/load_tests/test_langsmith_load_test.py@@ -1,8 +1,6 @@-import sysimport os-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport litellmdiff --git a/tests/load_tests/test_memory_usage.py b/tests/load_tests/test_memory_usage.pyindex 347dbf2bb44..c5b5134a3d7 100644--- a/tests/load_tests/test_memory_usage.py+++ b/tests/load_tests/test_memory_usage.py@@ -9,9 +9,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm.types@@ -21,7 +18,6 @@ from typing import Optionalfrom unittest.mock import MagicMock, patchimport pytest-import osimport litellmfrom typing import Callable, Anydiff --git a/tests/load_tests/test_otel_load_test.py b/tests/load_tests/test_otel_load_test.pyindex f5754c0c402..57dcc53a50b 100644--- a/tests/load_tests/test_otel_load_test.py+++ b/tests/load_tests/test_otel_load_test.py@@ -1,8 +1,6 @@-import sysimport os-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport litellmdiff --git a/tests/load_tests/test_vertex_embeddings_load_test.py b/tests/load_tests/test_vertex_embeddings_load_test.pyindex 9beee710553..c5b9a80ec6b 100644--- a/tests/load_tests/test_vertex_embeddings_load_test.py+++ b/tests/load_tests/test_vertex_embeddings_load_test.py@@ -3,10 +3,8 @@ Load test on vertex AI embeddings to ensure vertex median response time is less"""-import sysimport os-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport litellmdiff --git a/tests/load_tests/test_vertex_load_tests.py b/tests/load_tests/test_vertex_load_tests.pyindex 9130873b970..93e1ed24f72 100644--- a/tests/load_tests/test_vertex_load_tests.py+++ b/tests/load_tests/test_vertex_load_tests.py@@ -1,7 +1,5 @@-import sysimport os-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport litellmdiff --git a/tests/local_testing/cache_unit_tests.py b/tests/local_testing/cache_unit_tests.pyindex 27eefb79fae..a1973d477b2 100644--- a/tests/local_testing/cache_unit_tests.py+++ b/tests/local_testing/cache_unit_tests.py@@ -1,7 +1,5 @@from abc import ABC, abstractmethodfrom litellm.caching import LiteLLMCacheType-import os-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -10,9 +8,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport hashlibimport randomdiff --git a/tests/local_testing/conftest.py b/tests/local_testing/conftest.pyindex d134a7439a8..4f142664827 100644--- a/tests/local_testing/conftest.py+++ b/tests/local_testing/conftest.py@@ -13,13 +13,9 @@import importlibimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm# ``litellm.model_cost`` is loaded at import time from the URL pinned to ``main``@@ -238,7 +234,6 @@ def setup_and_teardown():Module-scoped setup. Reloads litellm only in single-process mode(skipped under xdist to avoid cross-worker interference)."""- sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/local_testing/create_mock_standard_logging_payload.py b/tests/local_testing/create_mock_standard_logging_payload.pyindex 106328e95e2..096c8ff8c60 100644--- a/tests/local_testing/create_mock_standard_logging_payload.py+++ b/tests/local_testing/create_mock_standard_logging_payload.py@@ -1,9 +1,6 @@import io-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport gzipdiff --git a/tests/local_testing/test_acompletion_fallbacks.py b/tests/local_testing/test_acompletion_fallbacks.pyindex 7cf97eb9b5e..f9ee5a93c32 100644--- a/tests/local_testing/test_acompletion_fallbacks.py+++ b/tests/local_testing/test_acompletion_fallbacks.py@@ -1,14 +1,10 @@import asyncioimport os-import sysimport timeimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport concurrentfrom dotenv import load_dotenvdiff --git a/tests/local_testing/test_acooldowns_router.py b/tests/local_testing/test_acooldowns_router.pyindex 18dc26bda9a..18c58a5cfac 100644--- a/tests/local_testing/test_acooldowns_router.py+++ b/tests/local_testing/test_acooldowns_router.py@@ -3,15 +3,11 @@import asyncioimport os-import sysimport timeimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport concurrentfrom dotenv import load_dotenvdiff --git a/tests/local_testing/test_add_function_to_prompt.py b/tests/local_testing/test_add_function_to_prompt.pyindex 43ee3dd41af..507fd99ec59 100644--- a/tests/local_testing/test_add_function_to_prompt.py+++ b/tests/local_testing/test_add_function_to_prompt.py@@ -4,9 +4,6 @@import sys, os, pytestimport traceback-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/local_testing/test_aim_guardrails.py b/tests/local_testing/test_aim_guardrails.pyindex a6a4a0ad781..2a179ddcf32 100644--- a/tests/local_testing/test_aim_guardrails.py+++ b/tests/local_testing/test_aim_guardrails.py@@ -1,8 +1,6 @@import asyncioimport contextlibimport json-import os-import sysfrom unittest.mock import AsyncMock, patch, callimport pytest@@ -17,9 +15,6 @@ from litellm.proxy.guardrails.guardrail_hooks.aim.aim import (from litellm.proxy.proxy_server import StreamingCallbackError, UserAPIKeyAuthfrom litellm.types.utils import ModelResponseStream, ModelResponse-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy.guardrails.init_guardrails import init_guardrails_v2diff --git a/tests/local_testing/test_alangfuse.py b/tests/local_testing/test_alangfuse.pyindex 7c2ec7e9f64..7b1f7f203e3 100644--- a/tests/local_testing/test_alangfuse.py+++ b/tests/local_testing/test_alangfuse.py@@ -3,12 +3,10 @@ import copyimport jsonimport loggingimport os-import sysfrom typing import Any, Optionalfrom unittest.mock import MagicMock, patchlogging.basicConfig(level=logging.DEBUG)-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import completiondiff --git a/tests/local_testing/test_amazing_vertex_completion.py b/tests/local_testing/test_amazing_vertex_completion.pyindex a52b5975f6e..76ff23a9a1b 100644--- a/tests/local_testing/test_amazing_vertex_completion.py+++ b/tests/local_testing/test_amazing_vertex_completion.py@@ -1,5 +1,4 @@import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -9,12 +8,8 @@ import iofrom test_streaming import streaming_format_tests-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport json-import osimport tempfilefrom unittest.mock import AsyncMock, MagicMock, patch, ANYfrom respx import MockRouterdiff --git a/tests/local_testing/test_anthropic_prompt_caching.py b/tests/local_testing/test_anthropic_prompt_caching.pyindex 3105c0b9eeb..904b3ead92d 100644--- a/tests/local_testing/test_anthropic_prompt_caching.py+++ b/tests/local_testing/test_anthropic_prompt_caching.py@@ -1,6 +1,5 @@import jsonimport os-import sysimport tracebackfrom dotenv import load_dotenv@@ -10,11 +9,7 @@ import iofrom test_streaming import streaming_format_tests-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path-import osfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestdiff --git a/tests/local_testing/test_assistants.py b/tests/local_testing/test_assistants.pyindex 8dc4f9e48e1..af40e2f62b0 100644--- a/tests/local_testing/test_assistants.py+++ b/tests/local_testing/test_assistants.py@@ -1,5 +1,3 @@-import os-import sysimport pytestfrom dotenv import load_dotenv@@ -7,7 +5,6 @@ from openai.types.beta.assistant import Assistantfrom openai.types.beta.assistant_deleted import AssistantDeletedload_dotenv()-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import create_thread, get_threaddiff --git a/tests/local_testing/test_async_fn.py b/tests/local_testing/test_async_fn.pyindex 40a757a4874..e2b3a62bd28 100644--- a/tests/local_testing/test_async_fn.py+++ b/tests/local_testing/test_async_fn.py@@ -3,15 +3,10 @@import asyncioimport logging-import os-import sysimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import acompletion, acreate, completiondiff --git a/tests/local_testing/test_auth_utils.py b/tests/local_testing/test_auth_utils.pyindex e1444ed562e..0cc52716ce1 100644--- a/tests/local_testing/test_auth_utils.py+++ b/tests/local_testing/test_auth_utils.py@@ -7,9 +7,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmfrom litellm.proxy.auth.auth_utils import (diff --git a/tests/local_testing/test_azure_openai.py b/tests/local_testing/test_azure_openai.pyindex 2a2b1e7fc35..d6e08552697 100644--- a/tests/local_testing/test_azure_openai.py+++ b/tests/local_testing/test_azure_openai.py@@ -1,6 +1,5 @@import jsonimport os-import sysimport tracebackfrom dotenv import load_dotenv@@ -8,11 +7,7 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path-import osfrom datetime import datetimefrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/local_testing/test_basic_python_version.py b/tests/local_testing/test_basic_python_version.pyindex a710b5e0ff7..fb06ed6b69d 100644--- a/tests/local_testing/test_basic_python_version.py+++ b/tests/local_testing/test_basic_python_version.py@@ -1,7 +1,6 @@import asyncioimport osimport subprocess-import sysimport timeimport traceback@@ -9,9 +8,6 @@ import pytestPROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathdef _run_uv(*args: str, **kwargs) -> subprocess.CompletedProcess:diff --git a/tests/local_testing/test_batch_completions.py b/tests/local_testing/test_batch_completions.pyindex 95bfe5e6e2b..d3296988e8c 100644--- a/tests/local_testing/test_batch_completions.py+++ b/tests/local_testing/test_batch_completions.py@@ -5,9 +5,6 @@ import sys, osimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom openai import APITimeoutError as Timeoutimport litellmdiff --git a/tests/local_testing/test_blocked_user_list.py b/tests/local_testing/test_blocked_user_list.pyindex 9b29d3fcfa5..9bbe3fedf46 100644--- a/tests/local_testing/test_blocked_user_list.py+++ b/tests/local_testing/test_blocked_user_list.py@@ -5,7 +5,6 @@import asyncioimport osimport random-import sysimport timeimport tracebackfrom datetime import datetime@@ -15,9 +14,6 @@ from fastapi import Requestload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport loggingimport pytestdiff --git a/tests/local_testing/test_braintrust.py b/tests/local_testing/test_braintrust.pyindex 18c210b6d33..4c1a2d990b1 100644--- a/tests/local_testing/test_braintrust.py+++ b/tests/local_testing/test_braintrust.py@@ -2,9 +2,7 @@## This tests the braintrust integrationimport asyncio-import osimport random-import sysimport timeimport tracebackfrom datetime import datetime@@ -14,9 +12,6 @@ from fastapi import Requestload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport loggingfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/local_testing/test_caching.py b/tests/local_testing/test_caching.pyindex 90be551ff46..f9deb9c100b 100644--- a/tests/local_testing/test_caching.py+++ b/tests/local_testing/test_caching.py@@ -1,5 +1,4 @@import os-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -9,9 +8,6 @@ from dotenv import load_dotenvload_dotenv()import json-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport hashlibimport randomdiff --git a/tests/local_testing/test_caching_handler.py b/tests/local_testing/test_caching_handler.pyindex b26334e9ee0..f17a058b3fe 100644--- a/tests/local_testing/test_caching_handler.py+++ b/tests/local_testing/test_caching_handler.py@@ -1,5 +1,3 @@-import os-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -7,9 +5,6 @@ from litellm._uuid import uuidfrom dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport hashlibimport randomdiff --git a/tests/local_testing/test_caching_ssl.py b/tests/local_testing/test_caching_ssl.pyindex 863f227aef1..a8fe45b2d7b 100644--- a/tests/local_testing/test_caching_ssl.py+++ b/tests/local_testing/test_caching_ssl.py@@ -8,9 +8,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmfrom litellm import embedding, completion, Routerdiff --git a/tests/local_testing/test_completion.py b/tests/local_testing/test_completion.pyindex 3b890273ce7..ef8d6c55148 100644--- a/tests/local_testing/test_completion.py+++ b/tests/local_testing/test_completion.py@@ -1,6 +1,5 @@import jsonimport os-import sysimport tracebackfrom dotenv import load_dotenv@@ -8,12 +7,8 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path-import osfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestdiff --git a/tests/local_testing/test_completion_cost.py b/tests/local_testing/test_completion_cost.pyindex 7dfcb55e29a..f47b40f2ef1 100644--- a/tests/local_testing/test_completion_cost.py+++ b/tests/local_testing/test_completion_cost.py@@ -1,14 +1,9 @@import os-import sysimport tracebackimport litellm.cost_calculator-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncio-import osimport timefrom typing import Optionalfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/local_testing/test_completion_with_retries.py b/tests/local_testing/test_completion_with_retries.pyindex c9b519b2af8..ede07a15225 100644--- a/tests/local_testing/test_completion_with_retries.py+++ b/tests/local_testing/test_completion_with_retries.py@@ -4,9 +4,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport openaiimport litellmdiff --git a/tests/local_testing/test_config.py b/tests/local_testing/test_config.pyindex 2a5dc3376ee..6c3c0a093a7 100644--- a/tests/local_testing/test_config.py+++ b/tests/local_testing/test_config.py@@ -3,7 +3,6 @@import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -11,9 +10,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom typing import Literalimport pytestdiff --git a/tests/local_testing/test_cost_calc.py b/tests/local_testing/test_cost_calc.pyindex 233b67a6072..0b2e8e39701 100644--- a/tests/local_testing/test_cost_calc.py+++ b/tests/local_testing/test_cost_calc.py@@ -1,5 +1,3 @@-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -7,9 +5,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom typing import Literalimport pytestdiff --git a/tests/local_testing/test_custom_callback_input.py b/tests/local_testing/test_custom_callback_input.pyindex cedb5ea1a97..745bfe94e1a 100644--- a/tests/local_testing/test_custom_callback_input.py+++ b/tests/local_testing/test_custom_callback_input.py@@ -3,7 +3,6 @@import asyncioimport inspectimport os-import sysimport tracebackfrom litellm._uuid import uuidfrom datetime import datetime@@ -11,7 +10,6 @@ from datetime import datetimeimport pytestfrom pydantic import BaseModel-sys.path.insert(0, os.path.abspath("../.."))from typing import List, Literal, Optional, Unionfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/local_testing/test_custom_llm.py b/tests/local_testing/test_custom_llm.pyindex 64a6c8b2587..160d771004c 100644--- a/tests/local_testing/test_custom_llm.py+++ b/tests/local_testing/test_custom_llm.py@@ -3,18 +3,12 @@import asyncio-import os-import sysimport timeimport tracebackimport openaiimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path-import osfrom collections import defaultdictfrom concurrent.futures import ThreadPoolExecutorfrom typing import (diff --git a/tests/local_testing/test_custom_logger.py b/tests/local_testing/test_custom_logger.pyindex 02a9eaaa9e6..1b627d56717 100644--- a/tests/local_testing/test_custom_logger.py+++ b/tests/local_testing/test_custom_logger.py@@ -2,13 +2,11 @@import asyncioimport inspectimport os-import sysimport timeimport tracebackimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import completion, embeddingdiff --git a/tests/local_testing/test_dual_cache.py b/tests/local_testing/test_dual_cache.pyindex cdfa8146420..e60fa5f3746 100644--- a/tests/local_testing/test_dual_cache.py+++ b/tests/local_testing/test_dual_cache.py@@ -1,5 +1,4 @@import os-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -8,9 +7,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport hashlibimport randomdiff --git a/tests/local_testing/test_dynamic_rate_limit_handler.py b/tests/local_testing/test_dynamic_rate_limit_handler.pyindex fe3c8ca260e..7c178113e35 100644--- a/tests/local_testing/test_dynamic_rate_limit_handler.py+++ b/tests/local_testing/test_dynamic_rate_limit_handler.py@@ -1,9 +1,7 @@# What is this?## Unit tests for 'dynamic_rate_limiter.py`import asyncio-import osimport random-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -14,9 +12,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmdiff --git a/tests/local_testing/test_embedding.py b/tests/local_testing/test_embedding.pyindex fbbe83ada30..aed2849f056 100644--- a/tests/local_testing/test_embedding.py+++ b/tests/local_testing/test_embedding.py@@ -1,7 +1,6 @@import jsonimport osimport re-import sysimport tracebackimport openai@@ -10,9 +9,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, MagicMock, patchimport litellmdiff --git a/tests/local_testing/test_exceptions.py b/tests/local_testing/test_exceptions.pyindex bb96a1a84bb..8370046446d 100644--- a/tests/local_testing/test_exceptions.py+++ b/tests/local_testing/test_exceptions.py@@ -1,7 +1,6 @@import asyncioimport osimport subprocess-import sysimport tracebackfrom typing import Any@@ -10,9 +9,6 @@ from openai import AsyncOpenAI, AuthenticationError, BadRequestError, OpenAIErrofrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom concurrent.futures import ThreadPoolExecutorfrom unittest.mock import MagicMock, patchdiff --git a/tests/local_testing/test_function_call_parsing.py b/tests/local_testing/test_function_call_parsing.pyindex 57027c670bb..c98f170a98f 100644--- a/tests/local_testing/test_function_call_parsing.py+++ b/tests/local_testing/test_function_call_parsing.py@@ -1,7 +1,5 @@# What is this?## Test to make sure function call response always works with json.loads() -> no extra parsing required. Relevant issue - https://github.com/BerriAI/litellm/issues/2654-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -9,9 +7,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport jsonimport warningsfrom typing import Listdiff --git a/tests/local_testing/test_function_calling.py b/tests/local_testing/test_function_calling.pyindex b5f72264549..5752f29daef 100644--- a/tests/local_testing/test_function_calling.py+++ b/tests/local_testing/test_function_calling.py@@ -1,5 +1,3 @@-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -7,9 +5,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestfrom unittest.mock import patch, MagicMock, AsyncMockimport litellmdiff --git a/tests/local_testing/test_function_setup.py b/tests/local_testing/test_function_setup.pyindex 92f49589ca2..757aaefc8c6 100644--- a/tests/local_testing/test_function_setup.py+++ b/tests/local_testing/test_function_setup.py@@ -7,9 +7,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytest, uuidfrom litellm.utils import function_setup, Rulesfrom litellm.litellm_core_utils.prompt_templates.factory import (diff --git a/tests/local_testing/test_gcs_bucket.py b/tests/local_testing/test_gcs_bucket.pyindex ffd466aa809..437a8b8f13b 100644--- a/tests/local_testing/test_gcs_bucket.py+++ b/tests/local_testing/test_gcs_bucket.py@@ -1,8 +1,6 @@import ioimport os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport jsondiff --git a/tests/local_testing/test_get_llm_provider.py b/tests/local_testing/test_get_llm_provider.pyindex 0e667b82a66..cc6209f2bf9 100644--- a/tests/local_testing/test_get_llm_provider.py+++ b/tests/local_testing/test_get_llm_provider.py@@ -1,5 +1,4 @@import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -9,9 +8,6 @@ import iofrom unittest.mock import patch-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmfrom litellm.types.router import LiteLLM_Paramsdiff --git a/tests/local_testing/test_get_model_file.py b/tests/local_testing/test_get_model_file.pyindex 17bd2d7ceff..3742dca9dda 100644--- a/tests/local_testing/test_get_model_file.py+++ b/tests/local_testing/test_get_model_file.py@@ -2,9 +2,6 @@ import os, sys, tracebackimport importlib.resourcesimport json-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmimport pytestdiff --git a/tests/local_testing/test_get_model_info.py b/tests/local_testing/test_get_model_info.pyindex cef05050ac9..2de83778f1c 100644--- a/tests/local_testing/test_get_model_info.py+++ b/tests/local_testing/test_get_model_info.py@@ -1,16 +1,12 @@# What is this?## Unit testing for the 'get_model_info()' functionimport os-import sysimport tracebackimport jsonfrom typing import List, Dict, Any-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport pytestimport litellmdiff --git a/tests/local_testing/test_get_optional_params_embeddings.py b/tests/local_testing/test_get_optional_params_embeddings.pyindex ddf9e877477..60ccfbfaebe 100644--- a/tests/local_testing/test_get_optional_params_embeddings.py+++ b/tests/local_testing/test_get_optional_params_embeddings.py@@ -7,9 +7,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmfrom litellm import embeddingdiff --git a/tests/local_testing/test_google_ai_studio_gemini.py b/tests/local_testing/test_google_ai_studio_gemini.pyindex 5012717d383..43b64ded1ab 100644--- a/tests/local_testing/test_google_ai_studio_gemini.py+++ b/tests/local_testing/test_google_ai_studio_gemini.py@@ -1,8 +1,5 @@import os, sys, traceback-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom dotenv import load_dotenvdiff --git a/tests/local_testing/test_guardrails_ai.py b/tests/local_testing/test_guardrails_ai.pyindex 004ffa0b9e3..bc2db026ecc 100644--- a/tests/local_testing/test_guardrails_ai.py+++ b/tests/local_testing/test_guardrails_ai.py@@ -1,10 +1,5 @@-import os-import sysimport traceback-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy.guardrails.init_guardrails import init_guardrails_v2diff --git a/tests/local_testing/test_helicone_integration.py b/tests/local_testing/test_helicone_integration.pyindex 9bfa29551e3..f34ad33aa9b 100644--- a/tests/local_testing/test_helicone_integration.py+++ b/tests/local_testing/test_helicone_integration.py@@ -2,13 +2,11 @@ import asyncioimport copyimport loggingimport os-import sysimport timefrom typing import Anyfrom unittest.mock import MagicMock, patchlogging.basicConfig(level=logging.DEBUG)-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import completiondiff --git a/tests/local_testing/test_http_parsing_utils.py b/tests/local_testing/test_http_parsing_utils.pyindex 813460c7e27..db282d6d4be 100644--- a/tests/local_testing/test_http_parsing_utils.py+++ b/tests/local_testing/test_http_parsing_utils.py@@ -3,12 +3,7 @@ from fastapi import Requestfrom fastapi.testclient import TestClientfrom starlette.datastructures import Headersfrom starlette.requests import HTTPConnection-import os-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom litellm.proxy.common_utils.http_parsing_utils import _read_request_bodyfrom litellm.proxy._types import ProxyExceptiondiff --git a/tests/local_testing/test_least_busy_routing.py b/tests/local_testing/test_least_busy_routing.pyindex 0a3b5490131..18ab8bf779d 100644--- a/tests/local_testing/test_least_busy_routing.py+++ b/tests/local_testing/test_least_busy_routing.py@@ -2,9 +2,7 @@# This tests the router's ability to identify the least busy deploymentimport asyncio-import osimport random-import sysimport timeimport traceback@@ -12,9 +10,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmdiff --git a/tests/local_testing/test_llm_guard.py b/tests/local_testing/test_llm_guard.pyindex 60fe9c0e020..9e70d48dbda 100644--- a/tests/local_testing/test_llm_guard.py+++ b/tests/local_testing/test_llm_guard.py@@ -10,9 +10,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestfrom fastapi import HTTPExceptiondiff --git a/tests/local_testing/test_longer_context_fallback.py b/tests/local_testing/test_longer_context_fallback.pyindex 07e9e8cad74..adb087079c5 100644--- a/tests/local_testing/test_longer_context_fallback.py+++ b/tests/local_testing/test_longer_context_fallback.py@@ -5,9 +5,6 @@ import sys, osimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import longer_context_model_fallback_dictdiff --git a/tests/local_testing/test_lowest_cost_routing.py b/tests/local_testing/test_lowest_cost_routing.pyindex 6ed1731572a..5bf3a3ee98b 100644--- a/tests/local_testing/test_lowest_cost_routing.py+++ b/tests/local_testing/test_lowest_cost_routing.py@@ -9,9 +9,6 @@ from dotenv import load_dotenvload_dotenv()import copy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestfrom litellm import Routerfrom litellm.router_strategy.lowest_cost import LowestCostLoggingHandlerdiff --git a/tests/local_testing/test_lowest_latency_routing.py b/tests/local_testing/test_lowest_latency_routing.pyindex 0a202e0dfb9..598b1dbcaf9 100644--- a/tests/local_testing/test_lowest_latency_routing.py+++ b/tests/local_testing/test_lowest_latency_routing.py@@ -2,7 +2,6 @@# This tests the router's ability to pick deployment with lowest latencyimport asyncio-import osimport randomimport sysimport time@@ -14,9 +13,6 @@ from dotenv import load_dotenvload_dotenv()import copy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmdiff --git a/tests/local_testing/test_lunary.py b/tests/local_testing/test_lunary.pyindex 0dbae1b817f..a2e137ed355 100644--- a/tests/local_testing/test_lunary.py+++ b/tests/local_testing/test_lunary.py@@ -1,8 +1,5 @@import io-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import completiondiff --git a/tests/local_testing/test_mock_request.py b/tests/local_testing/test_mock_request.pyindex c9cd14633ba..9cbcafb003b 100644--- a/tests/local_testing/test_mock_request.py+++ b/tests/local_testing/test_mock_request.py@@ -2,14 +2,10 @@# This tests mock request calls to litellmimport os-import sysimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmimport timediff --git a/tests/local_testing/test_model_alias_map.py b/tests/local_testing/test_model_alias_map.pyindex 9ef0448e7c6..675f2345747 100644--- a/tests/local_testing/test_model_alias_map.py+++ b/tests/local_testing/test_model_alias_map.py@@ -1,13 +1,8 @@#### What this tests ##### This tests the model alias mapping - if user passes in an alias, and has set an alias, set it to the actual value-import os-import sysimport traceback-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmdiff --git a/tests/local_testing/test_multiple_deployments.py b/tests/local_testing/test_multiple_deployments.pyindex 72bfd5012c1..1c39bd56a95 100644--- a/tests/local_testing/test_multiple_deployments.py+++ b/tests/local_testing/test_multiple_deployments.py@@ -4,9 +4,6 @@import sys, osimport traceback-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmfrom litellm import completiondiff --git a/tests/local_testing/test_ollama.py b/tests/local_testing/test_ollama.pyindex 7ca8e806529..ad5d7d86501 100644--- a/tests/local_testing/test_ollama.py+++ b/tests/local_testing/test_ollama.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -9,9 +7,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest import mockimport pytestdiff --git a/tests/local_testing/test_openai_moderations_hook.py b/tests/local_testing/test_openai_moderations_hook.pyindex 4f98eb608fa..530ab714eae 100644--- a/tests/local_testing/test_openai_moderations_hook.py+++ b/tests/local_testing/test_openai_moderations_hook.py@@ -10,9 +10,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmfrom litellm.proxy.enterprise.enterprise_hooks.openai_moderation import (diff --git a/tests/local_testing/test_opik.py b/tests/local_testing/test_opik.pyindex 4047a5fefe3..8be4b796360 100644--- a/tests/local_testing/test_opik.py+++ b/tests/local_testing/test_opik.py@@ -1,8 +1,6 @@import ioimport os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport loggingdiff --git a/tests/local_testing/test_pass_through_endpoints.py b/tests/local_testing/test_pass_through_endpoints.pyindex 793a60efc3f..618354ca31e 100644--- a/tests/local_testing/test_pass_through_endpoints.py+++ b/tests/local_testing/test_pass_through_endpoints.py@@ -1,5 +1,4 @@import os-import sysfrom litellm._uuid import uuidfrom functools import partialfrom typing import Optional@@ -9,9 +8,6 @@ import pytestfrom fastapi import FastAPIfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds-the parent directory to the system pathimport asynciofrom unittest.mock import Mockdiff --git a/tests/local_testing/test_prometheus_service.py b/tests/local_testing/test_prometheus_service.pyindex b97fcd096b3..c8acca83d93 100644--- a/tests/local_testing/test_prometheus_service.py+++ b/tests/local_testing/test_prometheus_service.py@@ -2,11 +2,9 @@## Unit Tests for prometheus service monitoringimport json-import sysimport osimport io, asyncio-sys.path.insert(0, os.path.abspath("../.."))import pytestfrom litellm import acompletion, Cachefrom litellm._service_logger import ServiceLoggingdiff --git a/tests/local_testing/test_prompt_caching.py b/tests/local_testing/test_prompt_caching.pyindex 58b8f560045..f6b3fb89e9e 100644--- a/tests/local_testing/test_prompt_caching.py+++ b/tests/local_testing/test_prompt_caching.py@@ -1,10 +1,7 @@"""Asserts that prompt caching information is correctly returned for Anthropic, OpenAI, and Deepseek"""import io-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import litellmimport pytestdiff --git a/tests/local_testing/test_prompt_injection_detection.py b/tests/local_testing/test_prompt_injection_detection.pyindex 9f5137630ea..fa35dc5b060 100644--- a/tests/local_testing/test_prompt_injection_detection.py+++ b/tests/local_testing/test_prompt_injection_detection.py@@ -8,9 +8,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmfrom litellm.proxy.hooks.prompt_injection_detection import (diff --git a/tests/local_testing/test_provider_specific_config.py b/tests/local_testing/test_provider_specific_config.pyindex 5587087e40b..a6bad688201 100644--- a/tests/local_testing/test_provider_specific_config.py+++ b/tests/local_testing/test_provider_specific_config.py@@ -3,14 +3,10 @@# There are 2 types of tests - changing config dynamically or by setting class variablesimport os-import sysimport tracebackimport jsonimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, MagicMock, patchimport litellmdiff --git a/tests/local_testing/test_pydantic.py b/tests/local_testing/test_pydantic.pyindex 436b9d3dd48..155b0345186 100644--- a/tests/local_testing/test_pydantic.py+++ b/tests/local_testing/test_pydantic.py@@ -1,5 +1,3 @@-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -7,12 +5,8 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport json-import osimport tempfilefrom unittest.mock import MagicMock, patchdiff --git a/tests/local_testing/test_redis_batch_optimizations.py b/tests/local_testing/test_redis_batch_optimizations.pyindex 4997157bac8..d49939cff1a 100644--- a/tests/local_testing/test_redis_batch_optimizations.py+++ b/tests/local_testing/test_redis_batch_optimizations.py@@ -8,7 +8,6 @@ Verifies:"""import os-import sysimport timefrom unittest.mock import AsyncMock, patch@@ -16,7 +15,6 @@ import pytestfrom dotenv import load_dotenvload_dotenv()-sys.path.insert(0, os.path.abspath("../.."))import uuidfrom litellm.caching.dual_cache import DualCachediff --git a/tests/local_testing/test_register_model.py b/tests/local_testing/test_register_model.pyindex 44fb440bbbd..eddd697974c 100644--- a/tests/local_testing/test_register_model.py+++ b/tests/local_testing/test_register_model.py@@ -8,9 +8,6 @@ from pathlib import Pathimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/local_testing/test_router.py b/tests/local_testing/test_router.pyindex f648b31901a..370c43f8f44 100644--- a/tests/local_testing/test_router.py+++ b/tests/local_testing/test_router.py@@ -3,7 +3,6 @@import asyncioimport os-import sysimport timeimport traceback@@ -13,10 +12,6 @@ import pytestimport litellm.typesimport litellm.types.router-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path-import osfrom collections import defaultdictfrom concurrent.futures import ThreadPoolExecutorfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/local_testing/test_router_batch_completion.py b/tests/local_testing/test_router_batch_completion.pyindex bb9e1851c61..6fd89065c1d 100644--- a/tests/local_testing/test_router_batch_completion.py+++ b/tests/local_testing/test_router_batch_completion.py@@ -2,18 +2,12 @@# This tests litellm router with batch completionimport asyncio-import os-import sysimport timeimport tracebackimport openaiimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path-import osfrom collections import defaultdictfrom concurrent.futures import ThreadPoolExecutordiff --git a/tests/local_testing/test_router_budget_limiter.py b/tests/local_testing/test_router_budget_limiter.pyindex 3bdb3116670..bda1f648076 100644--- a/tests/local_testing/test_router_budget_limiter.py+++ b/tests/local_testing/test_router_budget_limiter.py@@ -6,9 +6,6 @@ from dotenv import load_dotenvload_dotenv()import copy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport pytestfrom litellm import Routerfrom litellm.router_strategy.budget_limiter import RouterBudgetLimitingdiff --git a/tests/local_testing/test_router_caching.py b/tests/local_testing/test_router_caching.pyindex cb223b661b4..9675a1299d1 100644--- a/tests/local_testing/test_router_caching.py+++ b/tests/local_testing/test_router_caching.py@@ -2,16 +2,12 @@# This tests caching on the routerimport asyncioimport os-import sysimport timeimport tracebackfrom unittest.mock import patchfrom typing import Unionimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import Routerfrom litellm.caching import RedisCache, RedisClusterCachediff --git a/tests/local_testing/test_router_client_init.py b/tests/local_testing/test_router_client_init.pyindex f2b82b651dd..f27b3848beb 100644--- a/tests/local_testing/test_router_client_init.py+++ b/tests/local_testing/test_router_client_init.py@@ -6,7 +6,6 @@ import os#### What this tests ##### This tests caching on the router-import sysimport timeimport tracebackfrom typing import Dict@@ -15,9 +14,6 @@ from unittest.mock import MagicMock, PropertyMock, patchimport pytestfrom openai.lib.azure import OpenAIError-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import APIConnectionError, Routerfrom unittest.mock import ANYdiff --git a/tests/local_testing/test_router_cooldown_handlers.py b/tests/local_testing/test_router_cooldown_handlers.pyindex 55510df5b9e..e1e3df1e4a5 100644--- a/tests/local_testing/test_router_cooldown_handlers.py+++ b/tests/local_testing/test_router_cooldown_handlers.py@@ -4,15 +4,11 @@import asyncioimport osimport random-import sysimport timeimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/local_testing/test_router_custom_routing.py b/tests/local_testing/test_router_custom_routing.pyindex 3ebd79a7b2a..bd624f7a19f 100644--- a/tests/local_testing/test_router_custom_routing.py+++ b/tests/local_testing/test_router_custom_routing.py@@ -1,15 +1,10 @@import asyncio-import os-import sysimport timefrom dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom typing import Dict, List, Optional, Unionimport pytestdiff --git a/tests/local_testing/test_router_debug_logs.py b/tests/local_testing/test_router_debug_logs.pyindex 04e8dc6c77c..0fce5c824c7 100644--- a/tests/local_testing/test_router_debug_logs.py+++ b/tests/local_testing/test_router_debug_logs.py@@ -1,14 +1,10 @@import asyncioimport os-import sysimport timeimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport loggingdiff --git a/tests/local_testing/test_router_fallback_handlers.py b/tests/local_testing/test_router_fallback_handlers.pyindex 0bd455463b7..65994f0a4cf 100644--- a/tests/local_testing/test_router_fallback_handlers.py+++ b/tests/local_testing/test_router_fallback_handlers.py@@ -1,14 +1,10 @@import asyncioimport os-import sysimport timeimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, MagicMock, patchimport litellmdiff --git a/tests/local_testing/test_router_fallbacks.py b/tests/local_testing/test_router_fallbacks.pyindex 1cafd2c709d..82b832f89fd 100644--- a/tests/local_testing/test_router_fallbacks.py+++ b/tests/local_testing/test_router_fallbacks.py@@ -3,15 +3,11 @@import asyncioimport os-import sysimport timeimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, MagicMock, patchimport litellmdiff --git a/tests/local_testing/test_router_get_deployments.py b/tests/local_testing/test_router_get_deployments.pyindex 78503b36c74..a4d4359a3e9 100644--- a/tests/local_testing/test_router_get_deployments.py+++ b/tests/local_testing/test_router_get_deployments.py@@ -3,15 +3,11 @@# These are fast Tests, and make no API callsimport asyncioimport os-import sysimport timeimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom collections import defaultdictfrom concurrent.futures import ThreadPoolExecutordiff --git a/tests/local_testing/test_router_max_parallel_requests.py b/tests/local_testing/test_router_max_parallel_requests.pyindex 7bb40dd7a2f..65602c968bc 100644--- a/tests/local_testing/test_router_max_parallel_requests.py+++ b/tests/local_testing/test_router_max_parallel_requests.py@@ -2,15 +2,12 @@## Unit tests for the max_parallel_requests feature on Routerimport asyncioimport inspect-import os-import sysimport timeimport tracebackfrom datetime import datetimeimport pytest-sys.path.insert(0, os.path.abspath("../.."))from typing import Optionalimport litellmdiff --git a/tests/local_testing/test_router_pattern_matching.py b/tests/local_testing/test_router_pattern_matching.pyindex d02582a2a99..6ffc5316f2e 100644--- a/tests/local_testing/test_router_pattern_matching.py+++ b/tests/local_testing/test_router_pattern_matching.py@@ -9,9 +9,6 @@ import jsonimport traceback, asyncioimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import Routerfrom litellm.router import Deployment, LiteLLM_Paramsdiff --git a/tests/local_testing/test_router_retries.py b/tests/local_testing/test_router_retries.pyindex 7d1ad012745..d5374a3da0f 100644--- a/tests/local_testing/test_router_retries.py+++ b/tests/local_testing/test_router_retries.py@@ -3,15 +3,11 @@import asyncioimport os-import sysimport timeimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpximport openaidiff --git a/tests/local_testing/test_router_timeout.py b/tests/local_testing/test_router_timeout.pyindex 9971e540024..9992fa03bcd 100644--- a/tests/local_testing/test_router_timeout.py+++ b/tests/local_testing/test_router_timeout.py@@ -3,18 +3,13 @@import asyncioimport os-import sysimport timeimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import patch, MagicMock, AsyncMock-import osfrom dotenv import load_dotenvdiff --git a/tests/local_testing/test_router_utils.py b/tests/local_testing/test_router_utils.pyindex f2fd2fdf559..45fe42f4cd3 100644--- a/tests/local_testing/test_router_utils.py+++ b/tests/local_testing/test_router_utils.py@@ -5,9 +5,6 @@ import sys, os, timeimport traceback, asyncioimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import Routerfrom litellm.router import Deployment, LiteLLM_Paramsdiff --git a/tests/local_testing/test_rules.py b/tests/local_testing/test_rules.pyindex 7ffab789d64..2e9472c8678 100644--- a/tests/local_testing/test_rules.py+++ b/tests/local_testing/test_rules.py@@ -1,17 +1,12 @@#### What this tests ##### This tests setting rules before / after making llm api callsimport asyncio-import osimport re-import sysimport timeimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import acompletion, completiondiff --git a/tests/local_testing/test_sagemaker.py b/tests/local_testing/test_sagemaker.pyindex bf17d9dce21..a01c8c217c6 100644--- a/tests/local_testing/test_sagemaker.py+++ b/tests/local_testing/test_sagemaker.py@@ -1,6 +1,4 @@import json-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -10,11 +8,7 @@ import ioimport litellmfrom test_streaming import streaming_format_tests-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path-import osfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestdiff --git a/tests/local_testing/test_scheduler.py b/tests/local_testing/test_scheduler.pyindex 178983f02d6..027a400dfc9 100644--- a/tests/local_testing/test_scheduler.py+++ b/tests/local_testing/test_scheduler.py@@ -6,9 +6,6 @@ import traceback, asyncioimport pytestfrom typing import List-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm import Routerfrom litellm.scheduler import FlowItem, Scheduler, SchedulerCacheKeysfrom litellm import ModelResponsediff --git a/tests/local_testing/test_secret_detect_hook.py b/tests/local_testing/test_secret_detect_hook.pyindex 8a93b72dce2..0ee0f596177 100644--- a/tests/local_testing/test_secret_detect_hook.py+++ b/tests/local_testing/test_secret_detect_hook.py@@ -2,12 +2,10 @@## This tests the llm guard integrationimport asyncio-import osimport random# What is this?## Unit test for presidio pii masking-import sysimport timeimport tracebackfrom datetime import datetime@@ -16,9 +14,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestfrom fastapi import Request, Responsefrom starlette.datastructures import URLdiff --git a/tests/local_testing/test_spend_calculate_endpoint.py b/tests/local_testing/test_spend_calculate_endpoint.pyindex 8f7434e40b9..3bedab794e2 100644--- a/tests/local_testing/test_spend_calculate_endpoint.py+++ b/tests/local_testing/test_spend_calculate_endpoint.py@@ -1,5 +1,3 @@-import os-import sysimport pytestfrom dotenv import load_dotenv@@ -13,9 +11,6 @@ from litellm.router import Router# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path@pytest.mark.asynciodiff --git a/tests/local_testing/test_stream_chunk_builder.py b/tests/local_testing/test_stream_chunk_builder.pyindex 823983d9e2d..6d62dd52b89 100644--- a/tests/local_testing/test_stream_chunk_builder.py+++ b/tests/local_testing/test_stream_chunk_builder.py@@ -1,6 +1,5 @@import asyncioimport os-import sysimport timeimport traceback@@ -18,10 +17,6 @@ def check_non_streaming_response(response):assert len(response.choices[0].message.audio.data) > 0, "Audio data is empty"-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path-import osimport dotenvfrom openai import OpenAIdiff --git a/tests/local_testing/test_streaming.py b/tests/local_testing/test_streaming.pyindex ba1f4e7d51c..07d693af447 100644--- a/tests/local_testing/test_streaming.py+++ b/tests/local_testing/test_streaming.py@@ -4,7 +4,6 @@import asyncioimport jsonimport os-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -19,9 +18,6 @@ import litellm.litellm_core_utils.litellm_loggingfrom litellm.utils import ModelResponseListIteratorfrom litellm.types.utils import ModelResponseStream-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom dotenv import load_dotenvload_dotenv()diff --git a/tests/local_testing/test_supabase_integration.py b/tests/local_testing/test_supabase_integration.pyindex 96d2889a795..5331de86303 100644--- a/tests/local_testing/test_supabase_integration.py+++ b/tests/local_testing/test_supabase_integration.py@@ -4,9 +4,6 @@ import sys, osimport tracebackimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import embedding, completiondiff --git a/tests/local_testing/test_text_completion.py b/tests/local_testing/test_text_completion.pyindex 227d8e5096a..a814ce6d303 100644--- a/tests/local_testing/test_text_completion.py+++ b/tests/local_testing/test_text_completion.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -9,9 +7,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchimport pytestdiff --git a/tests/local_testing/test_timeout.py b/tests/local_testing/test_timeout.pyindex 6b490f1cef2..66054a0930a 100644--- a/tests/local_testing/test_timeout.py+++ b/tests/local_testing/test_timeout.py@@ -2,12 +2,8 @@# This tests the timeout decoratorimport os-import sysimport traceback-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport timefrom litellm._uuid import uuiddiff --git a/tests/local_testing/test_tpm_rpm_routing_v2.py b/tests/local_testing/test_tpm_rpm_routing_v2.pyindex c6917775d4b..7478bd253b6 100644--- a/tests/local_testing/test_tpm_rpm_routing_v2.py+++ b/tests/local_testing/test_tpm_rpm_routing_v2.py@@ -4,7 +4,6 @@import asyncioimport osimport random-import sysimport timeimport tracebackfrom datetime import datetime@@ -13,9 +12,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, MagicMock, patchfrom litellm.types.utils import StandardLoggingPayloadimport pytestdiff --git a/tests/local_testing/test_ui_sso_helper_utils.py b/tests/local_testing/test_ui_sso_helper_utils.pyindex c7206363278..bb446c54738 100644--- a/tests/local_testing/test_ui_sso_helper_utils.py+++ b/tests/local_testing/test_ui_sso_helper_utils.py@@ -3,9 +3,7 @@import asyncio-import osimport random-import sysimport timeimport tracebackfrom datetime import datetime@@ -15,9 +13,6 @@ from fastapi import Requestload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport loggingfrom litellm.proxy.management_endpoints.sso_helper_utils import (diff --git a/tests/local_testing/test_unit_test_caching.py b/tests/local_testing/test_unit_test_caching.pyindex e25b75e658f..fd9f4bb9e89 100644--- a/tests/local_testing/test_unit_test_caching.py+++ b/tests/local_testing/test_unit_test_caching.py@@ -1,5 +1,3 @@-import os-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -7,9 +5,6 @@ from litellm._uuid import uuidfrom dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport hashlibimport randomdiff --git a/tests/local_testing/test_update_spend.py b/tests/local_testing/test_update_spend.pyindex 7894f330796..b492a752c2c 100644--- a/tests/local_testing/test_update_spend.py+++ b/tests/local_testing/test_update_spend.py@@ -5,7 +5,6 @@import asyncioimport osimport random-import sysimport timeimport tracebackfrom datetime import datetime@@ -15,9 +14,6 @@ from fastapi import Requestload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport loggingimport pytestdiff --git a/tests/local_testing/test_validate_environment.py b/tests/local_testing/test_validate_environment.pyindex dce61b3abbb..289c2bb7c99 100644--- a/tests/local_testing/test_validate_environment.py+++ b/tests/local_testing/test_validate_environment.py@@ -4,9 +4,6 @@import sys, osimport traceback-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport timeimport litellmdiff --git a/tests/local_testing/test_wandb.py b/tests/local_testing/test_wandb.pyindex 58a9c9f5ddf..02ab2787cf3 100644--- a/tests/local_testing/test_wandb.py+++ b/tests/local_testing/test_wandb.py@@ -1,10 +1,8 @@-import sysimport osimport io, asyncio# import logging# logging.basicConfig(level=logging.DEBUG)-sys.path.insert(0, os.path.abspath("../.."))from litellm import completionimport litellmdiff --git a/tests/logging_callback_tests/base_test.py b/tests/logging_callback_tests/base_test.pyindex 0d1e7dfcf77..68faf4bdb35 100644--- a/tests/logging_callback_tests/base_test.py+++ b/tests/logging_callback_tests/base_test.py@@ -2,14 +2,9 @@ import asyncioimport httpximport jsonimport pytest-import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMock, Mock, patch-import os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.exceptions import BadRequestErrorfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerdiff --git a/tests/logging_callback_tests/conftest.py b/tests/logging_callback_tests/conftest.pyindex dedff9a5aee..66d0ee01f8e 100644--- a/tests/logging_callback_tests/conftest.py+++ b/tests/logging_callback_tests/conftest.py@@ -10,13 +10,9 @@import importlibimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom tests._vcr_conftest_common import ( # noqa: E402,F401@@ -180,7 +176,6 @@ def setup_and_teardown():Module-scoped setup. Reloads litellm only in single-process mode(skipped under xdist to avoid cross-worker interference)."""- sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/logging_callback_tests/create_mock_standard_logging_payload.py b/tests/logging_callback_tests/create_mock_standard_logging_payload.pyindex 106328e95e2..096c8ff8c60 100644--- a/tests/logging_callback_tests/create_mock_standard_logging_payload.py+++ b/tests/logging_callback_tests/create_mock_standard_logging_payload.py@@ -1,9 +1,6 @@import io-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport gzipdiff --git a/tests/logging_callback_tests/test_alerting.py b/tests/logging_callback_tests/test_alerting.pyindex 83513107ad3..3074e973a8e 100644--- a/tests/logging_callback_tests/test_alerting.py+++ b/tests/logging_callback_tests/test_alerting.py@@ -6,7 +6,6 @@ import ioimport jsonimport osimport random-import sysimport timefrom litellm._uuid import uuidfrom datetime import datetime, timedelta@@ -18,8 +17,6 @@ from litellm.types.integrations.slack_alerting import AlertType# import logging# logging.basicConfig(level=logging.DEBUG)-sys.path.insert(0, os.path.abspath("../.."))-import osimport unittest.mockfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/logging_callback_tests/test_amazing_s3_logs.py b/tests/logging_callback_tests/test_amazing_s3_logs.pyindex 08b9ac7d01a..befc5ae3996 100644--- a/tests/logging_callback_tests/test_amazing_s3_logs.py+++ b/tests/logging_callback_tests/test_amazing_s3_logs.py@@ -1,11 +1,8 @@-import sys-import osimport io, asynciofrom collections import defaultdict# import logging# logging.basicConfig(level=logging.DEBUG)-sys.path.insert(0, os.path.abspath("../.."))from litellm import completionimport litellmdiff --git a/tests/logging_callback_tests/test_assemble_streaming_responses.py b/tests/logging_callback_tests/test_assemble_streaming_responses.pyindex 919b76e95a6..d6905ce3565 100644--- a/tests/logging_callback_tests/test_assemble_streaming_responses.py+++ b/tests/logging_callback_tests/test_assemble_streaming_responses.py@@ -9,14 +9,9 @@ Testing for _assemble_complete_response_from_streaming_chunks"""import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpxdiff --git a/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py b/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.pyindex d6d0652ed77..3f9f2bacdd3 100644--- a/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py+++ b/tests/logging_callback_tests/test_bedrock_knowledgebase_hook.py@@ -1,9 +1,7 @@import ioimport os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport litellmdiff --git a/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py b/tests/logging_callback_tests/test_built_in_tools_cost_tracking.pyindex 942c26438c8..53fe493ad9f 100644--- a/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py+++ b/tests/logging_callback_tests/test_built_in_tools_cost_tracking.py@@ -1,5 +1,3 @@-import os-import sysimport tracebackfrom litellm._uuid import uuidimport pytest@@ -14,9 +12,6 @@ import json# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmimport asynciofrom typing import Optionaldiff --git a/tests/logging_callback_tests/test_custom_callback_router.py b/tests/logging_callback_tests/test_custom_callback_router.pyindex 70da10ffeeb..8cbe5fc6ccc 100644--- a/tests/logging_callback_tests/test_custom_callback_router.py+++ b/tests/logging_callback_tests/test_custom_callback_router.py@@ -3,14 +3,12 @@import asyncioimport inspectimport os-import sysimport timeimport tracebackfrom datetime import datetimeimport pytest-sys.path.insert(0, os.path.abspath("../.."))from typing import List, Literal, Optionalfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/logging_callback_tests/test_datadog.py b/tests/logging_callback_tests/test_datadog.pyindex bc7a9a211a4..83a652e8884 100644--- a/tests/logging_callback_tests/test_datadog.py+++ b/tests/logging_callback_tests/test_datadog.py@@ -1,6 +1,5 @@import ioimport os-import sysfrom litellm.integrations.datadog.datadog_handler import (get_datadog_source,@@ -11,7 +10,6 @@ from litellm.integrations.datadog.datadog_handler import (get_datadog_tags,)-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport gzipdiff --git a/tests/logging_callback_tests/test_datadog_llm_obs.py b/tests/logging_callback_tests/test_datadog_llm_obs.pyindex 56aae7aa8bf..bed1a214b44 100644--- a/tests/logging_callback_tests/test_datadog_llm_obs.py+++ b/tests/logging_callback_tests/test_datadog_llm_obs.py@@ -3,11 +3,8 @@ Test the DataDogLLMObsLogger"""import io-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport gzipdiff --git a/tests/logging_callback_tests/test_dynamic_otel_keys.py b/tests/logging_callback_tests/test_dynamic_otel_keys.pyindex 2a463fddc0d..f91f9b166ed 100644--- a/tests/logging_callback_tests/test_dynamic_otel_keys.py+++ b/tests/logging_callback_tests/test_dynamic_otel_keys.py@@ -1,7 +1,4 @@-import sys-import os-sys.path.insert(0, os.path.abspath("../.."))from litellm.litellm_core_utils.initialize_dynamic_callback_params import (initialize_standard_callback_dynamic_params,diff --git a/tests/logging_callback_tests/test_gcs_pub_sub.py b/tests/logging_callback_tests/test_gcs_pub_sub.pyindex 17322b965a7..10957fa2f92 100644--- a/tests/logging_callback_tests/test_gcs_pub_sub.py+++ b/tests/logging_callback_tests/test_gcs_pub_sub.py@@ -1,9 +1,7 @@import ioimport os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport litellmdiff --git a/tests/logging_callback_tests/test_generic_api_callback.py b/tests/logging_callback_tests/test_generic_api_callback.pyindex 9ad17b3d6e2..29d8f9e5694 100644--- a/tests/logging_callback_tests/test_generic_api_callback.py+++ b/tests/logging_callback_tests/test_generic_api_callback.py@@ -1,9 +1,7 @@import ioimport os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport litellmdiff --git a/tests/logging_callback_tests/test_humanloop_unit_tests.py b/tests/logging_callback_tests/test_humanloop_unit_tests.pyindex 9b45c24b81e..edea2098127 100644--- a/tests/logging_callback_tests/test_humanloop_unit_tests.py+++ b/tests/logging_callback_tests/test_humanloop_unit_tests.py@@ -1,11 +1,6 @@-import os-import sysimport threadingfrom datetime import datetime-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport pytestfrom litellm.integrations.humanloop import HumanLoopPromptManagerdiff --git a/tests/logging_callback_tests/test_langfuse_e2e_test.py b/tests/logging_callback_tests/test_langfuse_e2e_test.pyindex bc64e30738f..5682d3720d8 100644--- a/tests/logging_callback_tests/test_langfuse_e2e_test.py+++ b/tests/logging_callback_tests/test_langfuse_e2e_test.py@@ -3,7 +3,6 @@ import copyimport jsonimport loggingimport os-import sysimport threadingfrom typing import Any, Optionalfrom unittest.mock import AsyncMock, MagicMock, patch@@ -11,7 +10,6 @@ from unittest.mock import AsyncMock, MagicMock, patchimport httpxlogging.basicConfig(level=logging.DEBUG)-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import completiondiff --git a/tests/logging_callback_tests/test_langfuse_unit_tests.py b/tests/logging_callback_tests/test_langfuse_unit_tests.pyindex 547e9d15f0b..1c25b169243 100644--- a/tests/logging_callback_tests/test_langfuse_unit_tests.py+++ b/tests/logging_callback_tests/test_langfuse_unit_tests.py@@ -1,9 +1,5 @@import os-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport pytestfrom litellm.integrations.langfuse.langfuse import (diff --git a/tests/logging_callback_tests/test_langsmith_unit_test.py b/tests/logging_callback_tests/test_langsmith_unit_test.pyindex 9cc1acd1ee4..17cd63d8974 100644--- a/tests/logging_callback_tests/test_langsmith_unit_test.py+++ b/tests/logging_callback_tests/test_langsmith_unit_test.py@@ -1,9 +1,7 @@import ioimport os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport gzip@@ -52,7 +50,6 @@ async def test_get_credentials_from_env():assert credentials["LANGSMITH_TENANT_ID"] == "test-tenant-id"# Test tenant_id from environment variable- import osos.environ["LANGSMITH_TENANT_ID"] = "env-tenant-id"credentials = logger.get_credentials_from_env()diff --git a/tests/logging_callback_tests/test_log_db_redis_services.py b/tests/logging_callback_tests/test_log_db_redis_services.pyindex a8c3929be16..e3bc8383c46 100644--- a/tests/logging_callback_tests/test_log_db_redis_services.py+++ b/tests/logging_callback_tests/test_log_db_redis_services.py@@ -1,8 +1,5 @@import io-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport gzipdiff --git a/tests/logging_callback_tests/test_logging_redaction_e2e_test.py b/tests/logging_callback_tests/test_logging_redaction_e2e_test.pyindex 3b42595b959..c754c7b8c2a 100644--- a/tests/logging_callback_tests/test_logging_redaction_e2e_test.py+++ b/tests/logging_callback_tests/test_logging_redaction_e2e_test.py@@ -1,10 +1,7 @@import io-import os-import sysfrom typing import Optional, Union-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport gzipdiff --git a/tests/logging_callback_tests/test_moderations_api_logging.py b/tests/logging_callback_tests/test_moderations_api_logging.pyindex 9190f2aebe5..a2a356d3665 100644--- a/tests/logging_callback_tests/test_moderations_api_logging.py+++ b/tests/logging_callback_tests/test_moderations_api_logging.py@@ -1,5 +1,3 @@-import os-import sysimport tracebackfrom litellm._uuid import uuidimport pytest@@ -12,9 +10,6 @@ import ioimport timeimport json-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.router import Routerimport asynciodiff --git a/tests/logging_callback_tests/test_opentelemetry_unit_tests.py b/tests/logging_callback_tests/test_opentelemetry_unit_tests.pyindex 767f840a003..fcbd6dbc531 100644--- a/tests/logging_callback_tests/test_opentelemetry_unit_tests.py+++ b/tests/logging_callback_tests/test_opentelemetry_unit_tests.py@@ -10,9 +10,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmfrom unittest.mock import patch, MagicMock, AsyncMockdiff --git a/tests/logging_callback_tests/test_otel_logging.py b/tests/logging_callback_tests/test_otel_logging.pyindex b6d7ef4be4e..ff85a320904 100644--- a/tests/logging_callback_tests/test_otel_logging.py+++ b/tests/logging_callback_tests/test_otel_logging.py@@ -1,12 +1,7 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport pytestimport litellmdiff --git a/tests/logging_callback_tests/test_pagerduty_alerting.py b/tests/logging_callback_tests/test_pagerduty_alerting.pyindex 108a1ead1a4..1426dc32081 100644--- a/tests/logging_callback_tests/test_pagerduty_alerting.py+++ b/tests/logging_callback_tests/test_pagerduty_alerting.py@@ -1,11 +1,8 @@import asyncio-import osimport random-import sysfrom datetime import datetime, timedeltafrom typing import Optional-sys.path.insert(0, os.path.abspath("../.."))import pytestimport litellmdiff --git a/tests/logging_callback_tests/test_posthog.py b/tests/logging_callback_tests/test_posthog.pyindex b3f346bcf9d..92bbc255730 100644--- a/tests/logging_callback_tests/test_posthog.py+++ b/tests/logging_callback_tests/test_posthog.py@@ -1,7 +1,5 @@import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import pytestdiff --git a/tests/logging_callback_tests/test_spend_logs.py b/tests/logging_callback_tests/test_spend_logs.pyindex 709aa81f421..feecfc9f4ab 100644--- a/tests/logging_callback_tests/test_spend_logs.py+++ b/tests/logging_callback_tests/test_spend_logs.py@@ -1,5 +1,3 @@-import os-import sysimport tracebackfrom litellm._uuid import uuid@@ -13,9 +11,6 @@ import time# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport datetimeimport jsondiff --git a/tests/logging_callback_tests/test_standard_logging_payload.py b/tests/logging_callback_tests/test_standard_logging_payload.pyindex 6a632c32fc2..da1fbbaa04f 100644--- a/tests/logging_callback_tests/test_standard_logging_payload.py+++ b/tests/logging_callback_tests/test_standard_logging_payload.py@@ -3,14 +3,9 @@ Unit tests for StandardLoggingPayloadSetup"""import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom datetime import datetime as dt_objectimport timeimport pytestdiff --git a/tests/logging_callback_tests/test_standard_logging_payload_excluded_fields.py b/tests/logging_callback_tests/test_standard_logging_payload_excluded_fields.pyindex 4088bdd2cf7..d8c45d832ce 100644--- a/tests/logging_callback_tests/test_standard_logging_payload_excluded_fields.py+++ b/tests/logging_callback_tests/test_standard_logging_payload_excluded_fields.py@@ -13,15 +13,12 @@ Example config:standard_logging_payload_excluded_fields: ["response", "messages"]"""-import os-import sysfrom copy import deepcopyfrom typing import Dict, List, Optionalfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.integrations.custom_logger import CustomLoggerdiff --git a/tests/logging_callback_tests/test_token_counting.py b/tests/logging_callback_tests/test_token_counting.pyindex e2160076b00..c942a9d2686 100644--- a/tests/logging_callback_tests/test_token_counting.py+++ b/tests/logging_callback_tests/test_token_counting.py@@ -1,5 +1,4 @@import os-import sysimport tracebackfrom litellm._uuid import uuidimport pytest@@ -14,9 +13,6 @@ import json# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmimport asynciofrom typing import Optionaldiff --git a/tests/logging_callback_tests/test_unit_test_litellm_logging.py b/tests/logging_callback_tests/test_unit_test_litellm_logging.pyindex f82813b7475..42ba4ff35f1 100644--- a/tests/logging_callback_tests/test_unit_test_litellm_logging.py+++ b/tests/logging_callback_tests/test_unit_test_litellm_logging.py@@ -1,12 +1,7 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom typing import Literaldiff --git a/tests/logging_callback_tests/test_unit_tests_init_callbacks.py b/tests/logging_callback_tests/test_unit_tests_init_callbacks.pyindex b2243eed049..f8917ddee78 100644--- a/tests/logging_callback_tests/test_unit_tests_init_callbacks.py+++ b/tests/logging_callback_tests/test_unit_tests_init_callbacks.py@@ -1,12 +1,8 @@import jsonimport os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom typing import Literaldiff --git a/tests/logging_callback_tests/test_view_request_resp_logs.py b/tests/logging_callback_tests/test_view_request_resp_logs.pyindex 37b65855774..249e84286d5 100644--- a/tests/logging_callback_tests/test_view_request_resp_logs.py+++ b/tests/logging_callback_tests/test_view_request_resp_logs.py@@ -1,8 +1,5 @@import io-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport jsondiff --git a/tests/mcp_tests/conftest.py b/tests/mcp_tests/conftest.pyindex a3b425f72c3..d1dc3ec7216 100644--- a/tests/mcp_tests/conftest.py+++ b/tests/mcp_tests/conftest.py@@ -2,13 +2,9 @@import importlibimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmimport asyncio@@ -29,9 +25,6 @@ def setup_and_teardown():This fixture reloads litellm before every function. To speed up testing by removing callbacks being chained."""curr_dir = os.getcwd() # Get the current working directory- sys.path.insert(- 0, os.path.abspath("../..")- ) # Adds the project directory to the system pathfrom litellm import Routerdiff --git a/tests/mcp_tests/test_aresponses_api_with_mcp.py b/tests/mcp_tests/test_aresponses_api_with_mcp.pyindex 6da8ce598a9..7a48c366003 100644--- a/tests/mcp_tests/test_aresponses_api_with_mcp.py+++ b/tests/mcp_tests/test_aresponses_api_with_mcp.py@@ -1,11 +1,9 @@import loggingimport os-import sysimport pytestfrom typing import List, Any, castfrom unittest.mock import AsyncMock, patch-sys.path.insert(0, os.path.abspath("../../.."))# Import required modulesimport litellmdiff --git a/tests/mcp_tests/test_mcp_client_unit.py b/tests/mcp_tests/test_mcp_client_unit.pyindex 43260eda1b7..aadaadd510e 100644--- a/tests/mcp_tests/test_mcp_client_unit.py+++ b/tests/mcp_tests/test_mcp_client_unit.py@@ -3,13 +3,10 @@ Unit tests for the MCPClient class - critical functionality only."""import base64-import os-import sysimport pytestfrom unittest.mock import AsyncMock, MagicMock, patch, ANY# Add the project root to the path-sys.path.insert(0, os.path.abspath("../../.."))import litellm.experimental_mcp_client.client as mcp_client_modulefrom litellm.experimental_mcp_client.client import MCPClientdiff --git a/tests/mcp_tests/test_mcp_guardrails.py b/tests/mcp_tests/test_mcp_guardrails.pyindex 42f4aa6778b..04401992449 100644--- a/tests/mcp_tests/test_mcp_guardrails.py+++ b/tests/mcp_tests/test_mcp_guardrails.py@@ -7,14 +7,11 @@ including various guardrail types and proper exception handling.import asyncioimport pytest-import sys-import osfrom datetime import datetimefrom typing import Optional, Dict, Anyfrom unittest.mock import MagicMock, AsyncMock, patch# Add the project root to the path-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.exceptions import BlockedPiiEntityError, GuardrailRaisedExceptiondiff --git a/tests/mcp_tests/test_mcp_litellm_client.py b/tests/mcp_tests/test_mcp_litellm_client.pyindex e197673ab10..cfc0692c8fa 100644--- a/tests/mcp_tests/test_mcp_litellm_client.py+++ b/tests/mcp_tests/test_mcp_litellm_client.py@@ -1,16 +1,11 @@# Create server parameters for stdio connectionimport os-import sysimport pytestimport asyncio-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom mcp import ClientSession, StdioServerParametersfrom mcp.client.stdio import stdio_client-import osfrom litellm import experimental_mcp_clientimport litellmimport jsondiff --git a/tests/mcp_tests/test_mcp_logging.py b/tests/mcp_tests/test_mcp_logging.pyindex 55b49aa0d29..7ee745b311e 100644--- a/tests/mcp_tests/test_mcp_logging.py+++ b/tests/mcp_tests/test_mcp_logging.py@@ -1,14 +1,10 @@import os-import sysimport pytestimport asynciofrom typing import Optionalfrom unittest.mock import AsyncMock, patch-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.types.utils import StandardLoggingPayloadfrom litellm.integrations.custom_logger import CustomLoggerdiff --git a/tests/mcp_tests/test_mcp_server.py b/tests/mcp_tests/test_mcp_server.pyindex 434a9bc3809..e06c33263fb 100644--- a/tests/mcp_tests/test_mcp_server.py+++ b/tests/mcp_tests/test_mcp_server.py@@ -1,13 +1,9 @@# Create server parameters for stdio connectionimport os-import sysimport pytestfrom unittest.mock import AsyncMock, MagicMock, patchfrom contextlib import asynccontextmanager-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._experimental.mcp_server.mcp_server_manager import (MCPServerManager,diff --git a/tests/mcp_tests/test_semantic_tool_filter_e2e.py b/tests/mcp_tests/test_semantic_tool_filter_e2e.pyindex f71067fde6d..aa25c98107e 100644--- a/tests/mcp_tests/test_semantic_tool_filter_e2e.py+++ b/tests/mcp_tests/test_semantic_tool_filter_e2e.py@@ -4,12 +4,10 @@ End-to-end test for MCP Semantic Tool Filteringimport asyncioimport os-import sysfrom unittest.mock import Mockimport pytest-sys.path.insert(0, os.path.abspath("../.."))from mcp.types import Tool as MCPTooldiff --git a/tests/ocr_tests/conftest.py b/tests/ocr_tests/conftest.pyindex 09d535dee4b..259aad5f782 100644--- a/tests/ocr_tests/conftest.py+++ b/tests/ocr_tests/conftest.py@@ -5,12 +5,9 @@# Vertex AI OCR) are replayed for 24h. See tests/llm_translation/Readme.md# for the design overview.-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))from tests._vcr_conftest_common import ( # noqa: E402,F401VerboseReporterState,diff --git a/tests/otel_tests/test_prometheus.py b/tests/otel_tests/test_prometheus.pyindex 90c71037609..84d5f48a706 100644--- a/tests/otel_tests/test_prometheus.py+++ b/tests/otel_tests/test_prometheus.py@@ -6,14 +6,9 @@ import pytestimport aiohttpimport asynciofrom litellm._uuid import uuid-import os-import sysfrom openai import AsyncOpenAIfrom typing import Dict, Any-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathEND_USER_ID = "my-test-user-34"diff --git a/tests/pass_through_unit_tests/base_anthropic_messages_prompt_caching_test.py b/tests/pass_through_unit_tests/base_anthropic_messages_prompt_caching_test.pyindex e8d14b00681..520b31513f5 100644--- a/tests/pass_through_unit_tests/base_anthropic_messages_prompt_caching_test.py+++ b/tests/pass_through_unit_tests/base_anthropic_messages_prompt_caching_test.py@@ -17,7 +17,6 @@ import sysfrom abc import ABC, abstractmethodfrom typing import Any, Dict, List-sys.path.insert(0, os.path.abspath("../../.."))sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))import pytestdiff --git a/tests/pass_through_unit_tests/base_anthropic_messages_tool_search_test.py b/tests/pass_through_unit_tests/base_anthropic_messages_tool_search_test.pyindex 64acc68c264..6a5bf627ac7 100644--- a/tests/pass_through_unit_tests/base_anthropic_messages_tool_search_test.py+++ b/tests/pass_through_unit_tests/base_anthropic_messages_tool_search_test.py@@ -8,12 +8,9 @@ Reference: https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-se"""import json-import os-import sysfrom abc import ABC, abstractmethodfrom typing import Any, Dict, List-sys.path.insert(0, os.path.abspath("../../.."))import pytestimport litellmdiff --git a/tests/pass_through_unit_tests/base_anthropic_unified_messages_test.py b/tests/pass_through_unit_tests/base_anthropic_unified_messages_test.pyindex 821cb59887f..153c72e4a11 100644--- a/tests/pass_through_unit_tests/base_anthropic_unified_messages_test.py+++ b/tests/pass_through_unit_tests/base_anthropic_unified_messages_test.py@@ -1,15 +1,10 @@import json-import os-import sysfrom datetime import datetimefrom typing import AsyncIterator, Dict, Anyimport asyncioimport unittest.mockfrom unittest.mock import AsyncMock, MagicMock-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmimport pytestfrom dotenv import load_dotenvdiff --git a/tests/pass_through_unit_tests/conftest.py b/tests/pass_through_unit_tests/conftest.pyindex 10615ddcb73..e6e98f790e8 100644--- a/tests/pass_through_unit_tests/conftest.py+++ b/tests/pass_through_unit_tests/conftest.py@@ -1,9 +1,6 @@-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))from tests._vcr_conftest_common import ( # noqa: E402,F401VerboseReporterState,diff --git a/tests/pass_through_unit_tests/messages_api_structured_output/base_anthropic_messages_structured_output_test.py b/tests/pass_through_unit_tests/messages_api_structured_output/base_anthropic_messages_structured_output_test.pyindex ce5e8aa25fe..8f27fa000f6 100644--- a/tests/pass_through_unit_tests/messages_api_structured_output/base_anthropic_messages_structured_output_test.py+++ b/tests/pass_through_unit_tests/messages_api_structured_output/base_anthropic_messages_structured_output_test.py@@ -6,12 +6,9 @@ by making actual API calls and validating JSON response format."""import json-import os-import sysfrom abc import ABC, abstractmethodfrom typing import Any, Dict, List, Optional-sys.path.insert(0, os.path.abspath("../../.."))import pytestimport litellmdiff --git a/tests/pass_through_unit_tests/messages_api_structured_output/test_anthropic_api_structured_output.py b/tests/pass_through_unit_tests/messages_api_structured_output/test_anthropic_api_structured_output.pyindex 261c7d18d65..6f87aed4393 100644--- a/tests/pass_through_unit_tests/messages_api_structured_output/test_anthropic_api_structured_output.py+++ b/tests/pass_through_unit_tests/messages_api_structured_output/test_anthropic_api_structured_output.py@@ -7,10 +7,7 @@ by making actual API calls and validating JSON response format.Requires ANTHROPIC_API_KEY environment variable."""-import os-import sys-sys.path.insert(0, os.path.abspath("../../../.."))from .base_anthropic_messages_structured_output_test import (BaseAnthropicMessagesStructuredOutputTest,diff --git a/tests/pass_through_unit_tests/messages_api_structured_output/test_azure_anthropic_structured_output.py b/tests/pass_through_unit_tests/messages_api_structured_output/test_azure_anthropic_structured_output.pyindex b2470bf6b67..1ca4213a2b1 100644--- a/tests/pass_through_unit_tests/messages_api_structured_output/test_azure_anthropic_structured_output.py+++ b/tests/pass_through_unit_tests/messages_api_structured_output/test_azure_anthropic_structured_output.py@@ -8,10 +8,8 @@ Requires Azure AI credentials and model deployment."""import os-import sysfrom typing import Optional-sys.path.insert(0, os.path.abspath("../../../.."))from .base_anthropic_messages_structured_output_test import (BaseAnthropicMessagesStructuredOutputTest,diff --git a/tests/pass_through_unit_tests/messages_api_structured_output/test_bedrock_converse_structured_output.py b/tests/pass_through_unit_tests/messages_api_structured_output/test_bedrock_converse_structured_output.pyindex 7af7e8e38eb..bb7aa3dec35 100644--- a/tests/pass_through_unit_tests/messages_api_structured_output/test_bedrock_converse_structured_output.py+++ b/tests/pass_through_unit_tests/messages_api_structured_output/test_bedrock_converse_structured_output.py@@ -7,10 +7,7 @@ by making actual API calls and validating JSON response format.Requires AWS credentials and Bedrock model access."""-import os-import sys-sys.path.insert(0, os.path.abspath("../../../.."))from .base_anthropic_messages_structured_output_test import (BaseAnthropicMessagesStructuredOutputTest,diff --git a/tests/pass_through_unit_tests/messages_api_structured_output/test_bedrock_invoke_structured_output.py b/tests/pass_through_unit_tests/messages_api_structured_output/test_bedrock_invoke_structured_output.pyindex 09813507058..05a78d9ea00 100644--- a/tests/pass_through_unit_tests/messages_api_structured_output/test_bedrock_invoke_structured_output.py+++ b/tests/pass_through_unit_tests/messages_api_structured_output/test_bedrock_invoke_structured_output.py@@ -7,12 +7,9 @@ by making actual API calls and validating JSON response format.Requires AWS credentials and Bedrock model access."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from .base_anthropic_messages_structured_output_test import (BaseAnthropicMessagesStructuredOutputTest,diff --git a/tests/pass_through_unit_tests/test_anthropic_messages_passthrough.py b/tests/pass_through_unit_tests/test_anthropic_messages_passthrough.pyindex a53efdd8255..940c9624ec4 100644--- a/tests/pass_through_unit_tests/test_anthropic_messages_passthrough.py+++ b/tests/pass_through_unit_tests/test_anthropic_messages_passthrough.py@@ -1,15 +1,11 @@import jsonimport os-import sysfrom datetime import datetimefrom typing import AsyncIterator, Dict, Anyimport asyncioimport unittest.mockfrom unittest.mock import AsyncMock, MagicMock-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmimport pytestfrom dotenv import load_dotenv@@ -41,7 +37,6 @@ def event_loop():@pytest.fixture(scope="function", autouse=True)def setup_and_teardown(event_loop): # Add event_loop as a dependencycurr_dir = os.getcwd()- sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import Routerdiff --git a/tests/pass_through_unit_tests/test_anthropic_messages_prompt_caching.py b/tests/pass_through_unit_tests/test_anthropic_messages_prompt_caching.pyindex a194ded12fd..e64218b677f 100644--- a/tests/pass_through_unit_tests/test_anthropic_messages_prompt_caching.py+++ b/tests/pass_through_unit_tests/test_anthropic_messages_prompt_caching.py@@ -11,10 +11,7 @@ Per AWS docs (https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-cachin- Claude 3.5 Haiku: GA, 2048 min tokens"""-import os-import sys-sys.path.insert(0, os.path.abspath("../../.."))import pytestfrom base_anthropic_messages_prompt_caching_test import (diff --git a/tests/pass_through_unit_tests/test_anthropic_messages_tool_search.py b/tests/pass_through_unit_tests/test_anthropic_messages_tool_search.pyindex c8b91c3c49f..9006356ff2a 100644--- a/tests/pass_through_unit_tests/test_anthropic_messages_tool_search.py+++ b/tests/pass_through_unit_tests/test_anthropic_messages_tool_search.py@@ -13,10 +13,7 @@ Supported providers:Reference: https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-search-tool"""-import os-import sys-sys.path.insert(0, os.path.abspath("../../.."))import pytestfrom base_anthropic_messages_tool_search_test import (diff --git a/tests/pass_through_unit_tests/test_assemblyai_unit_tests_passthrough.py b/tests/pass_through_unit_tests/test_assemblyai_unit_tests_passthrough.pyindex 6fdd4cc0f24..bbc6b6b5937 100644--- a/tests/pass_through_unit_tests/test_assemblyai_unit_tests_passthrough.py+++ b/tests/pass_through_unit_tests/test_assemblyai_unit_tests_passthrough.py@@ -1,12 +1,7 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, Mock, patch-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport httpx@@ -15,12 +10,7 @@ import litellmfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObj-import os-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom litellm.proxy.pass_through_endpoints.llm_provider_handlers.assembly_passthrough_logging_handler import (AssemblyAIPassthroughLoggingHandler,diff --git a/tests/pass_through_unit_tests/test_bedrock_anthropic_messages_test.py b/tests/pass_through_unit_tests/test_bedrock_anthropic_messages_test.pyindex dcc44cae77e..e86c32f916d 100644--- a/tests/pass_through_unit_tests/test_bedrock_anthropic_messages_test.py+++ b/tests/pass_through_unit_tests/test_bedrock_anthropic_messages_test.py@@ -1,6 +1,5 @@import jsonimport os-import sysfrom datetime import datetimefrom typing import AsyncIterator, Dict, Anyimport asyncio@@ -9,9 +8,6 @@ from unittest.mock import MagicMockimport pytestfrom litellm.router import Router-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom base_anthropic_unified_messages_test import BaseAnthropicMessagesTestdiff --git a/tests/pass_through_unit_tests/test_bedrock_tool_use_beta_header.py b/tests/pass_through_unit_tests/test_bedrock_tool_use_beta_header.pyindex ed7f38cba4b..a28b8a147af 100644--- a/tests/pass_through_unit_tests/test_bedrock_tool_use_beta_header.py+++ b/tests/pass_through_unit_tests/test_bedrock_tool_use_beta_header.py@@ -5,11 +5,8 @@ Tests that LiteLLM correctly filters out the advanced-tool-use-2025-11-20 beta hfor Bedrock Invoke API, which doesn't support it and returns a 400 "invalid beta flag" error."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/pass_through_unit_tests/test_claude_code_marketplace.py b/tests/pass_through_unit_tests/test_claude_code_marketplace.pyindex 1a225b44b50..2ca81f1d5d3 100644--- a/tests/pass_through_unit_tests/test_claude_code_marketplace.py+++ b/tests/pass_through_unit_tests/test_claude_code_marketplace.py@@ -7,15 +7,12 @@ Tests:"""import json-import os-import sysimport timefrom datetime import datetime, timezonefrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/pass_through_unit_tests/test_custom_logger_passthrough.py b/tests/pass_through_unit_tests/test_custom_logger_passthrough.pyindex 6e6507f9826..e70f2cf4430 100644--- a/tests/pass_through_unit_tests/test_custom_logger_passthrough.py+++ b/tests/pass_through_unit_tests/test_custom_logger_passthrough.py@@ -1,6 +1,5 @@import jsonimport os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, Mock, patch, MagicMockfrom typing import Optional@@ -8,9 +7,6 @@ from fastapi import Requestimport pytestimport asyncio-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/pass_through_unit_tests/test_pass_through_unit_tests.py b/tests/pass_through_unit_tests/test_pass_through_unit_tests.pyindex 77fb924c085..ed04b63000f 100644--- a/tests/pass_through_unit_tests/test_pass_through_unit_tests.py+++ b/tests/pass_through_unit_tests/test_pass_through_unit_tests.py@@ -1,13 +1,8 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, Mock, patch, MagicMockfrom typing import Optional-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport fastapifrom fastapi import FastAPIdiff --git a/tests/pass_through_unit_tests/test_passthrough_managed_ids.py b/tests/pass_through_unit_tests/test_passthrough_managed_ids.pyindex cbbf9257118..0fc0e0e751c 100644--- a/tests/pass_through_unit_tests/test_passthrough_managed_ids.py+++ b/tests/pass_through_unit_tests/test_passthrough_managed_ids.py@@ -18,14 +18,11 @@ from __future__ import annotationsimport base64import json-import sys-import osfrom typing import Anyfrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.llms.base_llm.managed_resources.utils import (diff --git a/tests/pass_through_unit_tests/test_unit_test_anthropic_pass_through.py b/tests/pass_through_unit_tests/test_unit_test_anthropic_pass_through.pyindex 5ab0319da47..8c59ce77451 100644--- a/tests/pass_through_unit_tests/test_unit_test_anthropic_pass_through.py+++ b/tests/pass_through_unit_tests/test_unit_test_anthropic_pass_through.py@@ -1,12 +1,7 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, Mock, patch-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpxdiff --git a/tests/pass_through_unit_tests/test_unit_test_passthrough_router.py b/tests/pass_through_unit_tests/test_unit_test_passthrough_router.pyindex ee1f8772568..2b5bb6cf284 100644--- a/tests/pass_through_unit_tests/test_unit_test_passthrough_router.py+++ b/tests/pass_through_unit_tests/test_unit_test_passthrough_router.py@@ -1,10 +1,8 @@import jsonimport os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, Mock, patch, MagicMock-sys.path.insert(0, os.path.abspath("../..")) #import unittestfrom litellm.proxy.pass_through_endpoints.passthrough_endpoint_router import (diff --git a/tests/pass_through_unit_tests/test_unit_test_streaming.py b/tests/pass_through_unit_tests/test_unit_test_streaming.pyindex ed98b720b37..376c9208aa1 100644--- a/tests/pass_through_unit_tests/test_unit_test_streaming.py+++ b/tests/pass_through_unit_tests/test_unit_test_streaming.py@@ -1,12 +1,7 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, Mock, patch, MagicMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpximport pytestdiff --git a/tests/pass_through_unit_tests/test_vertex_ai_anthropic_streaming_cost_injection.py b/tests/pass_through_unit_tests/test_vertex_ai_anthropic_streaming_cost_injection.pyindex ac754aefaea..498f0a734a3 100644--- a/tests/pass_through_unit_tests/test_vertex_ai_anthropic_streaming_cost_injection.py+++ b/tests/pass_through_unit_tests/test_vertex_ai_anthropic_streaming_cost_injection.py@@ -6,12 +6,9 @@ for Vertex AI streamRawPredict endpoints when include_cost_in_streaming_usage is"""import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, MagicMock, patch-sys.path.insert(0, os.path.abspath("../.."))import httpximport pytestdiff --git a/tests/pass_through_unit_tests/test_vertex_ai_live_passthrough.py b/tests/pass_through_unit_tests/test_vertex_ai_live_passthrough.pyindex f25d9e7c1d3..e2eb6d0b68b 100644--- a/tests/pass_through_unit_tests/test_vertex_ai_live_passthrough.py+++ b/tests/pass_through_unit_tests/test_vertex_ai_live_passthrough.py@@ -6,8 +6,6 @@ including the logging handler, cost tracking, and WebSocket message processing."""import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, Mock, patch, MagicMockfrom typing import Dict, List, Any, Optional@@ -16,7 +14,6 @@ import pytestimport httpx# Add the parent directory to the system path-sys.path.insert(0, os.path.abspath("../.."))from litellm.proxy.pass_through_endpoints.llm_provider_handlers.vertex_ai_live_passthrough_logging_handler import (VertexAILivePassthroughLoggingHandler,diff --git a/tests/pass_through_unit_tests/test_websearch_interception_e2e.py b/tests/pass_through_unit_tests/test_websearch_interception_e2e.pyindex d4cf997ab58..091ea106b91 100644--- a/tests/pass_through_unit_tests/test_websearch_interception_e2e.py+++ b/tests/pass_through_unit_tests/test_websearch_interception_e2e.py@@ -5,10 +5,8 @@ Makes actual calls to test WebSearch interception with Perplexity.Tests both streaming and non-streaming requests."""-import osimport sys-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.integrations.websearch_interception import (diff --git a/tests/proxy_admin_ui_tests/conftest.py b/tests/proxy_admin_ui_tests/conftest.pyindex 67365f4745d..93f00db8f79 100644--- a/tests/proxy_admin_ui_tests/conftest.py+++ b/tests/proxy_admin_ui_tests/conftest.py@@ -2,13 +2,9 @@import importlibimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm@@ -18,9 +14,6 @@ def setup_and_teardown():This fixture reloads litellm before every function. To speed up testing by removing callbacks being chained."""curr_dir = os.getcwd() # Get the current working directory- sys.path.insert(- 0, os.path.abspath("../..")- ) # Adds the project directory to the system pathfrom litellm import Routerdiff --git a/tests/proxy_admin_ui_tests/test_access_group_team_sync.py b/tests/proxy_admin_ui_tests/test_access_group_team_sync.pyindex f7092d3ec00..b72a1453576 100644--- a/tests/proxy_admin_ui_tests/test_access_group_team_sync.py+++ b/tests/proxy_admin_ui_tests/test_access_group_team_sync.py@@ -10,7 +10,6 @@ suite, which is the only place a `NOT (... = ANY(...))` guard going missing showimport asyncioimport os-import sysfrom contextlib import asynccontextmanagerfrom datetime import timedeltafrom types import SimpleNamespace@@ -18,7 +17,6 @@ from unittest.mock import AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.proxy.management_helpers.access_group_team_sync import (reconcile_team_access_group_membership,diff --git a/tests/proxy_admin_ui_tests/test_key_management.py b/tests/proxy_admin_ui_tests/test_key_management.pyindex 9fff120bba1..979ba31bffa 100644--- a/tests/proxy_admin_ui_tests/test_key_management.py+++ b/tests/proxy_admin_ui_tests/test_key_management.py@@ -1,5 +1,4 @@import os-import sysimport tracebackfrom litellm._uuid import uuidimport datetime as dt@@ -16,9 +15,6 @@ import time# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport loggingdiff --git a/tests/proxy_admin_ui_tests/test_role_based_access.py b/tests/proxy_admin_ui_tests/test_role_based_access.pyindex 1c4ee2caa04..92e731b8c23 100644--- a/tests/proxy_admin_ui_tests/test_role_based_access.py+++ b/tests/proxy_admin_ui_tests/test_role_based_access.py@@ -4,7 +4,6 @@ RBAC testsimport osimport re-import sysimport tracebackfrom litellm._uuid import uuidfrom datetime import datetime@@ -19,9 +18,6 @@ import time# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport loggingfrom unittest.mock import MagicMockdiff --git a/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py b/tests/proxy_admin_ui_tests/test_route_check_unit_tests.pyindex 6396a92cf80..a31c0b923e3 100644--- a/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py+++ b/tests/proxy_admin_ui_tests/test_route_check_unit_tests.py@@ -1,5 +1,3 @@-import os-import sysimport tracebackfrom litellm._uuid import uuidimport datetime as dt@@ -16,9 +14,6 @@ import time# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport loggingdiff --git a/tests/proxy_admin_ui_tests/test_sso_sign_in.py b/tests/proxy_admin_ui_tests/test_sso_sign_in.pyindex 294a5c56199..dd618cf3836 100644--- a/tests/proxy_admin_ui_tests/test_sso_sign_in.py+++ b/tests/proxy_admin_ui_tests/test_sso_sign_in.py@@ -3,18 +3,13 @@ from fastapi.testclient import TestClientfrom fastapi import Request, Headerfrom unittest.mock import patch, MagicMock, AsyncMock-import sysimport os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy.proxy_server import appfrom litellm.proxy.utils import PrismaClient, ProxyLoggingfrom litellm.proxy.management_endpoints.ui_sso import auth_callbackfrom litellm.proxy._types import LitellmUserRoles-import osimport jwtimport timefrom litellm.caching.caching import DualCachediff --git a/tests/proxy_admin_ui_tests/test_usage_endpoints.py b/tests/proxy_admin_ui_tests/test_usage_endpoints.pyindex 0d1fa3afa0c..0831902c290 100644--- a/tests/proxy_admin_ui_tests/test_usage_endpoints.py+++ b/tests/proxy_admin_ui_tests/test_usage_endpoints.py@@ -14,7 +14,6 @@ For all tests - test the following:"""import os-import sysimport tracebackfrom litellm._uuid import uuidfrom datetime import datetime@@ -29,9 +28,6 @@ import time# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport loggingdiff --git a/tests/proxy_unit_tests/conftest.py b/tests/proxy_unit_tests/conftest.pyindex a0326f64ed7..148751c33f2 100644--- a/tests/proxy_unit_tests/conftest.py+++ b/tests/proxy_unit_tests/conftest.py@@ -3,15 +3,10 @@import asyncioimport copyimport inspect-import os-import sysimport warningsimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmimport litellm.proxy.proxy_serverdiff --git a/tests/proxy_unit_tests/test_aproxy_startup.py b/tests/proxy_unit_tests/test_aproxy_startup.pyindex 324a881a7c3..98bf6ef8eb7 100644--- a/tests/proxy_unit_tests/test_aproxy_startup.py+++ b/tests/proxy_unit_tests/test_aproxy_startup.py@@ -9,9 +9,6 @@ import io# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytest, logging, asyncioimport litellmfrom litellm.proxy.proxy_server import (diff --git a/tests/proxy_unit_tests/test_audit_logs_proxy.py b/tests/proxy_unit_tests/test_audit_logs_proxy.pyindex a5332213886..878e19f5b6f 100644--- a/tests/proxy_unit_tests/test_audit_logs_proxy.py+++ b/tests/proxy_unit_tests/test_audit_logs_proxy.py@@ -1,5 +1,4 @@import os-import sysimport tracebackfrom litellm._uuid import uuidfrom datetime import datetime@@ -14,9 +13,6 @@ import time# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport loggingdiff --git a/tests/proxy_unit_tests/test_auth_checks.py b/tests/proxy_unit_tests/test_auth_checks.pyindex 3dc39969024..d436c99cd20 100644--- a/tests/proxy_unit_tests/test_auth_checks.py+++ b/tests/proxy_unit_tests/test_auth_checks.py@@ -7,9 +7,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytest, litellmimport httpxfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/proxy_unit_tests/test_banned_keyword_list.py b/tests/proxy_unit_tests/test_banned_keyword_list.pyindex acf4bdbb8e0..35e625a6b9e 100644--- a/tests/proxy_unit_tests/test_banned_keyword_list.py+++ b/tests/proxy_unit_tests/test_banned_keyword_list.py@@ -9,9 +9,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmfrom litellm.proxy.enterprise.enterprise_hooks.banned_keywords import (diff --git a/tests/proxy_unit_tests/test_custom_callback_input.py b/tests/proxy_unit_tests/test_custom_callback_input.pyindex a032b8706bc..8b7a8a8973b 100644--- a/tests/proxy_unit_tests/test_custom_callback_input.py+++ b/tests/proxy_unit_tests/test_custom_callback_input.py@@ -3,8 +3,6 @@import asyncioimport inspectimport json-import os-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -13,7 +11,6 @@ from datetime import datetimeimport pytestfrom pydantic import BaseModel-sys.path.insert(0, os.path.abspath("../.."))from typing import List, Literal, Optional, Unionfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/proxy_unit_tests/test_default_end_user_budget_simple.py b/tests/proxy_unit_tests/test_default_end_user_budget_simple.pyindex 6170b0a972e..edd0409343a 100644--- a/tests/proxy_unit_tests/test_default_end_user_budget_simple.py+++ b/tests/proxy_unit_tests/test_default_end_user_budget_simple.py@@ -5,14 +5,11 @@ Tests the core scenarios where litellm.max_end_user_budget_id appliesa default budget to end users without explicit budgets."""-import sys-import osimport uuidfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy._types import LiteLLM_BudgetTable, LiteLLM_EndUserTablediff --git a/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py b/tests/proxy_unit_tests/test_e2e_pod_lock_manager.pyindex b1e5fd29cde..6fac731a60d 100644--- a/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py+++ b/tests/proxy_unit_tests/test_e2e_pod_lock_manager.py@@ -1,5 +1,4 @@import os-import sysimport tracebackfrom litellm._uuid import uuidfrom typing import List@@ -19,9 +18,6 @@ import fakeredis# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport loggingdiff --git a/tests/proxy_unit_tests/test_gemini_agents_endpoints.py b/tests/proxy_unit_tests/test_gemini_agents_endpoints.pyindex bdac9348f71..cddb0e526b4 100644--- a/tests/proxy_unit_tests/test_gemini_agents_endpoints.py+++ b/tests/proxy_unit_tests/test_gemini_agents_endpoints.py@@ -9,15 +9,12 @@ longer accepted — they would appear in server logs."""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi import Requestfrom fastapi.datastructures import Headers, QueryParams-sys.path.insert(0, os.path.abspath("../.."))from litellm.proxy.google_endpoints.agents_endpoints import (_merge_query_params_into_data,diff --git a/tests/proxy_unit_tests/test_get_favicon.py b/tests/proxy_unit_tests/test_get_favicon.pyindex ddc8b1230a7..ad18bc90a1e 100644--- a/tests/proxy_unit_tests/test_get_favicon.py+++ b/tests/proxy_unit_tests/test_get_favicon.py@@ -1,7 +1,5 @@import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import httpximport pytestdiff --git a/tests/proxy_unit_tests/test_get_image.py b/tests/proxy_unit_tests/test_get_image.pyindex 57e472f86c4..9b7f3da8a7b 100644--- a/tests/proxy_unit_tests/test_get_image.py+++ b/tests/proxy_unit_tests/test_get_image.py@@ -1,9 +1,6 @@-import os-import sysfrom unittest import mock# Standard path insertion-sys.path.insert(0, os.path.abspath("../.."))import httpximport pytestdiff --git a/tests/proxy_unit_tests/test_google_endpoint_routing.py b/tests/proxy_unit_tests/test_google_endpoint_routing.pyindex b978077c730..3dcfede92ea 100644--- a/tests/proxy_unit_tests/test_google_endpoint_routing.py+++ b/tests/proxy_unit_tests/test_google_endpoint_routing.py@@ -1,12 +1,10 @@import jsonimport os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestimport yaml-sys.path.insert(0, os.path.abspath("../.."))from litellm.proxy._types import UserAPIKeyAuthfrom litellm.proxy.google_endpoints.endpoints import google_generate_contentdiff --git a/tests/proxy_unit_tests/test_google_gemini_proxy_request.py b/tests/proxy_unit_tests/test_google_gemini_proxy_request.pyindex dbe30037313..6f8f90efc73 100644--- a/tests/proxy_unit_tests/test_google_gemini_proxy_request.py+++ b/tests/proxy_unit_tests/test_google_gemini_proxy_request.py@@ -8,8 +8,6 @@ The request payload is correctly processed and forwarded to the httpx client."""import json-import os-import sysimport unittest.mockfrom typing import Optionalfrom unittest.mock import AsyncMock, MagicMock, patch@@ -18,7 +16,6 @@ import httpximport pytest# Add the parent directory to the system path-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/proxy_unit_tests/test_jwt.py b/tests/proxy_unit_tests/test_jwt.pyindex abd91113f96..6ad253f33e8 100644--- a/tests/proxy_unit_tests/test_jwt.py+++ b/tests/proxy_unit_tests/test_jwt.py@@ -6,7 +6,6 @@ import base64import loggingimport osimport random-import sysimport timeimport tracebackfrom litellm._uuid import uuid@@ -15,9 +14,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom datetime import datetime, timedeltafrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/proxy_unit_tests/test_key_generate_prisma.py b/tests/proxy_unit_tests/test_key_generate_prisma.pyindex efedc156429..a3deeb46f6e 100644--- a/tests/proxy_unit_tests/test_key_generate_prisma.py+++ b/tests/proxy_unit_tests/test_key_generate_prisma.py@@ -21,7 +21,6 @@import osimport re-import sysimport tracebackfrom litellm._uuid import uuidfrom datetime import datetime, timezone@@ -38,9 +37,6 @@ import time# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport loggingdiff --git a/tests/proxy_unit_tests/test_prisma_client_backoff_retry.py b/tests/proxy_unit_tests/test_prisma_client_backoff_retry.pyindex b49bef3632d..8fe1c68da59 100644--- a/tests/proxy_unit_tests/test_prisma_client_backoff_retry.py+++ b/tests/proxy_unit_tests/test_prisma_client_backoff_retry.py@@ -11,10 +11,8 @@ import timefrom unittest.mock import AsyncMock, MagicMock, patch, callfrom unittest.mock import Mockimport sys-import os# Add project root to path-sys.path.insert(0, os.path.abspath("../.."))from litellm.proxy.utils import PrismaClient, ProxyLoggingfrom prisma.errors import PrismaError, ClientNotConnectedErrordiff --git a/tests/proxy_unit_tests/test_proxy_config_unit_test.py b/tests/proxy_unit_tests/test_proxy_config_unit_test.pyindex a567ad2b025..81648dc1158 100644--- a/tests/proxy_unit_tests/test_proxy_config_unit_test.py+++ b/tests/proxy_unit_tests/test_proxy_config_unit_test.py@@ -1,5 +1,4 @@import os-import sysimport tracebackfrom unittest import mockimport pytest@@ -14,7 +13,6 @@ import io# this file is to test litellm/proxy-sys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system pathimport asyncioimport loggingdiff --git a/tests/proxy_unit_tests/test_proxy_custom_auth.py b/tests/proxy_unit_tests/test_proxy_custom_auth.pyindex 0582cacb42d..b575e4c85c6 100644--- a/tests/proxy_unit_tests/test_proxy_custom_auth.py+++ b/tests/proxy_unit_tests/test_proxy_custom_auth.py@@ -1,5 +1,4 @@import os-import sysimport tracebackfrom dotenv import load_dotenv@@ -9,9 +8,6 @@ import io# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport pytestdiff --git a/tests/proxy_unit_tests/test_proxy_custom_logger.py b/tests/proxy_unit_tests/test_proxy_custom_logger.pyindex 20b9678c7fa..2516df2d58d 100644--- a/tests/proxy_unit_tests/test_proxy_custom_logger.py+++ b/tests/proxy_unit_tests/test_proxy_custom_logger.py@@ -7,9 +7,6 @@ import io, asyncio# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytest, timeimport litellmfrom litellm import embedding, completion, completion_cost, Timeoutdiff --git a/tests/proxy_unit_tests/test_proxy_encrypt_decrypt.py b/tests/proxy_unit_tests/test_proxy_encrypt_decrypt.pyindex 396a34e9b85..88ee64b6c4b 100644--- a/tests/proxy_unit_tests/test_proxy_encrypt_decrypt.py+++ b/tests/proxy_unit_tests/test_proxy_encrypt_decrypt.py@@ -1,5 +1,4 @@import os-import sysimport pytestfrom dotenv import load_dotenv@@ -7,9 +6,6 @@ from dotenv import load_dotenvload_dotenv()import io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds-the parent directory to the system pathfrom litellm.proxy import proxy_serverfrom litellm.proxy.common_utils.encrypt_decrypt_utils import (diff --git a/tests/proxy_unit_tests/test_proxy_exception_mapping.py b/tests/proxy_unit_tests/test_proxy_exception_mapping.pyindex e9884f8b269..efaaa181600 100644--- a/tests/proxy_unit_tests/test_proxy_exception_mapping.py+++ b/tests/proxy_unit_tests/test_proxy_exception_mapping.py@@ -2,7 +2,6 @@import jsonimport os-import sysfrom unittest import mockfrom dotenv import load_dotenv@@ -11,9 +10,6 @@ load_dotenv()import asyncioimport io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport openaiimport pytestfrom fastapi import Responsediff --git a/tests/proxy_unit_tests/test_proxy_pass_user_config.py b/tests/proxy_unit_tests/test_proxy_pass_user_config.pyindex 73998253f32..91911c142ea 100644--- a/tests/proxy_unit_tests/test_proxy_pass_user_config.py+++ b/tests/proxy_unit_tests/test_proxy_pass_user_config.py@@ -7,9 +7,6 @@ import io# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytest, logging, asyncioimport litellmfrom litellm import embedding, completion, completion_cost, Timeout@@ -24,7 +21,6 @@ logging.basicConfig(# test /chat/completion request to the proxyfrom fastapi.testclient import TestClientfrom fastapi import FastAPI-import osfrom litellm.proxy.proxy_server import (router,save_worker_config,diff --git a/tests/proxy_unit_tests/test_proxy_reject_logging.py b/tests/proxy_unit_tests/test_proxy_reject_logging.pyindex 440f2362276..eb5c5a52f0a 100644--- a/tests/proxy_unit_tests/test_proxy_reject_logging.py+++ b/tests/proxy_unit_tests/test_proxy_reject_logging.py@@ -5,12 +5,10 @@## This tests the llm guard integrationimport asyncio-import osimport random# What is this?## Unit test for presidio pii masking-import sysimport timeimport tracebackfrom datetime import datetime@@ -19,9 +17,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom typing import Literalimport pytestdiff --git a/tests/proxy_unit_tests/test_proxy_routes.py b/tests/proxy_unit_tests/test_proxy_routes.pyindex 9d9c02257c2..129a93ea08d 100644--- a/tests/proxy_unit_tests/test_proxy_routes.py+++ b/tests/proxy_unit_tests/test_proxy_routes.py@@ -1,5 +1,3 @@-import os-import sysfrom dotenv import load_dotenv@@ -8,9 +6,6 @@ import io# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport loggingdiff --git a/tests/proxy_unit_tests/test_proxy_server.py b/tests/proxy_unit_tests/test_proxy_server.pyindex bb8127a8b91..21dbf3e090f 100644--- a/tests/proxy_unit_tests/test_proxy_server.py+++ b/tests/proxy_unit_tests/test_proxy_server.py@@ -1,5 +1,4 @@import os-import sysimport tracebackfrom unittest import mock@@ -14,9 +13,6 @@ import json# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport loggingdiff --git a/tests/proxy_unit_tests/test_proxy_setting_guardrails.py b/tests/proxy_unit_tests/test_proxy_setting_guardrails.pyindex d16546249a4..71b7783f5ee 100644--- a/tests/proxy_unit_tests/test_proxy_setting_guardrails.py+++ b/tests/proxy_unit_tests/test_proxy_setting_guardrails.py@@ -1,6 +1,5 @@import jsonimport os-import sysfrom unittest import mockfrom dotenv import load_dotenv@@ -9,9 +8,6 @@ load_dotenv()import asyncioimport io-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport openaiimport pytestfrom fastapi import Responsediff --git a/tests/proxy_unit_tests/test_proxy_token_counter.py b/tests/proxy_unit_tests/test_proxy_token_counter.pyindex 1079a5228a1..39ec4bb1887 100644--- a/tests/proxy_unit_tests/test_proxy_token_counter.py+++ b/tests/proxy_unit_tests/test_proxy_token_counter.py@@ -5,7 +5,6 @@import jsonimport loggingimport os-import sysimport tempfilefrom unittest.mock import AsyncMock, MagicMock, patch@@ -17,9 +16,6 @@ load_dotenv()# this file is to test litellm/proxy-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom fastapi import HTTPException, Requestdiff --git a/tests/proxy_unit_tests/test_proxy_utils.py b/tests/proxy_unit_tests/test_proxy_utils.pyindex de2a9282300..3bde72ccd49 100644--- a/tests/proxy_unit_tests/test_proxy_utils.py+++ b/tests/proxy_unit_tests/test_proxy_utils.py@@ -1,7 +1,6 @@import asyncioimport jsonimport os-import sysfrom datetime import datetimefrom typing import Any, Dict, List, Optional, Unionfrom unittest.mock import Mock@@ -14,9 +13,6 @@ from litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.proxy.utils import _get_docs_url, _get_openapi_url, _get_redoc_urlfrom litellm.types.guardrails import GuardrailEventHooks-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, MagicMock, patchimport litellmdiff --git a/tests/proxy_unit_tests/test_response_polling_handler.py b/tests/proxy_unit_tests/test_response_polling_handler.pyindex 8d9c7a6a095..772d3622745 100644--- a/tests/proxy_unit_tests/test_response_polling_handler.py+++ b/tests/proxy_unit_tests/test_response_polling_handler.py@@ -15,15 +15,12 @@ following the OpenAI Response API format."""import json-import os-import sysfrom datetime import datetime, timezonefrom typing import Any, Dict, Optionalfrom unittest.mock import AsyncMock, Mock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.proxy.response_polling.polling_handler import ResponsePollingHandlerdiff --git a/tests/proxy_unit_tests/test_response_polling_pre_call_checks.py b/tests/proxy_unit_tests/test_response_polling_pre_call_checks.pyindex fe411b1d858..459834d0fd2 100644--- a/tests/proxy_unit_tests/test_response_polling_pre_call_checks.py+++ b/tests/proxy_unit_tests/test_response_polling_pre_call_checks.py@@ -6,14 +6,11 @@ BEFORE a polling ID is created, so rate-limited requests get asynchronous error instead of a polling ID that immediately fails."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi import HTTPException, Request, Response-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/proxy_unit_tests/test_search_api_logging.py b/tests/proxy_unit_tests/test_search_api_logging.pyindex 71bbe5351a2..5a833d37615 100644--- a/tests/proxy_unit_tests/test_search_api_logging.py+++ b/tests/proxy_unit_tests/test_search_api_logging.py@@ -8,14 +8,12 @@ model_group, spend, etc.)import asyncioimport os-import sysimport timefrom datetime import datetimefrom unittest.mock import AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import Routerfrom litellm.caching import DualCachediff --git a/tests/proxy_unit_tests/test_skills_db.py b/tests/proxy_unit_tests/test_skills_db.pyindex 9548e78d6ed..8eb07a5ad48 100644--- a/tests/proxy_unit_tests/test_skills_db.py+++ b/tests/proxy_unit_tests/test_skills_db.py@@ -10,7 +10,6 @@ Tests the SDK-level skills methods when using the LiteLLM database backend:"""import os-import sysimport zipfilefrom contextlib import contextmanagerfrom io import BytesIO@@ -18,7 +17,6 @@ from pathlib import Pathimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.caching.caching import DualCachediff --git a/tests/proxy_unit_tests/test_unit_test_max_model_budget_limiter.py b/tests/proxy_unit_tests/test_unit_test_max_model_budget_limiter.pyindex 8b5e6c5497b..3785ccdcfba 100644--- a/tests/proxy_unit_tests/test_unit_test_max_model_budget_limiter.py+++ b/tests/proxy_unit_tests/test_unit_test_max_model_budget_limiter.py@@ -1,8 +1,5 @@-import os-import sysfrom unittest.mock import AsyncMock, patch-sys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system-pathimport pytestdiff --git a/tests/proxy_unit_tests/test_unit_test_proxy_hooks.py b/tests/proxy_unit_tests/test_unit_test_proxy_hooks.pyindex 492b4803af4..e6ffea35e52 100644--- a/tests/proxy_unit_tests/test_unit_test_proxy_hooks.py+++ b/tests/proxy_unit_tests/test_unit_test_proxy_hooks.py@@ -1,13 +1,10 @@import asyncio-import os-import sysfrom unittest.mock import Mock, patch, AsyncMockimport pytestfrom fastapi import Requestfrom litellm.proxy.utils import _get_redoc_url, _get_docs_urlfrom datetime import datetime-sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/proxy_unit_tests/test_update_spend.py b/tests/proxy_unit_tests/test_update_spend.pyindex 2df381c8190..a28a78cc4a1 100644--- a/tests/proxy_unit_tests/test_update_spend.py+++ b/tests/proxy_unit_tests/test_update_spend.py@@ -1,15 +1,10 @@import asyncio-import os-import sysfrom unittest.mock import Mockfrom litellm.proxy.utils import _get_redoc_url, _get_docs_urlimport pytestfrom fastapi import Request-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom unittest.mock import MagicMock, patch, AsyncMockdiff --git a/tests/proxy_unit_tests/test_user_api_key_auth.py b/tests/proxy_unit_tests/test_user_api_key_auth.pyindex 49ec29d3ac5..cc7de71aa56 100644--- a/tests/proxy_unit_tests/test_user_api_key_auth.py+++ b/tests/proxy_unit_tests/test_user_api_key_auth.py@@ -1,13 +1,10 @@# What is this?## Unit tests for user_api_key_auth helper functions-import os-import sysimport litellm.proxyimport litellm.proxy.proxy_server-sys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system pathfrom typing import Dict, List, Optionalfrom unittest.mock import MagicMock, patch, AsyncMockdiff --git a/tests/router_unit_tests/conftest.py b/tests/router_unit_tests/conftest.pyindex c759f9fa74c..cca1028aec7 100644--- a/tests/router_unit_tests/conftest.py+++ b/tests/router_unit_tests/conftest.py@@ -2,14 +2,9 @@import asyncioimport importlib-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm # noqa: E402,F401from tests._vcr_conftest_common import ( # noqa: E402,F401@@ -44,9 +39,6 @@ def setup_and_teardown():"""This fixture reloads litellm before every function. To speed up testing by removing callbacks being chained."""- sys.path.insert(- 0, os.path.abspath("../..")- ) # Adds the project directory to the system pathfrom litellm.litellm_core_utils.logging_worker import GLOBAL_LOGGING_WORKERdiff --git a/tests/router_unit_tests/create_mock_standard_logging_payload.py b/tests/router_unit_tests/create_mock_standard_logging_payload.pyindex 106328e95e2..096c8ff8c60 100644--- a/tests/router_unit_tests/create_mock_standard_logging_payload.py+++ b/tests/router_unit_tests/create_mock_standard_logging_payload.py@@ -1,9 +1,6 @@import io-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport gzipdiff --git a/tests/router_unit_tests/test_completion_no_copy.py b/tests/router_unit_tests/test_completion_no_copy.pyindex 28f40779496..ef157d3b903 100644--- a/tests/router_unit_tests/test_completion_no_copy.py+++ b/tests/router_unit_tests/test_completion_no_copy.py@@ -5,11 +5,8 @@ Verifies that spreading deployment["litellm_params"] directly (without copy)doesn't cause side effects that mutate the deployment in router.model_list."""-import sys-import osimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm import Routerfrom unittest.mock import AsyncMock, Mock, patchdiff --git a/tests/router_unit_tests/test_default_deployment_copy.py b/tests/router_unit_tests/test_default_deployment_copy.pyindex 90401479308..3cb9c3683d6 100644--- a/tests/router_unit_tests/test_default_deployment_copy.py+++ b/tests/router_unit_tests/test_default_deployment_copy.py@@ -5,10 +5,7 @@ Tests the critical side effect: ensure modifying returned deploymentdoesn't corrupt the original default_deployment instance."""-import sys-import os-sys.path.insert(0, os.path.abspath("../.."))from litellm import Routerdiff --git a/tests/router_unit_tests/test_prompt_management_check.py b/tests/router_unit_tests/test_prompt_management_check.pyindex 81c6c6f0138..313ba2c3340 100644--- a/tests/router_unit_tests/test_prompt_management_check.py+++ b/tests/router_unit_tests/test_prompt_management_check.py@@ -5,10 +5,7 @@ Verifies that the early return for models without "/" doesn't breakprompt management model detection."""-import sys-import os-sys.path.insert(0, os.path.abspath("../.."))from litellm import Routerdiff --git a/tests/router_unit_tests/test_router_acancel_batch.py b/tests/router_unit_tests/test_router_acancel_batch.pyindex 016da592e94..c15658d5d14 100644--- a/tests/router_unit_tests/test_router_acancel_batch.py+++ b/tests/router_unit_tests/test_router_acancel_batch.py@@ -4,10 +4,7 @@ Test router.acancel_batch() functionalityThis ensures the router's batch cancellation method has test coverage."""-import sys-import os-sys.path.insert(0, os.path.abspath("../.."))import pytestfrom unittest.mock import patch, AsyncMock, MagicMockdiff --git a/tests/router_unit_tests/test_router_adding_deployments.py b/tests/router_unit_tests/test_router_adding_deployments.pyindex 6200cc6ebcc..dfbaf1257c6 100644--- a/tests/router_unit_tests/test_router_adding_deployments.py+++ b/tests/router_unit_tests/test_router_adding_deployments.py@@ -1,9 +1,6 @@import sys, osimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm import Routerfrom litellm.router import Deployment, LiteLLM_Paramsfrom unittest.mock import patchdiff --git a/tests/router_unit_tests/test_router_aresponses_streaming_fallback.py b/tests/router_unit_tests/test_router_aresponses_streaming_fallback.pyindex 17124a94a8f..ee4750e9db8 100644--- a/tests/router_unit_tests/test_router_aresponses_streaming_fallback.py+++ b/tests/router_unit_tests/test_router_aresponses_streaming_fallback.py@@ -10,14 +10,11 @@ Targets the four helpers introduced on Router:- _aresponses_streaming_iterator"""-import os-import sysfrom typing import Any, AsyncIterator, Listfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm import Routerfrom litellm.types.llms.openai import (diff --git a/tests/router_unit_tests/test_router_batch_utils.py b/tests/router_unit_tests/test_router_batch_utils.pyindex b8760906645..c9f19731372 100644--- a/tests/router_unit_tests/test_router_batch_utils.py+++ b/tests/router_unit_tests/test_router_batch_utils.py@@ -1,9 +1,4 @@-import sys-import os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport jsondiff --git a/tests/router_unit_tests/test_router_cooldown_utils.py b/tests/router_unit_tests/test_router_cooldown_utils.pyindex a51b0dc21af..242709708e3 100644--- a/tests/router_unit_tests/test_router_cooldown_utils.py+++ b/tests/router_unit_tests/test_router_cooldown_utils.py@@ -2,9 +2,6 @@ import sys, os, timeimport traceback, asyncioimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import Routerfrom litellm.router import Deployment, LiteLLM_Paramsdiff --git a/tests/router_unit_tests/test_router_embedding_headers.py b/tests/router_unit_tests/test_router_embedding_headers.pyindex 5bf98243dcc..738f09e6ece 100644--- a/tests/router_unit_tests/test_router_embedding_headers.py+++ b/tests/router_unit_tests/test_router_embedding_headers.py@@ -9,13 +9,10 @@ just like router.completion() does, which properly sets up metadata and allowsdefault_litellm_params (including headers) to be propagated."""-import os-import sysfrom unittest.mock import MagicMock, patch, AsyncMockimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm import Routerdiff --git a/tests/router_unit_tests/test_router_embedding_integration.py b/tests/router_unit_tests/test_router_embedding_integration.pyindex 6f5781336eb..75dacbaf08e 100644--- a/tests/router_unit_tests/test_router_embedding_integration.py+++ b/tests/router_unit_tests/test_router_embedding_integration.py@@ -5,13 +5,10 @@ These tests simulate real-world scenarios where headers and configurationneed to be properly propagated through the router to the LLM API."""-import os-import sysfrom unittest.mock import MagicMock, patch, AsyncMockimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm import Routerdiff --git a/tests/router_unit_tests/test_router_endpoints.py b/tests/router_unit_tests/test_router_endpoints.pyindex 658ad4f3b5c..d37af5b456a 100644--- a/tests/router_unit_tests/test_router_endpoints.py+++ b/tests/router_unit_tests/test_router_endpoints.py@@ -1,4 +1,3 @@-import sysimport osimport jsonimport traceback@@ -8,9 +7,6 @@ from fastapi import Requestfrom datetime import datetimefrom unittest.mock import AsyncMock, patch, MagicMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm import Router, CustomLoggerfrom litellm.types.utils import StandardLoggingPayloaddiff --git a/tests/router_unit_tests/test_router_handle_error.py b/tests/router_unit_tests/test_router_handle_error.pyindex a84c90ccb78..6b57efc7f37 100644--- a/tests/router_unit_tests/test_router_handle_error.py+++ b/tests/router_unit_tests/test_router_handle_error.py@@ -3,9 +3,6 @@ import traceback, asyncioimport pytestfrom typing import List-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import Routerfrom litellm.router import Deployment, LiteLLM_Paramsdiff --git a/tests/router_unit_tests/test_router_helper_utils.py b/tests/router_unit_tests/test_router_helper_utils.pyindex 82bdbd7bfc9..dcd2e9edf7b 100644--- a/tests/router_unit_tests/test_router_helper_utils.py+++ b/tests/router_unit_tests/test_router_helper_utils.py@@ -1,13 +1,9 @@-import sysimport osimport tracebackfrom dotenv import load_dotenvfrom fastapi import Requestfrom datetime import datetime-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm import Routerimport pytestimport litellmdiff --git a/tests/router_unit_tests/test_router_index_management.py b/tests/router_unit_tests/test_router_index_management.pyindex 3f0a185e8bf..87ddaadaf3d 100644--- a/tests/router_unit_tests/test_router_index_management.py+++ b/tests/router_unit_tests/test_router_index_management.py@@ -1,11 +1,7 @@-import sysimport osimport pytestimport ast-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm import Routerdiff --git a/tests/router_unit_tests/test_router_prompt_caching.py b/tests/router_unit_tests/test_router_prompt_caching.pyindex 574eccda162..5c36c30e818 100644--- a/tests/router_unit_tests/test_router_prompt_caching.py+++ b/tests/router_unit_tests/test_router_prompt_caching.py@@ -1,14 +1,9 @@-import sys-import osimport tracebackimport asynciofrom dotenv import load_dotenvfrom fastapi import Requestfrom datetime import datetime-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm import Routerimport pytestimport litellmdiff --git a/tests/search_tests/conftest.py b/tests/search_tests/conftest.pyindex 78ba19a7724..deef6527a8f 100644--- a/tests/search_tests/conftest.py+++ b/tests/search_tests/conftest.py@@ -6,12 +6,9 @@# are replayed for 24h. See tests/llm_translation/Readme.md for the# design overview.-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))from tests._vcr_conftest_common import ( # noqa: E402,F401VerboseReporterState,diff --git a/tests/search_tests/test_duckduckgo_search.py b/tests/search_tests/test_duckduckgo_search.pyindex 635e26e1c0c..69d19edded7 100644--- a/tests/search_tests/test_duckduckgo_search.py+++ b/tests/search_tests/test_duckduckgo_search.py@@ -3,11 +3,9 @@ Tests for DuckDuckGo Search API integration."""import os-import sysimport pytestfrom unittest.mock import AsyncMock, patch, MagicMock-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom tests.search_tests.base_search_unit_tests import BaseSearchTestdiff --git a/tests/search_tests/test_google_pse_search.py b/tests/search_tests/test_google_pse_search.pyindex 21d58a95491..12b1a714709 100644--- a/tests/search_tests/test_google_pse_search.py+++ b/tests/search_tests/test_google_pse_search.py@@ -2,11 +2,8 @@Tests for Google Programmable Search Engine (PSE) API integration."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))from tests.search_tests.base_search_unit_tests import BaseSearchTestdiff --git a/tests/search_tests/test_linkup_search.py b/tests/search_tests/test_linkup_search.pyindex 5e1fe4ddd9b..ab9bffc5633 100644--- a/tests/search_tests/test_linkup_search.py+++ b/tests/search_tests/test_linkup_search.py@@ -3,11 +3,9 @@ Tests for Linkup Search API integration."""import os-import sysimport pytestfrom unittest.mock import Mock, patch-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom tests.search_tests.base_search_unit_tests import BaseSearchTestdiff --git a/tests/search_tests/test_nimble_search.py b/tests/search_tests/test_nimble_search.pyindex c83b7236a09..df432f8ae84 100644--- a/tests/search_tests/test_nimble_search.py+++ b/tests/search_tests/test_nimble_search.py@@ -3,13 +3,10 @@ Tests for Nimble Search API integration."""import json-import os-import sysfrom unittest.mock import AsyncMock, Mock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom tests.search_tests.base_search_unit_tests import BaseSearchTestdiff --git a/tests/search_tests/test_perplexity_search.py b/tests/search_tests/test_perplexity_search.pyindex c9e09ed404e..e1189a71355 100644--- a/tests/search_tests/test_perplexity_search.py+++ b/tests/search_tests/test_perplexity_search.py@@ -3,10 +3,8 @@ Tests for Perplexity Search API integration."""import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))from tests.search_tests.base_search_unit_tests import BaseSearchTestdiff --git a/tests/search_tests/test_search_tool_name_filtering.py b/tests/search_tests/test_search_tool_name_filtering.pyindex 5424582a90c..902e95c7a4b 100644--- a/tests/search_tests/test_search_tool_name_filtering.py+++ b/tests/search_tests/test_search_tool_name_filtering.py@@ -6,10 +6,7 @@ which search tool configuration to use, but should not be sent to externalsearch provider APIs."""-import sys-import os-sys.path.insert(0, os.path.abspath("../.."))from litellm.types.utils import all_litellm_paramsfrom litellm.utils import filter_out_litellm_paramsdiff --git a/tests/search_tests/test_searchapi_search.py b/tests/search_tests/test_searchapi_search.pyindex d16868502a4..58ba6aa018a 100644--- a/tests/search_tests/test_searchapi_search.py+++ b/tests/search_tests/test_searchapi_search.py@@ -10,13 +10,11 @@ Tests the SearchAPI.io search provider implementation including:import jsonimport os-import sysfrom unittest.mock import MagicMock, Mock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.llms.searchapi.search.transformation import SearchAPIConfigfrom litellm.llms.base_llm.search.transformation import SearchResponse, SearchResultdiff --git a/tests/search_tests/test_serper_search.py b/tests/search_tests/test_serper_search.pyindex 99aae0f64e6..02e9d734443 100644--- a/tests/search_tests/test_serper_search.py+++ b/tests/search_tests/test_serper_search.py@@ -3,11 +3,9 @@ Tests for Serper Search API integration."""import os-import sysimport pytestfrom unittest.mock import AsyncMock, patch, MagicMock-sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/search_tests/test_tavily_search.py b/tests/search_tests/test_tavily_search.pyindex a737685916c..4a5338deadb 100644--- a/tests/search_tests/test_tavily_search.py+++ b/tests/search_tests/test_tavily_search.py@@ -3,11 +3,9 @@ Tests for Tavily Search API integration."""import os-import sysimport pytestfrom unittest.mock import AsyncMock, patch, MagicMock-sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/test_keys.py b/tests/test_keys.pyindex 2d8ff2232a1..e39c715de03 100644--- a/tests/test_keys.py+++ b/tests/test_keys.py@@ -8,9 +8,6 @@ from openai import AsyncOpenAIimport sys, osfrom typing import Optional-sys.path.insert(- 0, os.path.abspath("../")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy._types import LitellmUserRolesdiff --git a/tests/test_litellm/a2a_protocol/providers/pydantic_ai_agents/test_pydantic_ai_agent_transformation.py b/tests/test_litellm/a2a_protocol/providers/pydantic_ai_agents/test_pydantic_ai_agent_transformation.pyindex 717a7c902b5..c5626afa954 100644--- a/tests/test_litellm/a2a_protocol/providers/pydantic_ai_agents/test_pydantic_ai_agent_transformation.py+++ b/tests/test_litellm/a2a_protocol/providers/pydantic_ai_agents/test_pydantic_ai_agent_transformation.py@@ -4,12 +4,9 @@ Tests for Pydantic AI agents transformation.Tests the helper functions and response transformation without making real API calls."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.a2a_protocol.providers.pydantic_ai_agents.transformation import (PydanticAITransformation,diff --git a/tests/test_litellm/a2a_protocol/providers/watsonx_orchestrate/test_watsonx_orchestrate_transformation.py b/tests/test_litellm/a2a_protocol/providers/watsonx_orchestrate/test_watsonx_orchestrate_transformation.pyindex 7968eed4146..43dfdaba02d 100644--- a/tests/test_litellm/a2a_protocol/providers/watsonx_orchestrate/test_watsonx_orchestrate_transformation.py+++ b/tests/test_litellm/a2a_protocol/providers/watsonx_orchestrate/test_watsonx_orchestrate_transformation.py@@ -1,14 +1,11 @@import asyncioimport json-import os-import sysimport timefrom pathlib import Pathimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.a2a_protocol.providers.config_manager import A2AProviderConfigManagerfrom litellm.a2a_protocol.providers.watsonx_orchestrate import handler as wxo_handlerdiff --git a/tests/test_litellm/batches/test_batch_utils.py b/tests/test_litellm/batches/test_batch_utils.pyindex 08cdf945b80..41b4bb8cf76 100644--- a/tests/test_litellm/batches/test_batch_utils.py+++ b/tests/test_litellm/batches/test_batch_utils.py@@ -16,15 +16,12 @@ deterministic stand-ins so the arithmetic under test is the only variable.import jsonimport logging-import os-import sysfrom types import MappingProxyTypeimport httpximport pytestimport respx-sys.path.insert(0, os.path.abspath("../../../.."))import litellmimport litellm.batches.batch_utils as budiff --git a/tests/test_litellm/batches/test_main.py b/tests/test_litellm/batches/test_main.pyindex 17e9ee29d4d..c3edb40c819 100644--- a/tests/test_litellm/batches/test_main.py+++ b/tests/test_litellm/batches/test_main.py@@ -23,8 +23,6 @@ production. Provider env vars are not required: missing creds resolve to None anflow through harmlessly because the handler is mocked."""-import os-import sysfrom contextlib import ExitStackfrom dataclasses import dataclassfrom typing import Any, Dict@@ -33,7 +31,6 @@ from unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmimport litellm.batches.main as bmdiff --git a/tests/test_litellm/caching/test_azure_blob_cache.py b/tests/test_litellm/caching/test_azure_blob_cache.pyindex c5c85e1551d..63f4681fd06 100644--- a/tests/test_litellm/caching/test_azure_blob_cache.py+++ b/tests/test_litellm/caching/test_azure_blob_cache.py@@ -1,13 +1,8 @@-import os-import sysfrom unittest.mock import MagicMock, patch, AsyncMockimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.caching.azure_blob_cache import AzureBlobCachediff --git a/tests/test_litellm/caching/test_caching_handler.py b/tests/test_litellm/caching/test_caching_handler.pyindex 9684e82f550..6c60aa6e220 100644--- a/tests/test_litellm/caching/test_caching_handler.py+++ b/tests/test_litellm/caching/test_caching_handler.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysimport timefrom unittest.mock import MagicMock, patch@@ -10,9 +8,6 @@ import pytestimport respxfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom datetime import datetimefrom unittest.mock import AsyncMockdiff --git a/tests/test_litellm/caching/test_embedding_router.py b/tests/test_litellm/caching/test_embedding_router.pyindex 9ebe669d32d..00a80c63303 100644--- a/tests/test_litellm/caching/test_embedding_router.py+++ b/tests/test_litellm/caching/test_embedding_router.py@@ -1,8 +1,5 @@-import os-import sysfrom unittest.mock import MagicMock-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.caching._embedding_router import (diff --git a/tests/test_litellm/caching/test_gcs_cache.py b/tests/test_litellm/caching/test_gcs_cache.pyindex 40bfa447d63..6222cf4760a 100644--- a/tests/test_litellm/caching/test_gcs_cache.py+++ b/tests/test_litellm/caching/test_gcs_cache.py@@ -1,10 +1,7 @@-import os-import sysfrom unittest.mock import MagicMock, AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.caching.gcs_cache import GCSCachediff --git a/tests/test_litellm/caching/test_in_memory_cache.py b/tests/test_litellm/caching/test_in_memory_cache.pyindex 7be03d23fbe..85e8308ae91 100644--- a/tests/test_litellm/caching/test_in_memory_cache.py+++ b/tests/test_litellm/caching/test_in_memory_cache.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysimport threadingimport timefrom concurrent.futures import ThreadPoolExecutor@@ -12,9 +10,6 @@ import pytestimport respxfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMockfrom litellm.caching.in_memory_cache import InMemoryCachediff --git a/tests/test_litellm/caching/test_llm_caching_handler.py b/tests/test_litellm/caching/test_llm_caching_handler.pyindex 5f0e82dbb80..dd81b877c0e 100644--- a/tests/test_litellm/caching/test_llm_caching_handler.py+++ b/tests/test_litellm/caching/test_llm_caching_handler.py@@ -9,15 +9,10 @@ See: https://github.com/BerriAI/litellm/pull/22247"""import asyncio-import os-import sysimport warningsimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.caching.evicted_client_closer import EvictedClientCloserfrom litellm.caching.llm_caching_handler import LLMClientCachediff --git a/tests/test_litellm/caching/test_qdrant_semantic_cache.py b/tests/test_litellm/caching/test_qdrant_semantic_cache.pyindex a5fbaf151ca..e07578dd7e5 100644--- a/tests/test_litellm/caching/test_qdrant_semantic_cache.py+++ b/tests/test_litellm/caching/test_qdrant_semantic_cache.py@@ -1,13 +1,9 @@-import osimport sysimport typesfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathdef test_qdrant_semantic_cache_initialization(monkeypatch):diff --git a/tests/test_litellm/caching/test_redis_cache.py b/tests/test_litellm/caching/test_redis_cache.pyindex 6a76decd5b1..decf59130fe 100644--- a/tests/test_litellm/caching/test_redis_cache.py+++ b/tests/test_litellm/caching/test_redis_cache.py@@ -1,13 +1,8 @@import asyncio-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMockfrom litellm.caching.redis_cache import RedisCachediff --git a/tests/test_litellm/caching/test_redis_cluster_cache.py b/tests/test_litellm/caching/test_redis_cluster_cache.pyindex 26878865187..372425aa9fa 100644--- a/tests/test_litellm/caching/test_redis_cluster_cache.py+++ b/tests/test_litellm/caching/test_redis_cluster_cache.py@@ -1,14 +1,9 @@import json-import os-import sysfrom unittest.mock import MagicMock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.caching.redis_cache import RedisCachefrom litellm.caching.redis_cluster_cache import RedisClusterCachediff --git a/tests/test_litellm/caching/test_redis_semantic_cache.py b/tests/test_litellm/caching/test_redis_semantic_cache.pyindex 66271579d31..be4367fd8bd 100644--- a/tests/test_litellm/caching/test_redis_semantic_cache.py+++ b/tests/test_litellm/caching/test_redis_semantic_cache.py@@ -1,12 +1,8 @@-import osimport sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system path# Tests for RedisSemanticCache@@ -893,7 +889,6 @@ async def test_redis_semantic_cache_async_paths_set_similarity_on_misses():def test_redis_get_embedding_routes_through_router(monkeypatch):- import sysimport typesfrom litellm.caching.redis_semantic_cache import RedisSemanticCache@@ -928,7 +923,6 @@ def test_redis_get_embedding_routes_through_router(monkeypatch):def test_redis_get_embedding_falls_back_to_direct(monkeypatch):- import sysimport typesfrom litellm.caching.redis_semantic_cache import RedisSemanticCache@@ -1138,7 +1132,6 @@ def test_redis_sync_get_cache_passes_precomputed_vector():@pytest.mark.asyncioasync def test_redis_async_embedding_forwards_full_metadata(monkeypatch):- import sysimport typesfrom litellm.caching.redis_semantic_cache import RedisSemanticCache@@ -1169,7 +1162,6 @@ LONG_PROMPT = " ".join(f"token{i}" for i in range(300))def _proxy_with_router(monkeypatch: pytest.MonkeyPatch, router: MagicMock, model_name: str) -> None:- import sysimport typesfake_proxy = types.ModuleType("litellm.proxy.proxy_server")@@ -1223,7 +1215,6 @@ async def test_redis_async_embedding_explicit_limit_beats_deployment_limit(monkedef test_redis_get_embedding_truncates_direct_path_with_explicit_limit(monkeypatch):- import sysimport typesfrom litellm.caching.redis_semantic_cache import RedisSemanticCache@@ -1342,7 +1333,6 @@ def _router_proxy_module(router, model_name):def test_redis_sync_embedding_call_is_bounded(monkeypatch):- import sysfrom litellm.caching.redis_semantic_cache import RedisSemanticCache@@ -1366,7 +1356,6 @@ def test_redis_sync_embedding_call_is_bounded(monkeypatch):@pytest.mark.asyncioasync def test_redis_async_embedding_call_is_bounded(monkeypatch):- import sysfrom litellm.caching.redis_semantic_cache import RedisSemanticCache@@ -1391,7 +1380,6 @@ async def test_redis_async_embedding_call_is_bounded(monkeypatch):@pytest.mark.asyncioasync def test_redis_async_embedding_gives_up_on_unresponsive_endpoint(monkeypatch):import asyncio- import sysimport timefrom litellm.caching.redis_semantic_cache import RedisSemanticCache@@ -1422,7 +1410,6 @@ async def test_redis_async_embedding_gives_up_on_unresponsive_endpoint(monkeypat@pytest.mark.asyncioasync def test_redis_async_get_cache_fails_open_when_embedding_hangs(monkeypatch):import asyncio- import sysimport timefrom litellm.caching.redis_semantic_cache import RedisSemanticCachediff --git a/tests/test_litellm/caching/test_s3_cache.py b/tests/test_litellm/caching/test_s3_cache.pyindex 795511c5bc2..f9a0b165e12 100644--- a/tests/test_litellm/caching/test_s3_cache.py+++ b/tests/test_litellm/caching/test_s3_cache.py@@ -1,5 +1,3 @@-import os-import sysfrom unittest.mock import MagicMock, patchimport jsonimport datetime@@ -7,9 +5,6 @@ import asyncioimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.caching.s3_cache import S3Cachediff --git a/tests/test_litellm/caching/test_valkey_semantic_cache.py b/tests/test_litellm/caching/test_valkey_semantic_cache.pyindex acf5a914e5c..749658784ac 100644--- a/tests/test_litellm/caching/test_valkey_semantic_cache.py+++ b/tests/test_litellm/caching/test_valkey_semantic_cache.py@@ -9,7 +9,6 @@ from unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.caching.valkey_semantic_cache import ValkeySemanticCachediff --git a/tests/test_litellm/completion_extras/litellm_responses_transformation/test_completion_extras_litellm_responses_transformation_handler.py b/tests/test_litellm/completion_extras/litellm_responses_transformation/test_completion_extras_litellm_responses_transformation_handler.pyindex 42b5ba235bc..c5d7ca96a21 100644--- a/tests/test_litellm/completion_extras/litellm_responses_transformation/test_completion_extras_litellm_responses_transformation_handler.py+++ b/tests/test_litellm/completion_extras/litellm_responses_transformation/test_completion_extras_litellm_responses_transformation_handler.py@@ -1,11 +1,8 @@-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.completion_extras.litellm_responses_transformation.handler import (diff --git a/tests/test_litellm/completion_extras/litellm_responses_transformation/test_completion_extras_litellm_responses_transformation_transformation.py b/tests/test_litellm/completion_extras/litellm_responses_transformation/test_completion_extras_litellm_responses_transformation_transformation.pyindex 858ca482eb7..4ff92aaf87d 100644--- a/tests/test_litellm/completion_extras/litellm_responses_transformation/test_completion_extras_litellm_responses_transformation_transformation.py+++ b/tests/test_litellm/completion_extras/litellm_responses_transformation/test_completion_extras_litellm_responses_transformation_transformation.py@@ -1,7 +1,6 @@import datetimeimport jsonimport os-import sysimport unittestfrom typing import TYPE_CHECKING, List, Literal, Optional, Tuplefrom unittest.mock import ANY, MagicMock, Mock, patch@@ -9,9 +8,6 @@ from unittest.mock import ANY, MagicMock, Mock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system-pathimport litellmfrom litellm.completion_extras.litellm_responses_transformation.transformation import (LiteLLMResponsesTransformationHandler,@@ -1518,7 +1514,6 @@ def test_map_reasoning_effort_adds_summary_detailed(monkeypatch):When flag is enabled (flag=True or env var), summary="detailed" is added."""- import osimport litellmfrom litellm.completion_extras.litellm_responses_transformation.transformation import (diff --git a/tests/test_litellm/conftest.py b/tests/test_litellm/conftest.pyindex ceb491e3d11..1fe73b552da 100644--- a/tests/test_litellm/conftest.py+++ b/tests/test_litellm/conftest.py@@ -9,13 +9,9 @@import importlibimport os-import sysfrom pathlib import Pathimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport asyncioimport litellm@@ -462,7 +458,6 @@ def setup_and_teardown():Use this sparingly - most state should be handled by isolate_litellm_state.Only reload modules here if absolutely necessary."""- sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/test_litellm/containers/test_azure_container_transformation.py b/tests/test_litellm/containers/test_azure_container_transformation.pyindex cdcccf7c04e..1c990220e11 100644--- a/tests/test_litellm/containers/test_azure_container_transformation.py+++ b/tests/test_litellm/containers/test_azure_container_transformation.py@@ -1,12 +1,9 @@-import os-import sysfrom unittest.mock import AsyncMock, MagicMockfrom urllib.parse import parse_qs, urlparseimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../"))import litellmfrom litellm.llms.azure.containers.transformation import AzureContainerConfigdiff --git a/tests/test_litellm/containers/test_container_api.py b/tests/test_litellm/containers/test_container_api.pyindex de6fd1bc8ce..885c4cd294a 100644--- a/tests/test_litellm/containers/test_container_api.py+++ b/tests/test_litellm/containers/test_container_api.py@@ -1,15 +1,10 @@import asyncioimport json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.containers.main import (diff --git a/tests/test_litellm/containers/test_container_integration.py b/tests/test_litellm/containers/test_container_integration.pyindex 062d0359f60..6c3a876fc45 100644--- a/tests/test_litellm/containers/test_container_integration.py+++ b/tests/test_litellm/containers/test_container_integration.py@@ -1,14 +1,10 @@import jsonimport os-import sysfrom unittest.mock import MagicMock, patchimport pytestimport httpx-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.types.containers.main import (diff --git a/tests/test_litellm/containers/test_container_regional_api_base.py b/tests/test_litellm/containers/test_container_regional_api_base.pyindex d450d7f9cf0..055f7d4b166 100644--- a/tests/test_litellm/containers/test_container_regional_api_base.py+++ b/tests/test_litellm/containers/test_container_regional_api_base.py@@ -7,13 +7,11 @@ US Data Residency instead of defaulting to https://api.openai.com/v1."""import os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmdiff --git a/tests/test_litellm/containers/test_container_transformation.py b/tests/test_litellm/containers/test_container_transformation.pyindex f0432816fce..8bc3ffda544 100644--- a/tests/test_litellm/containers/test_container_transformation.py+++ b/tests/test_litellm/containers/test_container_transformation.py@@ -1,14 +1,10 @@import jsonimport os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.openai.containers.transformation import OpenAIContainerConfigdiff --git a/tests/test_litellm/containers/test_container_utils.py b/tests/test_litellm/containers/test_container_utils.pyindex 35e9ed36916..a81d1263d6b 100644--- a/tests/test_litellm/containers/test_container_utils.py+++ b/tests/test_litellm/containers/test_container_utils.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.containers.utils import (diff --git a/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_base_email.py b/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_base_email.pyindex 61303340570..8b89c592f02 100644--- a/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_base_email.py+++ b/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_base_email.py@@ -1,7 +1,6 @@import asyncioimport jsonimport os-import sysimport unittest.mock as mockfrom unittest.mock import patch@@ -13,7 +12,6 @@ from litellm_enterprise.enterprise_callbacks.send_emails.base_email import (BaseEmailLogger,)-sys.path.insert(0, os.path.abspath("../../.."))from litellm_enterprise.types.enterprise_callbacks.send_emails import (EmailEvent,SendKeyCreatedEmailEvent,diff --git a/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_endpoints.py b/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_endpoints.pyindex d1e8f37184a..f0e1461c616 100644--- a/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_endpoints.py+++ b/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_endpoints.py@@ -1,13 +1,10 @@import json-import os-import sysimport unittest.mock as mockimport pytestfrom fastapi import HTTPExceptionfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../.."))from litellm_enterprise.enterprise_callbacks.send_emails.endpoints import (_get_email_settings,diff --git a/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_resend_email.py b/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_resend_email.pyindex fbfd609cca6..6bf77ac2d28 100644--- a/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_resend_email.py+++ b/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_resend_email.py@@ -1,11 +1,9 @@import os-import sysimport unittest.mock as mockimport pytestfrom httpx import Response-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm_enterprise.enterprise_callbacks.send_emails.resend_email import (diff --git a/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_sendgrid_email.py b/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_sendgrid_email.pyindex b7fcce8dbf3..465a03cfff7 100644--- a/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_sendgrid_email.py+++ b/tests/test_litellm/enterprise/enterprise_callbacks/send_emails/test_sendgrid_email.py@@ -1,11 +1,9 @@import os-import sysimport unittest.mock as mockimport pytestfrom httpx import Response-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm_enterprise.enterprise_callbacks.send_emails.sendgrid_email import (diff --git a/tests/test_litellm/experimental_mcp_client/test_mcp_client.py b/tests/test_litellm/experimental_mcp_client/test_mcp_client.pyindex 1ddb2cc1c8d..51fdfa4ce31 100644--- a/tests/test_litellm/experimental_mcp_client/test_mcp_client.py+++ b/tests/test_litellm/experimental_mcp_client/test_mcp_client.py@@ -21,7 +21,6 @@ from mcp.types import ()# Add the parent directory to the path so we can import litellm-sys.path.insert(0, "../../../")import litellm.experimental_mcp_client.client as mcp_client_modulefrom litellm.experimental_mcp_client.client import (diff --git a/tests/test_litellm/experimental_mcp_client/test_tools.py b/tests/test_litellm/experimental_mcp_client/test_tools.pyindex 804e99b6f4e..89f67452f29 100644--- a/tests/test_litellm/experimental_mcp_client/test_tools.py+++ b/tests/test_litellm/experimental_mcp_client/test_tools.py@@ -1,13 +1,8 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom mcp.types import (CallToolRequestParams,diff --git a/tests/test_litellm/google_genai/test_google_genai_adapter.py b/tests/test_litellm/google_genai/test_google_genai_adapter.pyindex 8f5f4d41f3c..81834451859 100644--- a/tests/test_litellm/google_genai/test_google_genai_adapter.py+++ b/tests/test_litellm/google_genai/test_google_genai_adapter.py@@ -3,20 +3,13 @@Test to verify the Google GenAI generate_content adapter functionality"""import json-import os-import sysimport unittestimport pytestfrom litellm.google_genai.main import agenerate_content-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system path-import os-import sysimport litellmdiff --git a/tests/test_litellm/google_genai/test_google_genai_adapter_fixes.py b/tests/test_litellm/google_genai/test_google_genai_adapter_fixes.pyindex 36022dcb5db..8ea9dcfb990 100644--- a/tests/test_litellm/google_genai/test_google_genai_adapter_fixes.py+++ b/tests/test_litellm/google_genai/test_google_genai_adapter_fixes.py@@ -3,16 +3,11 @@Test to verify the Google GenAI adapter fixes"""import json-import os-import sysimport unittestfrom unittest.mock import patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.google_genai.adapters.handler import GenerateContentToCompletionHandlerdiff --git a/tests/test_litellm/google_genai/test_google_genai_handler.py b/tests/test_litellm/google_genai/test_google_genai_handler.pyindex 0dc218d297b..bf037c59854 100644--- a/tests/test_litellm/google_genai/test_google_genai_handler.py+++ b/tests/test_litellm/google_genai/test_google_genai_handler.py@@ -3,15 +3,10 @@Test to verify the Google GenAI generate_content handler functionality"""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.google_genai.adapters.handler import GenerateContentToCompletionHandlerdiff --git a/tests/test_litellm/google_genai/test_google_genai_main.py b/tests/test_litellm/google_genai/test_google_genai_main.pyindex 8441b62e559..238fff7deca 100644--- a/tests/test_litellm/google_genai/test_google_genai_main.py+++ b/tests/test_litellm/google_genai/test_google_genai_main.py@@ -4,17 +4,10 @@ Test to verify the Google GenAI generate_content adapter functionality"""import json-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system path-import os-import sysimport litellmdiff --git a/tests/test_litellm/google_genai/test_google_genai_transformation.py b/tests/test_litellm/google_genai/test_google_genai_transformation.pyindex 6b0cd500a82..f0d0fc6126d 100644--- a/tests/test_litellm/google_genai/test_google_genai_transformation.py+++ b/tests/test_litellm/google_genai/test_google_genai_transformation.py@@ -2,12 +2,7 @@"""Test to verify the Google GenAI transformation logic for generateContent parameters"""-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport pytestdiff --git a/tests/test_litellm/images/test_image_generation_extra_headers.py b/tests/test_litellm/images/test_image_generation_extra_headers.pyindex a6e5031c7db..a65bdeb892b 100644--- a/tests/test_litellm/images/test_image_generation_extra_headers.py+++ b/tests/test_litellm/images/test_image_generation_extra_headers.py@@ -6,13 +6,10 @@ to the OpenAI SDK on the openai/litellm_proxy/openai_compatible_providerscode paths."""-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.images.main import image_generationdiff --git a/tests/test_litellm/integrations/SlackAlerting/test_hanging_request_check.py b/tests/test_litellm/integrations/SlackAlerting/test_hanging_request_check.pyindex 063aabd309b..4b579dfe82f 100644--- a/tests/test_litellm/integrations/SlackAlerting/test_hanging_request_check.py+++ b/tests/test_litellm/integrations/SlackAlerting/test_hanging_request_check.py@@ -1,6 +1,4 @@import json-import os-import sysimport timefrom typing import Optionalfrom unittest.mock import AsyncMock, MagicMock, patch@@ -8,7 +6,6 @@ from unittest.mock import AsyncMock, MagicMock, patchimport pytest# Adds the grandparent directory to sys.path to allow importing project modules-sys.path.insert(0, os.path.abspath("../.."))from litellm.integrations.SlackAlerting.hanging_request_check import (AlertingHangingRequestCheck,diff --git a/tests/test_litellm/integrations/SlackAlerting/test_model_deprecation_alert.py b/tests/test_litellm/integrations/SlackAlerting/test_model_deprecation_alert.pyindex fd54d26c1f6..997e80b45df 100644--- a/tests/test_litellm/integrations/SlackAlerting/test_model_deprecation_alert.py+++ b/tests/test_litellm/integrations/SlackAlerting/test_model_deprecation_alert.py@@ -1,14 +1,11 @@"""Tests for the Slack alerting model deprecation hook."""import asyncio-import os-import sysfrom itertools import chain, repeatfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.constants import SLACK_MODEL_DEPRECATION_LOCK_IDdiff --git a/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting.py b/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting.pyindex 23a35098697..cfbd3e76a88 100644--- a/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting.py+++ b/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting.py@@ -1,8 +1,6 @@import asyncioimport datetimeimport json-import os-import sysimport timeimport unittestfrom typing import Final, List, Optional, Tuple@@ -10,7 +8,6 @@ from unittest.mock import ANY, AsyncMock, MagicMock, Mock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system-pathimport litellmfrom litellm.caching.caching import DualCachefrom litellm.integrations.SlackAlerting.slack_alerting import SlackAlertingdiff --git a/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting_digest.py b/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting_digest.pyindex b3fee1f045b..edce5c5f3a2 100644--- a/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting_digest.py+++ b/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting_digest.py@@ -10,11 +10,9 @@ Verifies that:"""import os-import sysimport unittestfrom datetime import datetime, timedelta-sys.path.insert(0, os.path.abspath("../../.."))from litellm.integrations.SlackAlerting.slack_alerting import SlackAlertingfrom litellm.proxy._types import AlertTypediff --git a/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting_utils.py b/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting_utils.pyindex 027fed1b5ff..403cd51701d 100644--- a/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting_utils.py+++ b/tests/test_litellm/integrations/SlackAlerting/test_slack_alerting_utils.py@@ -1,13 +1,10 @@import json-import os-import sysfrom typing import Optionalfrom unittest.mock import MagicMockimport pytest# Adds the grandparent directory to sys.path to allow importing project modules-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.integrations.langfuse.langfuse_prompt_management import (diff --git a/tests/test_litellm/integrations/arize/test_arize.py b/tests/test_litellm/integrations/arize/test_arize.pyindex 1ca3349eeb7..cdafd856b49 100644--- a/tests/test_litellm/integrations/arize/test_arize.py+++ b/tests/test_litellm/integrations/arize/test_arize.py@@ -1,11 +1,8 @@import json-import os-import sysfrom typing import Optionalfrom unittest.mock import MagicMock, Mock, patch# Adds the grandparent directory to sys.path to allow importing project modules-sys.path.insert(0, os.path.abspath("../.."))import asynciodiff --git a/tests/test_litellm/integrations/arize/test_arize_health_check.py b/tests/test_litellm/integrations/arize/test_arize_health_check.pyindex 3f10e9dcbd7..f7364dc27eb 100644--- a/tests/test_litellm/integrations/arize/test_arize_health_check.py+++ b/tests/test_litellm/integrations/arize/test_arize_health_check.py@@ -4,11 +4,9 @@ Test Arize health check functionality and proxy integration.import jsonimport os-import sysfrom unittest.mock import patch, MagicMock# Adds the grandparent directory to sys.path to allow importing project modules-sys.path.insert(0, os.path.abspath("../.."))import asyncioimport pytestdiff --git a/tests/test_litellm/integrations/arize/test_arize_utils.py b/tests/test_litellm/integrations/arize/test_arize_utils.pyindex b02fe35cad0..50f2823d632 100644--- a/tests/test_litellm/integrations/arize/test_arize_utils.py+++ b/tests/test_litellm/integrations/arize/test_arize_utils.py@@ -1,10 +1,7 @@import json-import os-import sysfrom typing import Optional# Adds the grandparent directory to sys.path to allow importing project modules-sys.path.insert(0, os.path.abspath("../.."))import asynciodiff --git a/tests/test_litellm/integrations/azure_storage/test_azure_storage.py b/tests/test_litellm/integrations/azure_storage/test_azure_storage.pyindex 5d7c55e81af..16c518ff412 100644--- a/tests/test_litellm/integrations/azure_storage/test_azure_storage.py+++ b/tests/test_litellm/integrations/azure_storage/test_azure_storage.py@@ -1,12 +1,8 @@-import osimport sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.integrations.azure_storage.azure_storage import AzureBlobStorageLoggerfrom litellm.types.utils import StandardLoggingPayloaddiff --git a/tests/test_litellm/integrations/bitbucket/test_bitbucket_integration.py b/tests/test_litellm/integrations/bitbucket/test_bitbucket_integration.pyindex 142be536f6b..955821f66e0 100644--- a/tests/test_litellm/integrations/bitbucket/test_bitbucket_integration.py+++ b/tests/test_litellm/integrations/bitbucket/test_bitbucket_integration.py@@ -1,13 +1,8 @@import json-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.integrations.bitbucket import BitBucketPromptManagerdiff --git a/tests/test_litellm/integrations/bitbucket/test_bitbucket_prompt_manager.py b/tests/test_litellm/integrations/bitbucket/test_bitbucket_prompt_manager.pyindex 4a15da87c89..d6668bf9ad8 100644--- a/tests/test_litellm/integrations/bitbucket/test_bitbucket_prompt_manager.py+++ b/tests/test_litellm/integrations/bitbucket/test_bitbucket_prompt_manager.py@@ -1,14 +1,9 @@import json-import osimport re-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.integrations.bitbucket.bitbucket_client import BitBucketClientfrom litellm.integrations.bitbucket.bitbucket_prompt_manager import (diff --git a/tests/test_litellm/integrations/cloudzero/test_cz_stream_api.py b/tests/test_litellm/integrations/cloudzero/test_cz_stream_api.pyindex a715116e5ee..1a95e45b2d5 100644--- a/tests/test_litellm/integrations/cloudzero/test_cz_stream_api.py+++ b/tests/test_litellm/integrations/cloudzero/test_cz_stream_api.py@@ -1,5 +1,3 @@-import os-import sysimport zoneinfofrom datetime import datetime, timezonefrom unittest.mock import MagicMock, Mock, patch@@ -8,7 +6,6 @@ import httpximport polars as plimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.integrations.cloudzero.cz_stream_api import CloudZeroStreamerdiff --git a/tests/test_litellm/integrations/cloudzero/test_dry_run_endpoint.py b/tests/test_litellm/integrations/cloudzero/test_dry_run_endpoint.pyindex c5f377aa09b..795692f2cdf 100644--- a/tests/test_litellm/integrations/cloudzero/test_dry_run_endpoint.py+++ b/tests/test_litellm/integrations/cloudzero/test_dry_run_endpoint.py@@ -2,14 +2,11 @@Test the CloudZero dry run endpoint functionality"""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport polars as plimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.integrations.cloudzero.cloudzero import CloudZeroLoggerdiff --git a/tests/test_litellm/integrations/cloudzero/test_transform.py b/tests/test_litellm/integrations/cloudzero/test_transform.pyindex 416eacdc63a..3ec2fe6779e 100644--- a/tests/test_litellm/integrations/cloudzero/test_transform.py+++ b/tests/test_litellm/integrations/cloudzero/test_transform.py@@ -1,12 +1,9 @@-import os-import sysfrom datetime import datetimefrom unittest.mock import MagicMock, patchimport polars as plimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.integrations.cloudzero.transform import CBFTransformerfrom litellm.types.integrations.cloudzero import CBFRecorddiff --git a/tests/test_litellm/integrations/datadog/test_datadog_tags_regression.py b/tests/test_litellm/integrations/datadog/test_datadog_tags_regression.pyindex 624995085aa..110ac75e73b 100644--- a/tests/test_litellm/integrations/datadog/test_datadog_tags_regression.py+++ b/tests/test_litellm/integrations/datadog/test_datadog_tags_regression.py@@ -1,11 +1,9 @@import datetimeimport os-import sysfrom unittest.mock import patchimport pytest-sys.path.insert(0, os.path.abspath("../../../"))from litellm.integrations.datadog.datadog import DataDogLoggerfrom litellm.integrations.datadog.datadog_handler import get_datadog_tags, normalize_datadog_tag_valuediff --git a/tests/test_litellm/integrations/dotprompt/test_prompt_manager.py b/tests/test_litellm/integrations/dotprompt/test_prompt_manager.pyindex d849582b3c4..b92ed13302e 100644--- a/tests/test_litellm/integrations/dotprompt/test_prompt_manager.py+++ b/tests/test_litellm/integrations/dotprompt/test_prompt_manager.py@@ -1,15 +1,10 @@import json-import os-import sysimport tempfilefrom pathlib import Pathimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, Mock, patchdiff --git a/tests/test_litellm/integrations/gcs_pubsub/test_pub_sub.py b/tests/test_litellm/integrations/gcs_pubsub/test_pub_sub.pyindex 7ff28bfe831..3c7f577d1d8 100644--- a/tests/test_litellm/integrations/gcs_pubsub/test_pub_sub.py+++ b/tests/test_litellm/integrations/gcs_pubsub/test_pub_sub.py@@ -1,7 +1,6 @@import datetimeimport jsonimport os-import sysimport unittestfrom typing import List, Optional, Tuplefrom unittest.mock import ANY, MagicMock, Mock, patch@@ -9,9 +8,6 @@ from unittest.mock import ANY, MagicMock, Mock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system-pathimport litellmdiff --git a/tests/test_litellm/integrations/gitlab/test_gitlab_client.py b/tests/test_litellm/integrations/gitlab/test_gitlab_client.pyindex 529868ca06a..d6f588c4965 100644--- a/tests/test_litellm/integrations/gitlab/test_gitlab_client.py+++ b/tests/test_litellm/integrations/gitlab/test_gitlab_client.py@@ -1,13 +1,8 @@import base64import json-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.integrations.gitlab.gitlab_client import GitLabClientdiff --git a/tests/test_litellm/integrations/gitlab/test_gitlab_integration.py b/tests/test_litellm/integrations/gitlab/test_gitlab_integration.pyindex 8118af56b0e..7d5b490fea4 100644--- a/tests/test_litellm/integrations/gitlab/test_gitlab_integration.py+++ b/tests/test_litellm/integrations/gitlab/test_gitlab_integration.py@@ -1,12 +1,7 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchfrom litellm.integrations.gitlab.gitlab_prompt_manager import GitLabPromptManagerdiff --git a/tests/test_litellm/integrations/gitlab/test_gitlab_prompt_manager.py b/tests/test_litellm/integrations/gitlab/test_gitlab_prompt_manager.pyindex adccd94141f..120cc877b51 100644--- a/tests/test_litellm/integrations/gitlab/test_gitlab_prompt_manager.py+++ b/tests/test_litellm/integrations/gitlab/test_gitlab_prompt_manager.py@@ -1,13 +1,8 @@-import osimport re-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.integrations.gitlab.gitlab_client import GitLabClientfrom litellm.integrations.gitlab.gitlab_prompt_manager import (diff --git a/tests/test_litellm/integrations/open_telemetry/conftest.py b/tests/test_litellm/integrations/open_telemetry/conftest.pyindex b29335aedd8..367e9fba07f 100644--- a/tests/test_litellm/integrations/open_telemetry/conftest.py+++ b/tests/test_litellm/integrations/open_telemetry/conftest.py@@ -11,8 +11,6 @@ emitter in isolation.See ``LIT-3193_test_matrix.md`` (same directory) for the cell list."""-import os-import sysfrom datetime import datetimefrom typing import Optional, Tuplefrom unittest.mock import MagicMock@@ -24,7 +22,6 @@ from opentelemetry.sdk.trace.export.in_memory_span_exporter import (InMemorySpanExporter,)-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.integrations.opentelemetry import OpenTelemetrydiff --git a/tests/test_litellm/integrations/otel/test_otel_v2_dynamic.py b/tests/test_litellm/integrations/otel/test_otel_v2_dynamic.pyindex ca62253aa2f..a9a78dcb2f1 100644--- a/tests/test_litellm/integrations/otel/test_otel_v2_dynamic.py+++ b/tests/test_litellm/integrations/otel/test_otel_v2_dynamic.py@@ -1,10 +1,7 @@"""Per-request multi-tenant credential routing (V1 parity)."""import base64-import os-import sys-sys.path.insert(0, os.path.abspath("../../../.."))from opentelemetry.trace import NoOpTracerdiff --git a/tests/test_litellm/integrations/otel/test_otel_v2_mount.py b/tests/test_litellm/integrations/otel/test_otel_v2_mount.pyindex 7240d49d022..0cd71db4ae1 100644--- a/tests/test_litellm/integrations/otel/test_otel_v2_mount.py+++ b/tests/test_litellm/integrations/otel/test_otel_v2_mount.py@@ -4,12 +4,9 @@surface and the server-span + shared-provider behavior it produces."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))pytest.importorskip("opentelemetry")pytest.importorskip("opentelemetry.instrumentation.fastapi")diff --git a/tests/test_litellm/integrations/test_agentops.py b/tests/test_litellm/integrations/test_agentops.pyindex 85ee34a0d8c..5d4055ac75f 100644--- a/tests/test_litellm/integrations/test_agentops.py+++ b/tests/test_litellm/integrations/test_agentops.py@@ -1,12 +1,8 @@import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom litellm.integrations.agentops.agentops import AgentOps, AgentOpsConfigdiff --git a/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py b/tests/test_litellm/integrations/test_anthropic_cache_control_hook.pyindex 8fb83a17296..b6e063a6d94 100644--- a/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py+++ b/tests/test_litellm/integrations/test_anthropic_cache_control_hook.py@@ -12,7 +12,6 @@ from unittest.mock import ANY, MagicMock, Mock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system-pathimport litellmfrom litellm.integrations.anthropic_cache_control_hook import (AnthropicCacheControlHook,diff --git a/tests/test_litellm/integrations/test_athina.py b/tests/test_litellm/integrations/test_athina.pyindex 49d8fc693e7..4f64f26db9a 100644--- a/tests/test_litellm/integrations/test_athina.py+++ b/tests/test_litellm/integrations/test_athina.py@@ -1,13 +1,8 @@import datetimeimport json-import os-import sysimport unittestfrom unittest.mock import ANY, MagicMock, patch-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathfrom litellm.integrations.athina import AthinaLoggerdiff --git a/tests/test_litellm/integrations/test_custom_prompt_management.py b/tests/test_litellm/integrations/test_custom_prompt_management.pyindex 7d5d02bf4b6..0bf2063a98d 100644--- a/tests/test_litellm/integrations/test_custom_prompt_management.py+++ b/tests/test_litellm/integrations/test_custom_prompt_management.py@@ -1,7 +1,5 @@import datetimeimport json-import os-import sysimport unittestfrom typing import List, Optional, Tuplefrom unittest.mock import ANY, MagicMock, Mock, patch@@ -9,9 +7,6 @@ from unittest.mock import ANY, MagicMock, Mock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system-pathimport litellmfrom litellm.integrations.custom_prompt_management import CustomPromptManagementfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandlerdiff --git a/tests/test_litellm/integrations/test_galileo.py b/tests/test_litellm/integrations/test_galileo.pyindex 8905795bbc6..d0709b966d4 100644--- a/tests/test_litellm/integrations/test_galileo.py+++ b/tests/test_litellm/integrations/test_galileo.py@@ -1,11 +1,8 @@-import os-import sysfrom datetime import datetime, timezonefrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.integrations.galileo import GalileoObservefrom litellm.types.llms.openai import HttpxBinaryResponseContent, ResponsesAPIResponsediff --git a/tests/test_litellm/integrations/test_helicone.py b/tests/test_litellm/integrations/test_helicone.pyindex da07fa1a9bf..64960de050a 100644--- a/tests/test_litellm/integrations/test_helicone.py+++ b/tests/test_litellm/integrations/test_helicone.py@@ -1,8 +1,6 @@-import osimport sysimport types-sys.path.insert(0, os.path.abspath("../../.."))from litellm.integrations.helicone import HeliconeLoggerdiff --git a/tests/test_litellm/integrations/test_langfuse.py b/tests/test_litellm/integrations/test_langfuse.pyindex 73a62e5594d..747f733a46d 100644--- a/tests/test_litellm/integrations/test_langfuse.py+++ b/tests/test_litellm/integrations/test_langfuse.py@@ -1,6 +1,5 @@import datetimeimport json-import osimport sysimport typesimport unittest@@ -13,7 +12,6 @@ import litellmfrom litellm.integrations.langfuse import langfuse as langfuse_modulefrom litellm.integrations.langfuse.langfuse import LangFuseLogger-sys.path.insert(0, os.path.abspath("../.."))# Import LangfuseUsageDetails directly from the module where it's definedfrom litellm.types.integrations.langfuse import *diff --git a/tests/test_litellm/integrations/test_langsmith_init.py b/tests/test_litellm/integrations/test_langsmith_init.pyindex 129dda4abde..d3393ac3d28 100644--- a/tests/test_litellm/integrations/test_langsmith_init.py+++ b/tests/test_litellm/integrations/test_langsmith_init.py@@ -1,10 +1,8 @@import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.integrations.langsmith import LangsmithLoggerdiff --git a/tests/test_litellm/integrations/test_lunary.py b/tests/test_litellm/integrations/test_lunary.pyindex 0a1ec100594..6491f5c8b82 100644--- a/tests/test_litellm/integrations/test_lunary.py+++ b/tests/test_litellm/integrations/test_lunary.py@@ -1,7 +1,4 @@-import os-import sys-sys.path.insert(0, os.path.abspath("../../.."))from litellm.integrations.lunary import parse_tool_callsfrom litellm.types.utils import (diff --git a/tests/test_litellm/integrations/test_mlflow.py b/tests/test_litellm/integrations/test_mlflow.pyindex 32358641984..61010f8531c 100644--- a/tests/test_litellm/integrations/test_mlflow.py+++ b/tests/test_litellm/integrations/test_mlflow.py@@ -1,12 +1,9 @@import asyncioimport json-import os-import sysfrom datetime import datetimefrom unittest.mock import MagicMock, patch# Adds the grandparent directory to sys.path to allow importing project modules-sys.path.insert(0, os.path.abspath("../.."))import pytestdiff --git a/tests/test_litellm/integrations/test_opentelemetry.py b/tests/test_litellm/integrations/test_opentelemetry.pyindex a5ad3d771e3..229214bf1e1 100644--- a/tests/test_litellm/integrations/test_opentelemetry.py+++ b/tests/test_litellm/integrations/test_opentelemetry.py@@ -14,7 +14,6 @@ from parameterized import parameterizedfrom unittest.mock import MagicMock, patch# Adds the grandparent directory to sys.path to allow importing project modules-sys.path.insert(0, os.path.abspath("../.."))from opentelemetry import tracefrom opentelemetry.sdk._logs import LoggerProvider as OTLoggerProviderfrom opentelemetry.sdk._logs.export import InMemoryLogExporter, SimpleLogRecordProcessordiff --git a/tests/test_litellm/integrations/test_otel_guardrail_violation_spans.py b/tests/test_litellm/integrations/test_otel_guardrail_violation_spans.pyindex c3e9d67ddad..16d77fe38a5 100644--- a/tests/test_litellm/integrations/test_otel_guardrail_violation_spans.py+++ b/tests/test_litellm/integrations/test_otel_guardrail_violation_spans.py@@ -24,8 +24,6 @@ real ``OpenTelemetry`` integration. No monkey patching of the integrationunder test — only the OTEL exporter is in-memory."""-import os-import sysimport timeimport unittestfrom datetime import datetime, timedelta, timezone@@ -35,7 +33,6 @@ from opentelemetry.sdk.trace.export import SimpleSpanProcessorfrom opentelemetry.sdk.trace.export.in_memory_span_exporter import InMemorySpanExporterfrom opentelemetry.trace import StatusCode-sys.path.insert(0, os.path.abspath("../.."))from litellm.integrations.opentelemetry import (LITELLM_REQUEST_SPAN_NAME,diff --git a/tests/test_litellm/integrations/test_otel_team_attributes_matrix.py b/tests/test_litellm/integrations/test_otel_team_attributes_matrix.pyindex 1ce55fa7a58..daf7d0fdaf0 100644--- a/tests/test_litellm/integrations/test_otel_team_attributes_matrix.py+++ b/tests/test_litellm/integrations/test_otel_team_attributes_matrix.py@@ -31,8 +31,6 @@ Strategy"""import asyncio-import os-import sysimport unittestfrom datetime import datetimefrom unittest.mock import MagicMock@@ -43,7 +41,6 @@ from opentelemetry.sdk.trace.export.in_memory_span_exporter import (InMemorySpanExporter,)-sys.path.insert(0, os.path.abspath("../.."))from litellm.integrations.opentelemetry import (LITELLM_PROXY_REQUEST_SPAN_NAME,diff --git a/tests/test_litellm/integrations/test_prometheus_invalid_key_filtering.py b/tests/test_litellm/integrations/test_prometheus_invalid_key_filtering.pyindex 5dbe487ab0a..278a4ef1df6 100644--- a/tests/test_litellm/integrations/test_prometheus_invalid_key_filtering.py+++ b/tests/test_litellm/integrations/test_prometheus_invalid_key_filtering.py@@ -5,14 +5,11 @@ Tests functionality that prevents invalid API key requests (401 status codes)from being recorded in Prometheus metrics."""-import os-import sysfrom unittest.mock import Mock, patchimport pytestfrom prometheus_client import REGISTRY-sys.path.insert(0, os.path.abspath("../../.."))from litellm.integrations.prometheus import PrometheusLoggerfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/test_litellm/integrations/test_prometheus_none_metadata.py b/tests/test_litellm/integrations/test_prometheus_none_metadata.pyindex fff2e48bf5a..c2d4c831609 100644--- a/tests/test_litellm/integrations/test_prometheus_none_metadata.py+++ b/tests/test_litellm/integrations/test_prometheus_none_metadata.py@@ -6,14 +6,11 @@ can be None, causing AttributeError: 'NoneType' object has no attribute 'get'in set_llm_deployment_success_metrics."""-import os-import sysfrom datetime import datetimeimport pytestfrom prometheus_client import REGISTRY-sys.path.insert(0, os.path.abspath("../../.."))from litellm.integrations.prometheus import PrometheusLoggerfrom litellm.types.integrations.prometheus import UserAPIKeyLabelValuesdiff --git a/tests/test_litellm/integrations/test_prometheus_remaining_tokens_router_fallback.py b/tests/test_litellm/integrations/test_prometheus_remaining_tokens_router_fallback.pyindex d754de86569..45b378d10fe 100644--- a/tests/test_litellm/integrations/test_prometheus_remaining_tokens_router_fallback.py+++ b/tests/test_litellm/integrations/test_prometheus_remaining_tokens_router_fallback.py@@ -20,14 +20,11 @@ Tests cover:- llm_router unavailable / model_group missing / router raises → silent no-op."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom prometheus_client import REGISTRY-sys.path.insert(0, os.path.abspath("../../.."))from litellm.integrations.prometheus import PrometheusLoggerfrom litellm.types.integrations.prometheus import UserAPIKeyLabelValuesdiff --git a/tests/test_litellm/integrations/test_prometheus_services.py b/tests/test_litellm/integrations/test_prometheus_services.pyindex 2efd226dc9d..2303061ede8 100644--- a/tests/test_litellm/integrations/test_prometheus_services.py+++ b/tests/test_litellm/integrations/test_prometheus_services.py@@ -1,6 +1,4 @@import json-import os-import sysimport timefrom unittest.mock import AsyncMock, patch@@ -13,9 +11,6 @@ from litellm.integrations.prometheus_services import (ServiceTypes,)-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathdef test_is_metric_registered_does_not_use_registry_collect():diff --git a/tests/test_litellm/interactions/test_agents_http_handler.py b/tests/test_litellm/interactions/test_agents_http_handler.pyindex 6947503e0bb..31b78d7a360 100644--- a/tests/test_litellm/interactions/test_agents_http_handler.py+++ b/tests/test_litellm/interactions/test_agents_http_handler.py@@ -8,14 +8,11 @@ branches, error mapping, and pre/post logging hooks.No real HTTP traffic is made."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.interactions.agents.http_handler import (AgentsHTTPHandler,diff --git a/tests/test_litellm/interactions/test_agents_main_and_utils.py b/tests/test_litellm/interactions/test_agents_main_and_utils.pyindex f5523cf1cf8..395801ff059 100644--- a/tests/test_litellm/interactions/test_agents_main_and_utils.py+++ b/tests/test_litellm/interactions/test_agents_main_and_utils.py@@ -9,13 +9,10 @@ small helper utilities without touching the network."""import asyncio-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.interactions.agents import (diff --git a/tests/test_litellm/interactions/test_gemini_interactions_transformation.py b/tests/test_litellm/interactions/test_gemini_interactions_transformation.pyindex 05b0bde16bb..d9b7cc790e6 100644--- a/tests/test_litellm/interactions/test_gemini_interactions_transformation.py+++ b/tests/test_litellm/interactions/test_gemini_interactions_transformation.py@@ -8,13 +8,10 @@ Covers:- transform_request: response_mime_type coalescing, image_config migration"""-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.interactions.litellm_responses_transformation.streaming_iterator import (diff --git a/tests/test_litellm/interactions/test_google_interactions_integration.py b/tests/test_litellm/interactions/test_google_interactions_integration.pyindex 49cd978c683..93429d64789 100644--- a/tests/test_litellm/interactions/test_google_interactions_integration.py+++ b/tests/test_litellm/interactions/test_google_interactions_integration.py@@ -10,11 +10,9 @@ Run with: pytest tests/test_litellm/interactions/test_google_interactions_integrimport asyncioimport os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmimport litellm.interactions as interactionsdiff --git a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking.py b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking.pyindex a5128228742..9bdded94513 100644--- a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking.py+++ b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking.py@@ -1,5 +1,4 @@import os-import sysimport pytest@@ -10,9 +9,6 @@ from litellm.litellm_core_utils.llm_cost_calc.tool_call_cost_tracking import (from litellm.types.llms.openai import FileSearchTool, WebSearchOptionsfrom litellm.types.utils import ModelResponse, StandardBuiltInToolsParams-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathdiff --git a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking_dict_safety.py b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking_dict_safety.pyindex 4eee6b59d34..61b94139bb8 100644--- a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking_dict_safety.py+++ b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking_dict_safety.py@@ -5,12 +5,9 @@ either a ``dict`` or a ``ServerToolUse`` pydantic instance.See https://github.com/BerriAI/litellm/issues/26153."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.litellm_core_utils.llm_cost_calc.tool_call_cost_tracking import (StandardBuiltInToolCostTracking,diff --git a/tests/test_litellm/litellm_core_utils/llm_response_utils/test_convert_dict_to_response.py b/tests/test_litellm/litellm_core_utils/llm_response_utils/test_convert_dict_to_response.pyindex 293e5de304f..304d732c518 100644--- a/tests/test_litellm/litellm_core_utils/llm_response_utils/test_convert_dict_to_response.py+++ b/tests/test_litellm/litellm_core_utils/llm_response_utils/test_convert_dict_to_response.py@@ -1,7 +1,4 @@-import os-import sys-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.constants import RESPONSE_FORMAT_TOOL_NAMEfrom litellm.litellm_core_utils.llm_response_utils.convert_dict_to_response import (diff --git a/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py b/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.pyindex f9311497729..44fa8fc8ae0 100644--- a/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py+++ b/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py@@ -1,13 +1,9 @@import jsonimport os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.prompt_templates.common_utils import (TOOL_RESULT_IMAGE_BOUNDARY,diff --git a/tests/test_litellm/litellm_core_utils/specialty_caches/test_dynamic_logging_cache.py b/tests/test_litellm/litellm_core_utils/specialty_caches/test_dynamic_logging_cache.pyindex f21cd56750b..5ed9dca68fd 100644--- a/tests/test_litellm/litellm_core_utils/specialty_caches/test_dynamic_logging_cache.py+++ b/tests/test_litellm/litellm_core_utils/specialty_caches/test_dynamic_logging_cache.py@@ -1,14 +1,9 @@import json-import os-import sysimport timefrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.litellm_core_utils.specialty_caches.dynamic_logging_cache import (diff --git a/tests/test_litellm/litellm_core_utils/test_anthropic_dedup_factory.py b/tests/test_litellm/litellm_core_utils/test_anthropic_dedup_factory.pyindex df1458b0f95..bafca04ad38 100644--- a/tests/test_litellm/litellm_core_utils/test_anthropic_dedup_factory.py+++ b/tests/test_litellm/litellm_core_utils/test_anthropic_dedup_factory.py@@ -1,8 +1,5 @@-import sys-import osimport pytest-sys.path.insert(0, os.path.abspath("."))from litellm.litellm_core_utils.prompt_templates.factory import anthropic_messages_ptdiff --git a/tests/test_litellm/litellm_core_utils/test_bedrock_converse_dedup_factory.py b/tests/test_litellm/litellm_core_utils/test_bedrock_converse_dedup_factory.pyindex c32917efe87..73fa1a07d63 100644--- a/tests/test_litellm/litellm_core_utils/test_bedrock_converse_dedup_factory.py+++ b/tests/test_litellm/litellm_core_utils/test_bedrock_converse_dedup_factory.py@@ -1,8 +1,5 @@-import sys-import osimport pytest-sys.path.insert(0, os.path.abspath("."))from litellm.litellm_core_utils.prompt_templates.factory import (_bedrock_converse_messages_pt,diff --git a/tests/test_litellm/litellm_core_utils/test_chat_completion_agentic_loop.py b/tests/test_litellm/litellm_core_utils/test_chat_completion_agentic_loop.pyindex cc16ad558e4..434daab6ab5 100644--- a/tests/test_litellm/litellm_core_utils/test_chat_completion_agentic_loop.py+++ b/tests/test_litellm/litellm_core_utils/test_chat_completion_agentic_loop.py@@ -20,14 +20,11 @@ removed, so `test_internal_control_fields_never_leak_into_provider_body` provesthey stay out of the body even without it."""-import os-import sysfrom typing import Any, Dict, List, Optional, Tuplefrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.integrations.custom_logger import CustomLoggerdiff --git a/tests/test_litellm/litellm_core_utils/test_dd_tracing.py b/tests/test_litellm/litellm_core_utils/test_dd_tracing.pyindex 455ad033afd..b55ade5225d 100644--- a/tests/test_litellm/litellm_core_utils/test_dd_tracing.py+++ b/tests/test_litellm/litellm_core_utils/test_dd_tracing.py@@ -1,13 +1,8 @@import json-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.dd_tracing import (_should_use_dd_profiler,diff --git a/tests/test_litellm/litellm_core_utils/test_exception_mapping_utils.py b/tests/test_litellm/litellm_core_utils/test_exception_mapping_utils.pyindex 38f46b26eea..cc0a52247a4 100644--- a/tests/test_litellm/litellm_core_utils/test_exception_mapping_utils.py+++ b/tests/test_litellm/litellm_core_utils/test_exception_mapping_utils.py@@ -1,14 +1,9 @@-import os-import sysimport httpximport pytestimport litellm-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.exception_mapping_utils import (ExceptionCheckers,diff --git a/tests/test_litellm/litellm_core_utils/test_fallback_generalizations.py b/tests/test_litellm/litellm_core_utils/test_fallback_generalizations.pyindex b2a4263fade..882429fd7cd 100644--- a/tests/test_litellm/litellm_core_utils/test_fallback_generalizations.py+++ b/tests/test_litellm/litellm_core_utils/test_fallback_generalizations.py@@ -8,12 +8,9 @@ resolution (get_model_info) including the shipped rules in the bundled cost map."""import logging-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm._logging import verbose_loggerdiff --git a/tests/test_litellm/litellm_core_utils/test_get_llm_provider_endpoint_match.py b/tests/test_litellm/litellm_core_utils/test_get_llm_provider_endpoint_match.pyindex fc5b39a2fd7..bda7ab4afc6 100644--- a/tests/test_litellm/litellm_core_utils/test_get_llm_provider_endpoint_match.py+++ b/tests/test_litellm/litellm_core_utils/test_get_llm_provider_endpoint_match.py@@ -10,13 +10,10 @@ server's real provider key to an attacker-controlled host on theoutbound request."""-import os-import sysfrom unittest.mock import patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.litellm_core_utils.get_llm_provider_logic import (_endpoint_matches_api_base,diff --git a/tests/test_litellm/litellm_core_utils/test_get_model_cost_map.py b/tests/test_litellm/litellm_core_utils/test_get_model_cost_map.pyindex 94798d77348..8c0e8ee5d02 100644--- a/tests/test_litellm/litellm_core_utils/test_get_model_cost_map.py+++ b/tests/test_litellm/litellm_core_utils/test_get_model_cost_map.py@@ -6,11 +6,9 @@ count actual model entries, not reserved meta keys) and the extraction of theimport jsonimport os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.litellm_core_utils.fallback_generalizations import (get_fallback_generalization_rules,diff --git a/tests/test_litellm/litellm_core_utils/test_get_supported_openai_params.py b/tests/test_litellm/litellm_core_utils/test_get_supported_openai_params.pyindex 8587ad1ab01..2285cc83cad 100644--- a/tests/test_litellm/litellm_core_utils/test_get_supported_openai_params.py+++ b/tests/test_litellm/litellm_core_utils/test_get_supported_openai_params.py@@ -1,9 +1,6 @@-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.litellm_core_utils.get_supported_openai_params import (get_supported_openai_params,diff --git a/tests/test_litellm/litellm_core_utils/test_health_check_helpers.py b/tests/test_litellm/litellm_core_utils/test_health_check_helpers.pyindex f0d91224614..8f4799e3e7d 100644--- a/tests/test_litellm/litellm_core_utils/test_health_check_helpers.py+++ b/tests/test_litellm/litellm_core_utils/test_health_check_helpers.py@@ -1,14 +1,9 @@"""Test health check helper functions"""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.constants import LITTELM_INTERNAL_HEALTH_SERVICE_ACCOUNT_NAMEfrom litellm.litellm_core_utils.health_check_helpers import HealthCheckHelpersdiff --git a/tests/test_litellm/litellm_core_utils/test_initialize_dynamic_callback_params.py b/tests/test_litellm/litellm_core_utils/test_initialize_dynamic_callback_params.pyindex 956f86a9292..f9ddc47cc7c 100644--- a/tests/test_litellm/litellm_core_utils/test_initialize_dynamic_callback_params.py+++ b/tests/test_litellm/litellm_core_utils/test_initialize_dynamic_callback_params.py@@ -1,9 +1,6 @@-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.litellm_core_utils.initialize_dynamic_callback_params import (initialize_standard_callback_dynamic_params,diff --git a/tests/test_litellm/litellm_core_utils/test_litellm_logging.py b/tests/test_litellm/litellm_core_utils/test_litellm_logging.pyindex a3dcdaf1737..873da28fc34 100644--- a/tests/test_litellm/litellm_core_utils/test_litellm_logging.py+++ b/tests/test_litellm/litellm_core_utils/test_litellm_logging.py@@ -6,9 +6,6 @@ from unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport timediff --git a/tests/test_litellm/litellm_core_utils/test_max_streaming_duration.py b/tests/test_litellm/litellm_core_utils/test_max_streaming_duration.pyindex 1eb49f4859f..c768be22a9e 100644--- a/tests/test_litellm/litellm_core_utils/test_max_streaming_duration.py+++ b/tests/test_litellm/litellm_core_utils/test_max_streaming_duration.py@@ -6,14 +6,11 @@ Covers:- BaseResponsesAPIStreamingIterator (responses) sync + async"""-import os-import sysimport timefrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.litellm_core_utils.streaming_handler import CustomStreamWrapperdiff --git a/tests/test_litellm/litellm_core_utils/test_model_param_helper.py b/tests/test_litellm/litellm_core_utils/test_model_param_helper.pyindex df01bd636b8..2c45b333817 100644--- a/tests/test_litellm/litellm_core_utils/test_model_param_helper.py+++ b/tests/test_litellm/litellm_core_utils/test_model_param_helper.py@@ -1,9 +1,4 @@-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.model_param_helper import ModelParamHelperdiff --git a/tests/test_litellm/litellm_core_utils/test_realtime_errors.py b/tests/test_litellm/litellm_core_utils/test_realtime_errors.pyindex 263d1654f65..494d16b0b9b 100644--- a/tests/test_litellm/litellm_core_utils/test_realtime_errors.py+++ b/tests/test_litellm/litellm_core_utils/test_realtime_errors.py@@ -1,8 +1,5 @@import json-import os-import sys-sys.path.insert(0, os.path.abspath("../../.."))from litellm.litellm_core_utils.realtime_errors import (WEBSOCKET_CLOSE_REASON_MAX_BYTES,diff --git a/tests/test_litellm/litellm_core_utils/test_safe_json_dumps.py b/tests/test_litellm/litellm_core_utils/test_safe_json_dumps.pyindex ad24105588d..30385ba758d 100644--- a/tests/test_litellm/litellm_core_utils/test_safe_json_dumps.py+++ b/tests/test_litellm/litellm_core_utils/test_safe_json_dumps.py@@ -1,12 +1,7 @@import json-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.safe_json_dumps import safe_dumps, strip_null_bytesdiff --git a/tests/test_litellm/litellm_core_utils/test_sensitive_data_masker.py b/tests/test_litellm/litellm_core_utils/test_sensitive_data_masker.pyindex ba8540f81e3..f6b8a93c472 100644--- a/tests/test_litellm/litellm_core_utils/test_sensitive_data_masker.py+++ b/tests/test_litellm/litellm_core_utils/test_sensitive_data_masker.py@@ -2,13 +2,10 @@Unit tests for SensitiveDataMasker - List Preservation"""-import os-import sysimport pytest# Add the parent directory to the system path-sys.path.insert(0, os.path.abspath("../../.."))from litellm.litellm_core_utils.sensitive_data_masker import SensitiveDataMaskerdiff --git a/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_cursor.py b/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_cursor.pyindex 453c7490d98..3d9971034ae 100644--- a/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_cursor.py+++ b/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_cursor.py@@ -19,12 +19,9 @@ to 0 when the only update we saw was the cursor, allowing thetext-based fallback to estimate from the real completion text."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.litellm_core_utils.streaming_chunk_builder_utils import ChunkProcessorfrom litellm.types.utils import (diff --git a/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_server_tool_use.py b/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_server_tool_use.pyindex 4e28d5ba7d2..75508917a1e 100644--- a/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_server_tool_use.py+++ b/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_server_tool_use.py@@ -17,12 +17,9 @@ response and assert:raising ``AttributeError``."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm import completion_cost, stream_chunk_builderfrom litellm.types.utils import (diff --git a/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_utils.py b/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_utils.pyindex 0f21cce476b..44e77506b3f 100644--- a/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_utils.py+++ b/tests/test_litellm/litellm_core_utils/test_streaming_chunk_builder_utils.py@@ -1,12 +1,7 @@import json-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm import ChatCompletionUsageBlock, stream_chunk_builderfrom litellm.types.utils import GenericStreamingChunkdiff --git a/tests/test_litellm/litellm_core_utils/test_streaming_handler.py b/tests/test_litellm/litellm_core_utils/test_streaming_handler.pyindex fbdfcac1adc..b5e33a4e421 100644--- a/tests/test_litellm/litellm_core_utils/test_streaming_handler.py+++ b/tests/test_litellm/litellm_core_utils/test_streaming_handler.py@@ -1,14 +1,9 @@import json-import os-import sysimport timefrom unittest.mock import AsyncMock, MagicMock, Mock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport asyncioimport tracebackfrom typing import Optionaldiff --git a/tests/test_litellm/litellm_core_utils/test_token_counter.py b/tests/test_litellm/litellm_core_utils/test_token_counter.pyindex ee3e7719d52..a2590dbca2d 100644--- a/tests/test_litellm/litellm_core_utils/test_token_counter.py+++ b/tests/test_litellm/litellm_core_utils/test_token_counter.py@@ -1,8 +1,6 @@#### What this tests ##### This tests litellm.token_counter.token_counter() functionimport importlib-import os-import sysimport timeimport tracebackfrom unittest.mock import MagicMock@@ -10,9 +8,6 @@ from unittest.mock import MagicMockimport pytestimport tiktoken-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, patchimport litellmdiff --git a/tests/test_litellm/litellm_core_utils/test_token_counter_tool.py b/tests/test_litellm/litellm_core_utils/test_token_counter_tool.pyindex e8836bab2b9..9f8c1070a47 100644--- a/tests/test_litellm/litellm_core_utils/test_token_counter_tool.py+++ b/tests/test_litellm/litellm_core_utils/test_token_counter_tool.py@@ -1,13 +1,8 @@#### What this tests ##### This tests litellm.token_counter() function-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system path# Use the same token_counter as the main test.from tests.test_litellm.litellm_core_utils.test_token_counter import token_counterdiff --git a/tests/test_litellm/litellm_core_utils/test_tool_search_spend_logging.py b/tests/test_litellm/litellm_core_utils/test_tool_search_spend_logging.pyindex 813b4a5701f..3d6c7e6b8d8 100644--- a/tests/test_litellm/litellm_core_utils/test_tool_search_spend_logging.py+++ b/tests/test_litellm/litellm_core_utils/test_tool_search_spend_logging.py@@ -26,10 +26,7 @@ These tests exercise the real public entry points (not the private``_count_content_list`` helper) so the whole chain is covered end to end."""-import os-import sys-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm import stream_chunk_builderdiff --git a/tests/test_litellm/litellm_core_utils/test_xai_oauth_routing.py b/tests/test_litellm/litellm_core_utils/test_xai_oauth_routing.pyindex 03790b220eb..ca25ee80c23 100644--- a/tests/test_litellm/litellm_core_utils/test_xai_oauth_routing.py+++ b/tests/test_litellm/litellm_core_utils/test_xai_oauth_routing.py@@ -1,7 +1,4 @@-import os-import sys-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm import LlmProvidersdiff --git a/tests/test_litellm/llms/aiml/image_generation/test_aiml_image_generation_transformation.py b/tests/test_litellm/llms/aiml/image_generation/test_aiml_image_generation_transformation.pyindex dd74379a883..8d6c61b890c 100644--- a/tests/test_litellm/llms/aiml/image_generation/test_aiml_image_generation_transformation.py+++ b/tests/test_litellm/llms/aiml/image_generation/test_aiml_image_generation_transformation.py@@ -1,9 +1,7 @@import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"diff --git a/tests/test_litellm/llms/amazon_nova/chat/test_amazon_nova_chat_completion.py b/tests/test_litellm/llms/amazon_nova/chat/test_amazon_nova_chat_completion.pyindex d7f464e4052..ecdd1b36333 100644--- a/tests/test_litellm/llms/amazon_nova/chat/test_amazon_nova_chat_completion.py+++ b/tests/test_litellm/llms/amazon_nova/chat/test_amazon_nova_chat_completion.py@@ -1,9 +1,7 @@import os-import sysimport pytest# Ensure the project root is on the import path-sys.path.insert(0, os.path.abspath("../../../../../.."))from litellm import completionfrom litellm.types.utils import ModelResponse, Usage, Choices, Messagediff --git a/tests/test_litellm/llms/anthropic/batches/test_handler.py b/tests/test_litellm/llms/anthropic/batches/test_handler.pyindex 0a472d86257..6fde6350127 100644--- a/tests/test_litellm/llms/anthropic/batches/test_handler.py+++ b/tests/test_litellm/llms/anthropic/batches/test_handler.py@@ -14,14 +14,11 @@ asyncio.run) is exercised directly, mirroring the dispatch-contract discipline itests/test_litellm/batches/test_main.py."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.anthropic.batches.handler import AnthropicBatchesHandlerfrom litellm.types.utils import LiteLLMBatchdiff --git a/tests/test_litellm/llms/anthropic/batches/test_transformation.py b/tests/test_litellm/llms/anthropic/batches/test_transformation.pyindex 1635abcefd8..eacd2c9d03b 100644--- a/tests/test_litellm/llms/anthropic/batches/test_transformation.py+++ b/tests/test_litellm/llms/anthropic/batches/test_transformation.py@@ -14,15 +14,12 @@ otherwise read process env / secret managers - mocking them keeps the URL/headerassertions deterministic without touching production transform logic."""-import os-import sysimport timefrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.anthropic.batches.transformation import AnthropicBatchesConfigfrom litellm.types.utils import LiteLLMBatch, LlmProvidersdiff --git a/tests/test_litellm/llms/anthropic/chat/guardrail_translation/test_anthropic_guardrail_handler.py b/tests/test_litellm/llms/anthropic/chat/guardrail_translation/test_anthropic_guardrail_handler.pyindex b219dcba491..2b392456763 100644--- a/tests/test_litellm/llms/anthropic/chat/guardrail_translation/test_anthropic_guardrail_handler.py+++ b/tests/test_litellm/llms/anthropic/chat/guardrail_translation/test_anthropic_guardrail_handler.py@@ -6,16 +6,11 @@ with guardrail transformations, specifically testing edge cases with empty choic"""import json-import os-import sysfrom typing import Any, Literal, Optionalfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../../../..")-) # Adds the parent directory to the system pathfrom litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.llms.anthropic.chat.guardrail_translation.handler import (diff --git a/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py b/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.pyindex 43f27cc85f9..4f340ee0f3f 100644--- a/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py+++ b/tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchimport litellmdiff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_anthropic_experimental_pass_through_adapters_transformation.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_anthropic_experimental_pass_through_adapters_transformation.pyindex b216e8eef6d..e4dacc308dc 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_anthropic_experimental_pass_through_adapters_transformation.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_anthropic_experimental_pass_through_adapters_transformation.py@@ -1,12 +1,9 @@-import os-import sysfrom typing import Any, castimport pytestimport litellm-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.litellm_core_utils.prompt_templates.common_utils import (diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_compaction.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_compaction.pyindex 076d4392f05..5c53a8fc317 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_compaction.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_compaction.py@@ -1,13 +1,10 @@"""Compaction block SSE events from AnthropicStreamWrapper (compact_20260112 polyfill)."""-import os-import sysfrom typing import Listfrom unittest.mock import MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.anthropic.experimental_pass_through.adapters.streaming_iterator import (AnthropicStreamWrapper,diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_first_delta.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_first_delta.pyindex bd02c61752e..f64ffb6d233 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_first_delta.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_first_delta.py@@ -21,14 +21,11 @@ into an open ``thinking`` block, crashing Anthropic SDK clients (Claude Code)with "Content block is not a text block"."""-import os-import sysfrom typing import List, Optionalfrom unittest.mock import MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.anthropic.experimental_pass_through.adapters.streaming_iterator import (AnthropicStreamWrapper,diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_tool_args.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_tool_args.pyindex bd39e420607..29e9279731d 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_tool_args.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/adapters/test_streaming_iterator_tool_args.py@@ -8,14 +8,11 @@ Without the fix, the AnthropicStreamWrapper silently dropped thesearguments, causing tool_use blocks to arrive with empty input {}."""-import os-import sysfrom typing import Listfrom unittest.mock import MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.anthropic.experimental_pass_through.adapters.streaming_iterator import (AnthropicStreamWrapper,diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_agentic_streaming_iterator.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_agentic_streaming_iterator.pyindex b9bda07336f..db8aae6702f 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_agentic_streaming_iterator.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_agentic_streaming_iterator.py@@ -3,14 +3,11 @@ Tests for AgenticAnthropicStreamingIterator and SSE rebuild helpers."""import json-import os-import sysfrom typing import Any, Dict, List, Optional, Tuplefrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.anthropic.experimental_pass_through.messages.agentic_streaming_iterator import (AgenticAnthropicStreamingIterator,diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_anthropic_experimental_pass_through_messages_handler.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_anthropic_experimental_pass_through_messages_handler.pyindex 1ce683d76fc..570ce152714 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_anthropic_experimental_pass_through_messages_handler.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_anthropic_experimental_pass_through_messages_handler.py@@ -1,12 +1,10 @@import jsonimport os-import sysimport httpximport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../../.."))from unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_content_after_stop_reason.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_content_after_stop_reason.pyindex eadc0da2f1f..a0d1f9de6ec 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_content_after_stop_reason.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_content_after_stop_reason.py@@ -12,13 +12,10 @@ The wrapper should properly handle this by:- Properly managing content_block_stop/start events for subsequent content"""-import os-import sysfrom typing import Listimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.anthropic.experimental_pass_through.adapters.streaming_iterator import (AnthropicStreamWrapper,diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_mcp_handler.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_mcp_handler.pyindex f3cb2956aeb..b6914809263 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_mcp_handler.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_mcp_handler.py@@ -1,10 +1,7 @@-import os-import sysfrom unittest.mock import AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../../../.."))from litellm.llms.anthropic.experimental_pass_through.messages.handler import (anthropic_messages_handler,diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_parallel_tool_calls.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_parallel_tool_calls.pyindex 6d7cd2f88be..137286a18c4 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_parallel_tool_calls.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_parallel_tool_calls.py@@ -1,9 +1,6 @@-import os-import sysfrom typing import List-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.anthropic.experimental_pass_through.adapters.streaming_iterator import (AnthropicStreamWrapper,diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_reasoning_auto_summary_messages.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_reasoning_auto_summary_messages.pyindex 07c0012b04d..f478bbb9b50 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_reasoning_auto_summary_messages.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_reasoning_auto_summary_messages.py@@ -8,12 +8,10 @@ modes (type="enabled" or type="adaptive")."""import os-import sysimport pytestfrom unittest.mock import MagicMock, patch-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.llms.anthropic.experimental_pass_through.messages.handler import (diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_response_cache.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_response_cache.pyindex 3fe1b6b0e38..fe0bcfa4f30 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_response_cache.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_response_cache.py@@ -1,11 +1,8 @@import asyncio-import os-import sysfrom typing import Any, AsyncIterator, Dict, Listimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.caching.caching import Cache, LiteLLMCacheTypediff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_sse_wrapper.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_sse_wrapper.pyindex 63fed907c3c..bebdbe9f512 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_sse_wrapper.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_sse_wrapper.py@@ -1,10 +1,7 @@-import os-import sysimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.anthropic.experimental_pass_through.adapters.streaming_iterator import (AnthropicStreamWrapper,diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_streaming_iterator.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_streaming_iterator.pyindex 5c1cd88835f..f33bb3dda8b 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_streaming_iterator.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_streaming_iterator.py@@ -1,12 +1,9 @@import asyncioimport json-import os-import sysfrom datetime import datetimeimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjfrom litellm.llms.anthropic.experimental_pass_through.messages.streaming_iterator import (diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/responses_adapters/test_responses_adapters_transformation.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/responses_adapters/test_responses_adapters_transformation.pyindex 17bab9bf6a5..964f4b9f68b 100644--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/responses_adapters/test_responses_adapters_transformation.py+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/responses_adapters/test_responses_adapters_transformation.py@@ -5,13 +5,11 @@ Tests for LiteLLMAnthropicToResponsesAPIAdapterimport jsonimport os-import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../../../../.."))from litellm.constants import (DEFAULT_REASONING_EFFORT_HIGH_THINKING_BUDGET,diff --git a/tests/test_litellm/llms/anthropic/test_anthropic_count_tokens_transformation.py b/tests/test_litellm/llms/anthropic/test_anthropic_count_tokens_transformation.pyindex 889809140f8..ddac561f337 100644--- a/tests/test_litellm/llms/anthropic/test_anthropic_count_tokens_transformation.py+++ b/tests/test_litellm/llms/anthropic/test_anthropic_count_tokens_transformation.py@@ -1,9 +1,4 @@-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.anthropic.count_tokens.transformation import (AnthropicCountTokensConfig,)diff --git a/tests/test_litellm/llms/anthropic/test_anthropic_files_and_batches.py b/tests/test_litellm/llms/anthropic/test_anthropic_files_and_batches.pyindex fecc34694d5..2728ba03ae4 100644--- a/tests/test_litellm/llms/anthropic/test_anthropic_files_and_batches.py+++ b/tests/test_litellm/llms/anthropic/test_anthropic_files_and_batches.py@@ -8,11 +8,8 @@ Tests for:"""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patch-sys.path.insert(0, os.path.abspath("../../../../"))import httpximport pytestdiff --git a/tests/test_litellm/llms/anthropic/test_azure_ai_cache_pricing.py b/tests/test_litellm/llms/anthropic/test_azure_ai_cache_pricing.pyindex 97b8ab92a8e..69738118d7a 100644--- a/tests/test_litellm/llms/anthropic/test_azure_ai_cache_pricing.py+++ b/tests/test_litellm/llms/anthropic/test_azure_ai_cache_pricing.py@@ -3,10 +3,7 @@ Test that Azure AI Anthropic models have cache pricing configured.Verifies the fix for issue #19532."""-import sys-import os-sys.path.insert(0, os.path.abspath("../../../../../"))import litellmfrom litellm import get_model_infodiff --git a/tests/test_litellm/llms/anthropic/test_cost_calculation_dict_safety.py b/tests/test_litellm/llms/anthropic/test_cost_calculation_dict_safety.pyindex 70fef0162e6..5c88ae17679 100644--- a/tests/test_litellm/llms/anthropic/test_cost_calculation_dict_safety.py+++ b/tests/test_litellm/llms/anthropic/test_cost_calculation_dict_safety.py@@ -5,12 +5,9 @@ being either a ``dict`` or a ``ServerToolUse`` pydantic instance.See https://github.com/BerriAI/litellm/issues/26153."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.llms.anthropic.cost_calculation import (_get_web_search_requests,diff --git a/tests/test_litellm/llms/azure/batches/test_handler.py b/tests/test_litellm/llms/azure/batches/test_handler.pyindex f2332a7de7c..27876405781 100644--- a/tests/test_litellm/llms/azure/batches/test_handler.py+++ b/tests/test_litellm/llms/azure/batches/test_handler.py@@ -21,13 +21,10 @@ runs for real.from __future__ import annotationsimport asyncio-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from openai import AsyncOpenAI, OpenAI # noqa: E402diff --git a/tests/test_litellm/llms/azure/chat/test_azure_chat_o_series_transformation.py b/tests/test_litellm/llms/azure/chat/test_azure_chat_o_series_transformation.pyindex 31c76c42599..fc7e94a77ba 100644--- a/tests/test_litellm/llms/azure/chat/test_azure_chat_o_series_transformation.py+++ b/tests/test_litellm/llms/azure/chat/test_azure_chat_o_series_transformation.py@@ -1,15 +1,10 @@import json-import os-import sysimport tracebackfrom typing import Callable, Optionalfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.azure.chat.o_series_transformation import AzureOpenAIO1Configdiff --git a/tests/test_litellm/llms/azure/image_generation/test_azure_image_generation_init.py b/tests/test_litellm/llms/azure/image_generation/test_azure_image_generation_init.pyindex 857ed9d22a6..560fee17328 100644--- a/tests/test_litellm/llms/azure/image_generation/test_azure_image_generation_init.py+++ b/tests/test_litellm/llms/azure/image_generation/test_azure_image_generation_init.py@@ -1,15 +1,10 @@import json-import os-import sysimport tracebackfrom typing import Callable, Optionalfrom unittest.mock import AsyncMock, MagicMock, Mock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.azure.azure import AzureChatCompletionfrom litellm.llms.azure.image_generation.http_utils import (diff --git a/tests/test_litellm/llms/azure/passthrough/test_azure_passthrough_transformation.py b/tests/test_litellm/llms/azure/passthrough/test_azure_passthrough_transformation.pyindex 529a7453d74..29b74c2ee4a 100644--- a/tests/test_litellm/llms/azure/passthrough/test_azure_passthrough_transformation.py+++ b/tests/test_litellm/llms/azure/passthrough/test_azure_passthrough_transformation.py@@ -1,11 +1,8 @@import json-import os-import sysfrom unittest.mock import MagicMockimport httpx-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.azure.passthrough.transformation import AzurePassthroughConfigfrom litellm.types.utils import ModelResponsediff --git a/tests/test_litellm/llms/azure/realtime/test_azure_realtime_handler.py b/tests/test_litellm/llms/azure/realtime/test_azure_realtime_handler.pyindex 4638bc4df0f..c14a1cfdda3 100644--- a/tests/test_litellm/llms/azure/realtime/test_azure_realtime_handler.py+++ b/tests/test_litellm/llms/azure/realtime/test_azure_realtime_handler.py@@ -1,14 +1,10 @@import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom litellm.llms.custom_httpx.http_handler import get_shared_realtime_ssl_context-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system path@pytest.mark.asynciodiff --git a/tests/test_litellm/llms/azure/response/test_azure_transformation.py b/tests/test_litellm/llms/azure/response/test_azure_transformation.pyindex 24ae563fb76..da44394d11d 100644--- a/tests/test_litellm/llms/azure/response/test_azure_transformation.py+++ b/tests/test_litellm/llms/azure/response/test_azure_transformation.py@@ -1,13 +1,8 @@-import os-import sysfrom copy import deepcopyfrom unittest.mock import patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMockdiff --git a/tests/test_litellm/llms/azure/test_azure_common_utils.py b/tests/test_litellm/llms/azure/test_azure_common_utils.pyindex 3cc251b6228..f2c852e9509 100644--- a/tests/test_litellm/llms/azure/test_azure_common_utils.py+++ b/tests/test_litellm/llms/azure/test_azure_common_utils.py@@ -1,15 +1,11 @@import jsonimport os-import sysimport tracebackfrom typing import Callable, Optionalfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.azure.common_utils import BaseAzureLLM, get_azure_ad_tokenfrom litellm.secret_managers.get_azure_ad_token_provider import (diff --git a/tests/test_litellm/llms/azure/test_azure_exception_mapping.py b/tests/test_litellm/llms/azure/test_azure_exception_mapping.pyindex b172c401e2f..16560c7a1fa 100644--- a/tests/test_litellm/llms/azure/test_azure_exception_mapping.py+++ b/tests/test_litellm/llms/azure/test_azure_exception_mapping.py@@ -1,13 +1,8 @@import json-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.exceptions import ContentPolicyViolationErrordiff --git a/tests/test_litellm/llms/azure_ai/chat/test_azure_ai_transformation.py b/tests/test_litellm/llms/azure_ai/chat/test_azure_ai_transformation.pyindex 900372f3e54..0fd9a381a5a 100644--- a/tests/test_litellm/llms/azure_ai/chat/test_azure_ai_transformation.py+++ b/tests/test_litellm/llms/azure_ai/chat/test_azure_ai_transformation.py@@ -1,13 +1,8 @@import json-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.azure_ai.azure_model_router.transformation import (AzureModelRouterConfig,)diff --git a/tests/test_litellm/llms/azure_ai/claude/test_azure_anthropic_count_tokens_transformation.py b/tests/test_litellm/llms/azure_ai/claude/test_azure_anthropic_count_tokens_transformation.pyindex d66798a5725..4b317cff975 100644--- a/tests/test_litellm/llms/azure_ai/claude/test_azure_anthropic_count_tokens_transformation.py+++ b/tests/test_litellm/llms/azure_ai/claude/test_azure_anthropic_count_tokens_transformation.py@@ -4,12 +4,7 @@ Tests for Azure AI Anthropic CountTokens transformation.Verifies that the CountTokens API uses the correct authentication headers."""-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.azure_ai.anthropic.count_tokens.transformation import (diff --git a/tests/test_litellm/llms/azure_ai/image_edit/test_azure_ai_image_edit_transformation.py b/tests/test_litellm/llms/azure_ai/image_edit/test_azure_ai_image_edit_transformation.pyindex da1041f3d60..667552dcf60 100644--- a/tests/test_litellm/llms/azure_ai/image_edit/test_azure_ai_image_edit_transformation.py+++ b/tests/test_litellm/llms/azure_ai/image_edit/test_azure_ai_image_edit_transformation.py@@ -1,9 +1,4 @@-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.azure_ai.image_edit.transformation import (AzureFoundryFluxImageEditConfig,diff --git a/tests/test_litellm/llms/azure_ai/image_edit/test_mai_image_edit_transformation.py b/tests/test_litellm/llms/azure_ai/image_edit/test_mai_image_edit_transformation.pyindex d5256be02d7..b948e46093a 100644--- a/tests/test_litellm/llms/azure_ai/image_edit/test_mai_image_edit_transformation.py+++ b/tests/test_litellm/llms/azure_ai/image_edit/test_mai_image_edit_transformation.py@@ -1,12 +1,9 @@import io-import os-import sysfrom unittest.mock import MagicMockimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../../.."))from litellm.llms.azure_ai.image_edit import (AzureFoundryMAIImageEditConfig,diff --git a/tests/test_litellm/llms/azure_ai/image_generation/test_mai_image_generation.py b/tests/test_litellm/llms/azure_ai/image_generation/test_mai_image_generation.pyindex 30f479bd7ff..2a44e77ce09 100644--- a/tests/test_litellm/llms/azure_ai/image_generation/test_mai_image_generation.py+++ b/tests/test_litellm/llms/azure_ai/image_generation/test_mai_image_generation.py@@ -1,11 +1,9 @@import os-import sysfrom unittest.mock import MagicMockimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../../.."))import litellmfrom litellm.llms.azure.azure import AzureChatCompletiondiff --git a/tests/test_litellm/llms/azure_ai/rerank/test_azure_ai_rerank_transformation.py b/tests/test_litellm/llms/azure_ai/rerank/test_azure_ai_rerank_transformation.pyindex 602cbf68f3f..ab497d06ca7 100644--- a/tests/test_litellm/llms/azure_ai/rerank/test_azure_ai_rerank_transformation.py+++ b/tests/test_litellm/llms/azure_ai/rerank/test_azure_ai_rerank_transformation.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.azure_ai.rerank.transformation import AzureAIRerankConfigdiff --git a/tests/test_litellm/llms/base_llm/batches/base_batches_config_test.py b/tests/test_litellm/llms/base_llm/batches/base_batches_config_test.pyindex fd526c55de4..5195dd8ba44 100644--- a/tests/test_litellm/llms/base_llm/batches/base_batches_config_test.py+++ b/tests/test_litellm/llms/base_llm/batches/base_batches_config_test.py@@ -19,14 +19,11 @@ transformation is a standalone class with a different shape) cannot use this andkeep fully standalone tests."""-import os-import sysfrom unittest.mock import MagicMockimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.types.utils import LiteLLMBatch, LlmProvidersdiff --git a/tests/test_litellm/llms/base_llm/batches/test_transformation.py b/tests/test_litellm/llms/base_llm/batches/test_transformation.pyindex cfb9f278f80..d84c820228f 100644--- a/tests/test_litellm/llms/base_llm/batches/test_transformation.py+++ b/tests/test_litellm/llms/base_llm/batches/test_transformation.py@@ -18,12 +18,9 @@ filter, dropping the staticmethod/classmethod filter, or widening the prefixfilter to all single-underscore names) makes a test fail."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.base_llm.batches.transformation import BaseBatchesConfigfrom litellm.types.utils import LlmProvidersdiff --git a/tests/test_litellm/llms/bedrock/batches/test_batch_metadata_sanitization.py b/tests/test_litellm/llms/bedrock/batches/test_batch_metadata_sanitization.pyindex 8de47331614..a34e4f5d5c9 100644--- a/tests/test_litellm/llms/bedrock/batches/test_batch_metadata_sanitization.py+++ b/tests/test_litellm/llms/bedrock/batches/test_batch_metadata_sanitization.py@@ -9,12 +9,9 @@ when constructing LiteLLMBatch. This test suite verifies the sanitizationlayer prevents that."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.bedrock.batches.transformation import BedrockBatchesConfigdiff --git a/tests/test_litellm/llms/bedrock/batches/test_handler.py b/tests/test_litellm/llms/bedrock/batches/test_handler.pyindex 1436ad2f383..d2dc89a7492 100644--- a/tests/test_litellm/llms/bedrock/batches/test_handler.py+++ b/tests/test_litellm/llms/bedrock/batches/test_handler.py@@ -8,14 +8,11 @@ the tests don't hit AWS.from __future__ import annotations-import os-import sysfrom datetime import datetime, timezonefrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.bedrock.batches.handler import ( # noqa: E402BedrockBatchesHandler,diff --git a/tests/test_litellm/llms/bedrock/batches/test_transformation.py b/tests/test_litellm/llms/bedrock/batches/test_transformation.pyindex 01420eb10df..87f9c506857 100644--- a/tests/test_litellm/llms/bedrock/batches/test_transformation.py+++ b/tests/test_litellm/llms/bedrock/batches/test_transformation.py@@ -14,14 +14,11 @@ URL/ARN handling, and the error class. AWS auth/sigv4 is the only external seamwe mock; everything else runs for real."""-import os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.bedrock.batches.transformation import BedrockBatchesConfigfrom litellm.types.utils import LiteLLMBatch, LlmProvidersdiff --git a/tests/test_litellm/llms/bedrock/chat/agentcore/test_agentcore_transformation.py b/tests/test_litellm/llms/bedrock/chat/agentcore/test_agentcore_transformation.pyindex e5a2ea9b28f..ed8aab8d3d0 100644--- a/tests/test_litellm/llms/bedrock/chat/agentcore/test_agentcore_transformation.py+++ b/tests/test_litellm/llms/bedrock/chat/agentcore/test_agentcore_transformation.py@@ -9,13 +9,10 @@ Tests:"""import json-import os-import sysimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../../.."))from unittest.mock import MagicMock, Mock, patchdiff --git a/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_amazon_qwen2_transformation.py b/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_amazon_qwen2_transformation.pyindex 5f5a6512eac..4db786668b8 100644--- a/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_amazon_qwen2_transformation.py+++ b/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_amazon_qwen2_transformation.py@@ -1,14 +1,11 @@import asyncioimport json-import os-import sysfrom unittest.mock import Mockimport pytest# Ensure the project root is on the import path so `litellm` can be imported when# tests are executed from any working directory.-sys.path.insert(0, os.path.abspath("../../../../../.."))from litellm.llms.bedrock.chat.invoke_transformations.amazon_qwen2_transformation import (AmazonQwen2Config,diff --git a/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_amazon_qwen3_transformation.py b/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_amazon_qwen3_transformation.pyindex fea210b6c47..e011b1fca2b 100644--- a/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_amazon_qwen3_transformation.py+++ b/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_amazon_qwen3_transformation.py@@ -1,14 +1,11 @@import asyncioimport json-import os-import sysfrom unittest.mock import Mockimport pytest# Ensure the project root is on the import path so `litellm` can be imported when# tests are executed from any working directory.-sys.path.insert(0, os.path.abspath("../../../../../.."))from litellm.llms.bedrock.chat.invoke_transformations.amazon_qwen3_transformation import (AmazonQwen3Config,diff --git a/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_base_invoke_transformation.py b/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_base_invoke_transformation.pyindex 5fefae7e411..aba51689094 100644--- a/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_base_invoke_transformation.py+++ b/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_base_invoke_transformation.py@@ -1,12 +1,7 @@import json-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.bedrock.chat.invoke_transformations.anthropic_claude3_transformation import (AmazonAnthropicClaudeConfig,diff --git a/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_bedrock_chat_invoke_transformations_anthropic_claude3_transformation.py b/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_bedrock_chat_invoke_transformations_anthropic_claude3_transformation.pyindex 4c4c0e17a38..cea299280f8 100644--- a/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_bedrock_chat_invoke_transformations_anthropic_claude3_transformation.py+++ b/tests/test_litellm/llms/bedrock/chat/invoke_transformations/test_bedrock_chat_invoke_transformations_anthropic_claude3_transformation.py@@ -1,14 +1,11 @@import asyncioimport json-import os-import sysfrom unittest.mock import patchimport pytest# Ensure the project root is on the import path so `litellm` can be imported when# tests are executed from any working directory.-sys.path.insert(0, os.path.abspath("../../../../../.."))from litellm.llms.bedrock.chat.invoke_transformations.anthropic_claude3_transformation import (AmazonAnthropicClaudeConfig,diff --git a/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py b/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.pyindex 2d6e938ea1f..604f3414775 100644--- a/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py+++ b/tests/test_litellm/llms/bedrock/chat/test_converse_transformation.py@@ -1,14 +1,10 @@import asyncioimport jsonimport os-import sysimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchimport litellmdiff --git a/tests/test_litellm/llms/bedrock/chat/test_converse_transformation_nova_2.py b/tests/test_litellm/llms/bedrock/chat/test_converse_transformation_nova_2.pyindex bac7aa08a04..58058a2e1d4 100644--- a/tests/test_litellm/llms/bedrock/chat/test_converse_transformation_nova_2.py+++ b/tests/test_litellm/llms/bedrock/chat/test_converse_transformation_nova_2.py@@ -8,12 +8,7 @@ Reference: https://docs.aws.amazon.com/nova/latest/nova2-userguide/using-convers"""import pytest-import sys-import os-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport httpximport litellmdiff --git a/tests/test_litellm/llms/bedrock/chat/test_invoke_handler.py b/tests/test_litellm/llms/bedrock/chat/test_invoke_handler.pyindex e8964910c69..e2892a6ccee 100644--- a/tests/test_litellm/llms/bedrock/chat/test_invoke_handler.py+++ b/tests/test_litellm/llms/bedrock/chat/test_invoke_handler.py@@ -1,13 +1,8 @@-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.bedrock.chat.invoke_handler import (diff --git a/tests/test_litellm/llms/bedrock/chat/test_service_tier.py b/tests/test_litellm/llms/bedrock/chat/test_service_tier.pyindex a625aae23df..ce9dc4d745e 100644--- a/tests/test_litellm/llms/bedrock/chat/test_service_tier.py+++ b/tests/test_litellm/llms/bedrock/chat/test_service_tier.py@@ -3,14 +3,9 @@ Tests for Bedrock Converse API serviceTier support."""import json-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.bedrock.chat.converse_transformation import AmazonConverseConfigfrom litellm.types.llms.bedrock import ServiceTierBlockdiff --git a/tests/test_litellm/llms/bedrock/chat/test_writer_palmyra.py b/tests/test_litellm/llms/bedrock/chat/test_writer_palmyra.pyindex 9bc6724867f..4acfa3f637f 100644--- a/tests/test_litellm/llms/bedrock/chat/test_writer_palmyra.py+++ b/tests/test_litellm/llms/bedrock/chat/test_writer_palmyra.py@@ -2,14 +2,9 @@Tests for Writer Palmyra X5 and X4 models on Bedrock Converse."""-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.bedrock.common_utils import BedrockModelInfodiff --git a/tests/test_litellm/llms/bedrock/count_tokens/test_bedrock_count_tokens_transformation.py b/tests/test_litellm/llms/bedrock/count_tokens/test_bedrock_count_tokens_transformation.pyindex 6812f40829a..b357c5ac126 100644--- a/tests/test_litellm/llms/bedrock/count_tokens/test_bedrock_count_tokens_transformation.py+++ b/tests/test_litellm/llms/bedrock/count_tokens/test_bedrock_count_tokens_transformation.py@@ -1,11 +1,6 @@import base64import json-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.bedrock.count_tokens.transformation import (DEFAULT_ANTHROPIC_INVOKE_MODEL_MAX_TOKENS,BedrockCountTokensConfig,diff --git a/tests/test_litellm/llms/bedrock/embed/test_bedrock_async_invoke_embedding.py b/tests/test_litellm/llms/bedrock/embed/test_bedrock_async_invoke_embedding.pyindex 1c802ecd077..74a55cc1ef2 100644--- a/tests/test_litellm/llms/bedrock/embed/test_bedrock_async_invoke_embedding.py+++ b/tests/test_litellm/llms/bedrock/embed/test_bedrock_async_invoke_embedding.py@@ -1,13 +1,8 @@import json-import os-import sysfrom unittest.mock import Mock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerfrom litellm.types.llms.base import HiddenParamsdiff --git a/tests/test_litellm/llms/bedrock/embed/test_bedrock_embedding.py b/tests/test_litellm/llms/bedrock/embed/test_bedrock_embedding.pyindex e35365cd609..114e473be98 100644--- a/tests/test_litellm/llms/bedrock/embed/test_bedrock_embedding.py+++ b/tests/test_litellm/llms/bedrock/embed/test_bedrock_embedding.py@@ -1,13 +1,9 @@import jsonimport os-import sysfrom unittest.mock import Mock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerdiff --git a/tests/test_litellm/llms/bedrock/embed/test_embedding.py b/tests/test_litellm/llms/bedrock/embed/test_embedding.pyindex 261448842f4..a6cf54a7870 100644--- a/tests/test_litellm/llms/bedrock/embed/test_embedding.py+++ b/tests/test_litellm/llms/bedrock/embed/test_embedding.py@@ -1,9 +1,4 @@-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import patchimport pytestdiff --git a/tests/test_litellm/llms/bedrock/image/test_amazon_stability3_transformation.py b/tests/test_litellm/llms/bedrock/image/test_amazon_stability3_transformation.pyindex a758202d74f..dbde8565e13 100644--- a/tests/test_litellm/llms/bedrock/image/test_amazon_stability3_transformation.py+++ b/tests/test_litellm/llms/bedrock/image/test_amazon_stability3_transformation.py@@ -1,13 +1,8 @@import json-import os-import sysimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchfrom litellm.llms.bedrock.image_generation.amazon_stability3_transformation import (diff --git a/tests/test_litellm/llms/bedrock/image/test_bedrock_image_bearer_token.py b/tests/test_litellm/llms/bedrock/image/test_bedrock_image_bearer_token.pyindex b2b00d25051..7c36b2aa75f 100644--- a/tests/test_litellm/llms/bedrock/image/test_bedrock_image_bearer_token.py+++ b/tests/test_litellm/llms/bedrock/image/test_bedrock_image_bearer_token.py@@ -1,12 +1,8 @@import jsonimport os-import sysfrom unittest.mock import Mock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.custom_httpx.http_handler import HTTPHandler, AsyncHTTPHandlerdiff --git a/tests/test_litellm/llms/bedrock/invoke_agent/test_bedrock_agent_transformation.py b/tests/test_litellm/llms/bedrock/invoke_agent/test_bedrock_agent_transformation.pyindex 9e526e47784..3eb85449985 100644--- a/tests/test_litellm/llms/bedrock/invoke_agent/test_bedrock_agent_transformation.py+++ b/tests/test_litellm/llms/bedrock/invoke_agent/test_bedrock_agent_transformation.py@@ -1,13 +1,8 @@import base64-import os-import sysfrom unittest.mock import patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.bedrock.chat.invoke_agent.transformation import (AmazonInvokeAgentConfig,diff --git a/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py b/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.pyindex 604388ce91a..d3c28302bf9 100644--- a/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py+++ b/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py@@ -2,7 +2,6 @@ import asyncioimport copyimport jsonimport os-import sysfrom datetime import datetimefrom types import SimpleNamespacefrom unittest.mock import Mock@@ -11,7 +10,6 @@ import pytest# Ensure the project root is on the import path so `litellm` can be imported when# tests are executed from any working directory.-sys.path.insert(0, os.path.abspath("../../../../../.."))from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjfrom litellm.llms.bedrock.common_utils import (diff --git a/tests/test_litellm/llms/bedrock/passthrough/test_bedrock_passthrough_transformation.py b/tests/test_litellm/llms/bedrock/passthrough/test_bedrock_passthrough_transformation.pyindex 1c90b7c8c87..b005d77ac8b 100644--- a/tests/test_litellm/llms/bedrock/passthrough/test_bedrock_passthrough_transformation.py+++ b/tests/test_litellm/llms/bedrock/passthrough/test_bedrock_passthrough_transformation.py@@ -1,10 +1,5 @@-import os-import sysfrom unittest.mock import patch-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.bedrock.passthrough.transformation import BedrockPassthroughConfigdiff --git a/tests/test_litellm/llms/bedrock/realtime/test_bedrock_realtime_handler.py b/tests/test_litellm/llms/bedrock/realtime/test_bedrock_realtime_handler.pyindex ffe21b91ab2..9efcee192b1 100644--- a/tests/test_litellm/llms/bedrock/realtime/test_bedrock_realtime_handler.py+++ b/tests/test_litellm/llms/bedrock/realtime/test_bedrock_realtime_handler.py@@ -1,5 +1,4 @@import json-import osimport sysimport typesfrom types import SimpleNamespace@@ -7,7 +6,6 @@ from unittest.mock import MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../../..")) # Adds the parent directory to the system pathfrom litellm.llms.bedrock.common_utils import BedrockErrorfrom litellm.llms.bedrock.realtime.handler import BedrockRealtimediff --git a/tests/test_litellm/llms/bedrock/realtime/test_bedrock_realtime_transformation.py b/tests/test_litellm/llms/bedrock/realtime/test_bedrock_realtime_transformation.pyindex aa002b6e302..ae6b1febd6b 100644--- a/tests/test_litellm/llms/bedrock/realtime/test_bedrock_realtime_transformation.py+++ b/tests/test_litellm/llms/bedrock/realtime/test_bedrock_realtime_transformation.py@@ -1,11 +1,8 @@import json-import os-import sysfrom unittest.mock import MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../../..")) # Adds the parent directory to the system pathimport base64diff --git a/tests/test_litellm/llms/bedrock/rerank/test_bedrock_rerank_header_forwarding.py b/tests/test_litellm/llms/bedrock/rerank/test_bedrock_rerank_header_forwarding.pyindex d8259652641..b2a2046b131 100644--- a/tests/test_litellm/llms/bedrock/rerank/test_bedrock_rerank_header_forwarding.py+++ b/tests/test_litellm/llms/bedrock/rerank/test_bedrock_rerank_header_forwarding.py@@ -6,15 +6,10 @@ forward_client_headers_to_llm_api were not being passed to Bedrock rerank provid"""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, Mock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.bedrock.base_aws_llm import Boto3CredentialsInfofrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerdiff --git a/tests/test_litellm/llms/bedrock/rerank/transformation.py b/tests/test_litellm/llms/bedrock/rerank/transformation.pyindex 870a7cb1f1e..b45042d1f6a 100644--- a/tests/test_litellm/llms/bedrock/rerank/transformation.py+++ b/tests/test_litellm/llms/bedrock/rerank/transformation.py@@ -1,13 +1,8 @@import json-import os-import sysimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchfrom litellm import rerankdiff --git a/tests/test_litellm/llms/bedrock/test_base_aws_llm.py b/tests/test_litellm/llms/bedrock/test_base_aws_llm.pyindex b9f8283b78e..50e2b53c2b3 100644--- a/tests/test_litellm/llms/bedrock/test_base_aws_llm.py+++ b/tests/test_litellm/llms/bedrock/test_base_aws_llm.py@@ -1,15 +1,11 @@import jsonimport os-import sysimport threadingimport timeimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom datetime import datetime, timedelta, timezonediff --git a/tests/test_litellm/llms/bedrock/test_bedrock_common_utils.py b/tests/test_litellm/llms/bedrock/test_bedrock_common_utils.pyindex 83f3d73015d..389bf4a8e40 100644--- a/tests/test_litellm/llms/bedrock/test_bedrock_common_utils.py+++ b/tests/test_litellm/llms/bedrock/test_bedrock_common_utils.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.bedrock.common_utils import BedrockModelInfodiff --git a/tests/test_litellm/llms/bedrock/test_bedrock_ssl_verify.py b/tests/test_litellm/llms/bedrock/test_bedrock_ssl_verify.pyindex 962933aba28..75e9a8afcb6 100644--- a/tests/test_litellm/llms/bedrock/test_bedrock_ssl_verify.py+++ b/tests/test_litellm/llms/bedrock/test_bedrock_ssl_verify.py@@ -10,13 +10,11 @@ being applied to boto3 clients, causing "certificate verify failed" errors."""import os-import sysimport tempfilefrom unittest.mock import MagicMock, Mock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.llms.bedrock.base_aws_llm import BaseAWSLLMdiff --git a/tests/test_litellm/llms/bedrock/test_cross_region_inference_profile_mapping.py b/tests/test_litellm/llms/bedrock/test_cross_region_inference_profile_mapping.pyindex 22aba59fb5d..dbd31c7e81b 100644--- a/tests/test_litellm/llms/bedrock/test_cross_region_inference_profile_mapping.py+++ b/tests/test_litellm/llms/bedrock/test_cross_region_inference_profile_mapping.py@@ -1,15 +1,12 @@"""Test Bedrock cross-region inference profile model mapping"""import json-import os-import sysfrom functools import lru_cachefrom pathlib import Pathfrom typing import NamedTupleimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.llms.bedrock.chat.converse_transformation import AmazonConverseConfigdiff --git a/tests/test_litellm/llms/bedrock/test_request_metadata.py b/tests/test_litellm/llms/bedrock/test_request_metadata.pyindex 79b8990a3af..5a14bbea9f2 100644--- a/tests/test_litellm/llms/bedrock/test_request_metadata.py+++ b/tests/test_litellm/llms/bedrock/test_request_metadata.py@@ -1,11 +1,8 @@import asyncioimport json-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.llms.bedrock.base_aws_llm import BaseAWSLLMdiff --git a/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py b/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.pyindex 28c8e5c7ed6..9e05d48a18f 100644--- a/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py+++ b/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py@@ -8,10 +8,7 @@ gate, the URL construction for both paths, and the shared Bearer auth."""import copy-import os-import sys-sys.path.insert(0, os.path.abspath("../../../../.."))import pytestfrom botocore.exceptions import (diff --git a/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_transformation.py b/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_transformation.pyindex 07910b0b56f..cd775abf136 100644--- a/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_transformation.py+++ b/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_transformation.py@@ -6,11 +6,8 @@ API docs: https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.ht"""import json-import os-import sysfrom unittest.mock import patch-sys.path.insert(0, os.path.abspath("../../../../.."))import httpximport pytestdiff --git a/tests/test_litellm/llms/black_forest_labs/image_edit/test_bfl_image_edit_transformation.py b/tests/test_litellm/llms/black_forest_labs/image_edit/test_bfl_image_edit_transformation.pyindex 17decaf8257..ec243b7058d 100644--- a/tests/test_litellm/llms/black_forest_labs/image_edit/test_bfl_image_edit_transformation.py+++ b/tests/test_litellm/llms/black_forest_labs/image_edit/test_bfl_image_edit_transformation.py@@ -7,8 +7,6 @@ since polling logic was moved to the handler.import base64import json-import os-import sysimport timefrom io import BytesIOfrom typing import Dict, List@@ -17,9 +15,6 @@ from unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.black_forest_labs.image_edit.transformation import (BlackForestLabsImageEditConfig,diff --git a/tests/test_litellm/llms/black_forest_labs/image_generation/test_bfl_image_generation_transformation.py b/tests/test_litellm/llms/black_forest_labs/image_generation/test_bfl_image_generation_transformation.pyindex 153df5305a7..d6e2c4a3e06 100644--- a/tests/test_litellm/llms/black_forest_labs/image_generation/test_bfl_image_generation_transformation.py+++ b/tests/test_litellm/llms/black_forest_labs/image_generation/test_bfl_image_generation_transformation.py@@ -6,16 +6,11 @@ since polling logic was moved to the handler."""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.black_forest_labs.image_generation.transformation import (BlackForestLabsImageGenerationConfig,diff --git a/tests/test_litellm/llms/bytez/chat/test_bytez_chat_transformation.py b/tests/test_litellm/llms/bytez/chat/test_bytez_chat_transformation.pyindex 94b8c51dd52..440304aeac1 100644--- a/tests/test_litellm/llms/bytez/chat/test_bytez_chat_transformation.py+++ b/tests/test_litellm/llms/bytez/chat/test_bytez_chat_transformation.py@@ -1,10 +1,7 @@-import os-import sysimport pytestimport json# Adds the parent directory to the system path-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.bytez.chat.transformation import BytezChatConfig, API_BASE, versiondiff --git a/tests/test_litellm/llms/chat/test_converse_handler.py b/tests/test_litellm/llms/chat/test_converse_handler.pyindex 6f8a2788c38..ca79c8d7025 100644--- a/tests/test_litellm/llms/chat/test_converse_handler.py+++ b/tests/test_litellm/llms/chat/test_converse_handler.py@@ -1,6 +1,4 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport httpx@@ -12,9 +10,6 @@ from litellm.llms.bedrock.chat.converse_handler import make_sync_callfrom litellm.llms.bedrock.common_utils import _get_all_bedrock_regionsfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathdef test_encode_model_id_with_inference_profile():diff --git a/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py b/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.pyindex 90a1c24bada..8e0415d50de 100644--- a/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py+++ b/tests/test_litellm/llms/chatgpt/responses/test_chatgpt_responses_transformation.py@@ -5,14 +5,11 @@ Source: litellm/llms/chatgpt/responses/transformation.py"""import json-import os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.openai.common_utils import OpenAIErrorfrom litellm.types.router import GenericLiteLLMParamsdiff --git a/tests/test_litellm/llms/cohere/chat/test_cohere_transformation.py b/tests/test_litellm/llms/cohere/chat/test_cohere_transformation.pyindex c208f4c5489..61334b6ff63 100644--- a/tests/test_litellm/llms/cohere/chat/test_cohere_transformation.py+++ b/tests/test_litellm/llms/cohere/chat/test_cohere_transformation.py@@ -1,10 +1,5 @@-import os-import sysfrom unittest.mock import MagicMock-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.cohere.chat.transformation import CohereChatConfigdiff --git a/tests/test_litellm/llms/cohere/embed/test_v1_transformation.py b/tests/test_litellm/llms/cohere/embed/test_v1_transformation.pyindex 77b500a7e8c..66129b64a2c 100644--- a/tests/test_litellm/llms/cohere/embed/test_v1_transformation.py+++ b/tests/test_litellm/llms/cohere/embed/test_v1_transformation.py@@ -1,10 +1,5 @@-import os-import sysfrom unittest.mock import MagicMock-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.cohere.embed.v1_transformation import CohereEmbeddingConfigfrom litellm.types.utils import EmbeddingResponsediff --git a/tests/test_litellm/llms/cohere/rerank/test_rerank_guardrail_handler.py b/tests/test_litellm/llms/cohere/rerank/test_rerank_guardrail_handler.pyindex 46c37e6af6c..cd3ac57c7e8 100644--- a/tests/test_litellm/llms/cohere/rerank/test_rerank_guardrail_handler.py+++ b/tests/test_litellm/llms/cohere/rerank/test_rerank_guardrail_handler.py@@ -2,12 +2,9 @@Unit tests for Cohere Rerank Guardrail Translation Handler"""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.llms import get_guardrail_translation_mappingdiff --git a/tests/test_litellm/llms/cometapi/chat/test_cometapi_chat_transformation.py b/tests/test_litellm/llms/cometapi/chat/test_cometapi_chat_transformation.pyindex 0b3348c1b7f..7a69b676667 100644--- a/tests/test_litellm/llms/cometapi/chat/test_cometapi_chat_transformation.py+++ b/tests/test_litellm/llms/cometapi/chat/test_cometapi_chat_transformation.py@@ -5,13 +5,9 @@ Tests the CometAPIChatConfig class methods using mocks"""import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.cometapi.chat.transformation import (CometAPIChatCompletionStreamingHandler,@@ -187,7 +183,6 @@ def test_cometapi_integration():Integration test - requires real API keyRun with: pytest -k test_cometapi_integration -s"""- import osfrom litellm import completion# Try to get API key from multiple environment variables@@ -221,7 +216,6 @@ def test_cometapi_streaming_integration():Integration test for streaming - requires real API keyRun with: pytest -k test_cometapi_streaming_integration -s"""- import osfrom litellm import completion# Try to get API key from multiple environment variables@@ -285,7 +279,6 @@ def test_cometapi_with_custom_base_url():"""Test CometAPI with custom base URL"""- import osfrom litellm import completionapi_key = (diff --git a/tests/test_litellm/llms/custom_httpx/test_aiohttp_handler.py b/tests/test_litellm/llms/custom_httpx/test_aiohttp_handler.pyindex 789c88d66f8..763647aa463 100644--- a/tests/test_litellm/llms/custom_httpx/test_aiohttp_handler.py+++ b/tests/test_litellm/llms/custom_httpx/test_aiohttp_handler.py@@ -1,13 +1,8 @@-import os-import sysfrom unittest.mock import AsyncMock, Mock, patchimport aiohttpimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.custom_httpx.aiohttp_handler import BaseLLMAIOHTTPHandlerfrom litellm.llms.custom_httpx.aiohttp_transport import LiteLLMAiohttpTransportdiff --git a/tests/test_litellm/llms/custom_httpx/test_aiohttp_transport.py b/tests/test_litellm/llms/custom_httpx/test_aiohttp_transport.pyindex 2dc7fbfd62a..4c92c52d556 100644--- a/tests/test_litellm/llms/custom_httpx/test_aiohttp_transport.py+++ b/tests/test_litellm/llms/custom_httpx/test_aiohttp_transport.py@@ -1,7 +1,5 @@import asyncioimport concurrent.futures-import os-import sysimport aiohttpimport aiohttp.client_exceptions@@ -9,9 +7,6 @@ import aiohttp.http_exceptionsimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.custom_httpx.aiohttp_transport import (AiohttpResponseStream,diff --git a/tests/test_litellm/llms/custom_httpx/test_credential_leak_prevention.py b/tests/test_litellm/llms/custom_httpx/test_credential_leak_prevention.pyindex bd9db87a765..32c555f205a 100644--- a/tests/test_litellm/llms/custom_httpx/test_credential_leak_prevention.py+++ b/tests/test_litellm/llms/custom_httpx/test_credential_leak_prevention.py@@ -7,14 +7,11 @@ Covers:- _raise_masked_sync_error and _raise_masked_async_error"""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.llms.custom_httpx.http_handler import (AsyncHTTPHandler,diff --git a/tests/test_litellm/llms/custom_httpx/test_http_handler.py b/tests/test_litellm/llms/custom_httpx/test_http_handler.pyindex 641fae12bc2..f7f89cd1d8d 100644--- a/tests/test_litellm/llms/custom_httpx/test_http_handler.py+++ b/tests/test_litellm/llms/custom_httpx/test_http_handler.py@@ -4,7 +4,6 @@ import ioimport osimport pathlibimport ssl-import sysimport threadingimport weakreffrom unittest.mock import MagicMock, patch@@ -14,9 +13,6 @@ import httpximport pytestfrom aiohttp import ClientSession, TCPConnector-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.custom_httpx.aiohttp_transport import LiteLLMAiohttpTransportfrom litellm.llms.custom_httpx.http_handler import (diff --git a/tests/test_litellm/llms/custom_httpx/test_llm_http_handler.py b/tests/test_litellm/llms/custom_httpx/test_llm_http_handler.pyindex 3c972ae9c84..9faa77d6dce 100644--- a/tests/test_litellm/llms/custom_httpx/test_llm_http_handler.py+++ b/tests/test_litellm/llms/custom_httpx/test_llm_http_handler.py@@ -1,15 +1,12 @@import asyncioimport jsonimport logging-import os-import sysimport timefrom unittest.mock import AsyncMock, Mock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../..")) # Adds the parent directory to the system pathimport litellmfrom litellm._logging import verbose_loggerfrom litellm.integrations.code_interpreter_interception.handler import (diff --git a/tests/test_litellm/llms/dashscope/test_dashscope_chat_transformation.py b/tests/test_litellm/llms/dashscope/test_dashscope_chat_transformation.pyindex 8dbc197d4b5..d2a90baf6b2 100644--- a/tests/test_litellm/llms/dashscope/test_dashscope_chat_transformation.py+++ b/tests/test_litellm/llms/dashscope/test_dashscope_chat_transformation.py@@ -5,12 +5,7 @@ These tests validate the DashScopeConfig class which extends OpenAIGPTConfig.DashScope is an OpenAI-compatible provider with minor customizations."""-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.types.llms.openai import AllMessageValuesimport pytestdiff --git a/tests/test_litellm/llms/dashscope/test_dashscope_cost_calculator.py b/tests/test_litellm/llms/dashscope/test_dashscope_cost_calculator.pyindex 510776ddfdf..8dc4620dd1b 100644--- a/tests/test_litellm/llms/dashscope/test_dashscope_cost_calculator.py+++ b/tests/test_litellm/llms/dashscope/test_dashscope_cost_calculator.py@@ -10,12 +10,10 @@ Tests the cost calculation for Dashscope models including:import mathimport os-import sysimport pytest# Add the project root to Python path-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.llms.dashscope.cost_calculator import (diff --git a/tests/test_litellm/llms/dashscope/test_dashscope_embedding_transformation.py b/tests/test_litellm/llms/dashscope/test_dashscope_embedding_transformation.pyindex 5e4d0177e8d..1b6eea0e4c8 100644--- a/tests/test_litellm/llms/dashscope/test_dashscope_embedding_transformation.py+++ b/tests/test_litellm/llms/dashscope/test_dashscope_embedding_transformation.py@@ -3,14 +3,11 @@ Unit tests for DashScope embedding transformation."""import json-import os-import sysfrom unittest.mock import MagicMockimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.dashscope.common_utils import DashScopeErrorfrom litellm.llms.dashscope.embed.transformation import (diff --git a/tests/test_litellm/llms/dashscope/test_dashscope_rerank_transformation.py b/tests/test_litellm/llms/dashscope/test_dashscope_rerank_transformation.pyindex 0e8d58b6530..936de812bc6 100644--- a/tests/test_litellm/llms/dashscope/test_dashscope_rerank_transformation.py+++ b/tests/test_litellm/llms/dashscope/test_dashscope_rerank_transformation.py@@ -3,14 +3,11 @@ Unit tests for DashScope rerank transformation."""import json-import os-import sysfrom unittest.mock import MagicMockimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.dashscope.common_utils import DashScopeErrorfrom litellm.llms.dashscope.rerank.transformation import (diff --git a/tests/test_litellm/llms/databricks/chat/test_databricks_chat_transformation.py b/tests/test_litellm/llms/databricks/chat/test_databricks_chat_transformation.pyindex 165046a2298..41fb2589655 100644--- a/tests/test_litellm/llms/databricks/chat/test_databricks_chat_transformation.py+++ b/tests/test_litellm/llms/databricks/chat/test_databricks_chat_transformation.py@@ -1,11 +1,8 @@import json-import os-import sysimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../../..")) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchfrom litellm.llms.databricks.chat.transformation import (diff --git a/tests/test_litellm/llms/databricks/responses/test_databricks_responses_transformation.py b/tests/test_litellm/llms/databricks/responses/test_databricks_responses_transformation.pyindex b4a368be81f..4420506bf91 100644--- a/tests/test_litellm/llms/databricks/responses/test_databricks_responses_transformation.py+++ b/tests/test_litellm/llms/databricks/responses/test_databricks_responses_transformation.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import patchimport litellmdiff --git a/tests/test_litellm/llms/databricks/test_databricks_common_utils.py b/tests/test_litellm/llms/databricks/test_databricks_common_utils.pyindex 7f7ec8e9000..ee50ffdabdc 100644--- a/tests/test_litellm/llms/databricks/test_databricks_common_utils.py+++ b/tests/test_litellm/llms/databricks/test_databricks_common_utils.py@@ -1,13 +1,8 @@import json-import os-import sysimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchfrom litellm.llms.databricks.common_utils import DatabricksBasediff --git a/tests/test_litellm/llms/databricks/test_databricks_partner_integration.py b/tests/test_litellm/llms/databricks/test_databricks_partner_integration.pyindex 139990021b4..86fdd89acf6 100644--- a/tests/test_litellm/llms/databricks/test_databricks_partner_integration.py+++ b/tests/test_litellm/llms/databricks/test_databricks_partner_integration.py@@ -23,15 +23,11 @@ These tests align with Databricks Partner Architecture best practices:"""import json-import osimport sysimport pytestfrom unittest.mock import MagicMock, patch, Mock-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.databricks.common_utils import DatabricksBase, DatabricksExceptiondiff --git a/tests/test_litellm/llms/deepgram/audio_transcription/test_deepgram_audio_transcription_transformation.py b/tests/test_litellm/llms/deepgram/audio_transcription/test_deepgram_audio_transcription_transformation.pyindex d59ab975ef2..7c1f5256deb 100644--- a/tests/test_litellm/llms/deepgram/audio_transcription/test_deepgram_audio_transcription_transformation.py+++ b/tests/test_litellm/llms/deepgram/audio_transcription/test_deepgram_audio_transcription_transformation.py@@ -1,14 +1,10 @@import ioimport osimport pathlib-import sysfrom unittest.mock import MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.base_llm.audio_transcription.transformation import (diff --git a/tests/test_litellm/llms/deepgram/test_deepgram_mock_transcription.py b/tests/test_litellm/llms/deepgram/test_deepgram_mock_transcription.pyindex 1f209004be8..e12b3982b13 100644--- a/tests/test_litellm/llms/deepgram/test_deepgram_mock_transcription.py+++ b/tests/test_litellm/llms/deepgram/test_deepgram_mock_transcription.py@@ -1,15 +1,10 @@import ioimport json-import os-import sysfrom typing import Anyfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.types.utils import TranscriptionResponsediff --git a/tests/test_litellm/llms/deepinfra/test_deepinfra_chat_transformation.py b/tests/test_litellm/llms/deepinfra/test_deepinfra_chat_transformation.pyindex ff309bc44ed..0865a14fbd9 100644--- a/tests/test_litellm/llms/deepinfra/test_deepinfra_chat_transformation.py+++ b/tests/test_litellm/llms/deepinfra/test_deepinfra_chat_transformation.py@@ -1,13 +1,11 @@import asyncioimport jsonimport os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest# Add litellm to path-sys.path.insert(0, os.path.abspath("../../../.."))import litellmdiff --git a/tests/test_litellm/llms/deepinfra/test_deepinfra_rerank.py b/tests/test_litellm/llms/deepinfra/test_deepinfra_rerank.pyindex a1e47f815e7..02161b38fb6 100644--- a/tests/test_litellm/llms/deepinfra/test_deepinfra_rerank.py+++ b/tests/test_litellm/llms/deepinfra/test_deepinfra_rerank.py@@ -4,14 +4,11 @@ Tests for DeepInfra rerank functionality following repository patterns.import asyncioimport json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest# Add litellm to path-sys.path.insert(0, os.path.abspath("../../../.."))import litellmdiff --git a/tests/test_litellm/llms/docker_model_runner/test_docker_model_runner_chat_transformation.py b/tests/test_litellm/llms/docker_model_runner/test_docker_model_runner_chat_transformation.pyindex 0b4a2a5de8c..8ab24c16f14 100644--- a/tests/test_litellm/llms/docker_model_runner/test_docker_model_runner_chat_transformation.py+++ b/tests/test_litellm/llms/docker_model_runner/test_docker_model_runner_chat_transformation.py@@ -5,10 +5,7 @@ This test validates that the DockerModelRunnerChatConfig correctly transformsrequests to the proper URL, headers, and body format."""-import os-import sys-sys.path.insert(0, os.path.abspath("../../../../.."))import jsonfrom typing import castdiff --git a/tests/test_litellm/llms/fal_ai/image_generation/test_fal_ai_nano_banana_transformation.py b/tests/test_litellm/llms/fal_ai/image_generation/test_fal_ai_nano_banana_transformation.pyindex c0f74eff51b..f26a6aeafda 100644--- a/tests/test_litellm/llms/fal_ai/image_generation/test_fal_ai_nano_banana_transformation.py+++ b/tests/test_litellm/llms/fal_ai/image_generation/test_fal_ai_nano_banana_transformation.py@@ -1,9 +1,7 @@import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True"diff --git a/tests/test_litellm/llms/featherless_ai/chat/test_featherless_chat_transformation.py b/tests/test_litellm/llms/featherless_ai/chat/test_featherless_chat_transformation.pyindex bf40abd7016..560eaf4f06b 100644--- a/tests/test_litellm/llms/featherless_ai/chat/test_featherless_chat_transformation.py+++ b/tests/test_litellm/llms/featherless_ai/chat/test_featherless_chat_transformation.py@@ -5,14 +5,9 @@ These tests validate the FeatherlessAIConfig class which extends OpenAIGPTConfigFeatherless AI is an OpenAI-compatible provider with a few customizations."""-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.featherless_ai.chat.transformation import FeatherlessAIConfigdiff --git a/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py b/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.pyindex b46ba081f6f..e728fc4bc40 100644--- a/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py+++ b/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py@@ -1,15 +1,10 @@import json-import os-import sysfrom unittest.mock import MagicMock, patchimport pytestimport litellm-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm import get_model_info, supports_reasoning, supports_visionfrom litellm.llms.fireworks_ai.chat.transformation import FireworksAIConfigdiff --git a/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_completion_transformation.py b/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_completion_transformation.pyindex 996f1fd975b..e1b88a9c78e 100644--- a/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_completion_transformation.py+++ b/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_completion_transformation.py@@ -1,7 +1,4 @@-import os-import sys-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.fireworks_ai.completion.transformation import (FireworksAITextCompletionConfig,diff --git a/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_text_completion_transformation.py b/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_text_completion_transformation.pyindex 4f76a39684a..e5a77aa8d41 100644--- a/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_text_completion_transformation.py+++ b/tests/test_litellm/llms/fireworks_ai/completion/test_fireworks_ai_text_completion_transformation.py@@ -1,13 +1,8 @@-import os-import sysimport pytestimport litellm-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.fireworks_ai.completion.transformation import (FireworksAITextCompletionConfig,diff --git a/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_common_utils.py b/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_common_utils.pyindex b52c910d5a6..16226a3ce74 100644--- a/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_common_utils.py+++ b/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_common_utils.py@@ -1,9 +1,6 @@-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.llms.fireworks_ai.common_utils import resolve_fireworks_resource_namediff --git a/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_cost_calculator.py b/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_cost_calculator.pyindex 3297750fa6e..f1664dabf48 100644--- a/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_cost_calculator.py+++ b/tests/test_litellm/llms/fireworks_ai/test_fireworks_ai_cost_calculator.py@@ -1,9 +1,6 @@-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.llms.fireworks_ai.cost_calculator import cost_per_tokendiff --git a/tests/test_litellm/llms/gdc/chat/test_gdc_chat_transformation.py b/tests/test_litellm/llms/gdc/chat/test_gdc_chat_transformation.pyindex d106cf7ea21..3153c12aa94 100644--- a/tests/test_litellm/llms/gdc/chat/test_gdc_chat_transformation.py+++ b/tests/test_litellm/llms/gdc/chat/test_gdc_chat_transformation.py@@ -1,11 +1,8 @@-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest# Adds the parent directory to the system path-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.llms.gdc.chat.transformation import GDCGeminiConfigdiff --git a/tests/test_litellm/llms/gemini/realtime/test_gemini_realtime_transformation.py b/tests/test_litellm/llms/gemini/realtime/test_gemini_realtime_transformation.pyindex 02004d5c8a8..deb148a07c0 100644--- a/tests/test_litellm/llms/gemini/realtime/test_gemini_realtime_transformation.py+++ b/tests/test_litellm/llms/gemini/realtime/test_gemini_realtime_transformation.py@@ -1,12 +1,9 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../..")) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.gemini.realtime.transformation import GeminiRealtimeConfigdiff --git a/tests/test_litellm/llms/gemini/test_gemini_tts.py b/tests/test_litellm/llms/gemini/test_gemini_tts.pyindex 98f3ac0f4e5..4893825373a 100644--- a/tests/test_litellm/llms/gemini/test_gemini_tts.py+++ b/tests/test_litellm/llms/gemini/test_gemini_tts.py@@ -2,14 +2,9 @@Test Gemini TTS (Text-to-Speech) functionality"""-import os-import sysimport pytestfrom unittest.mock import patch, MagicMock-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.gemini.chat.transformation import GoogleAIStudioGeminiConfigdiff --git a/tests/test_litellm/llms/github_copilot/embedding/test_github_copilot_embedding_transformation.py b/tests/test_litellm/llms/github_copilot/embedding/test_github_copilot_embedding_transformation.pyindex 90cf5a17398..f43e2e4d1cb 100644--- a/tests/test_litellm/llms/github_copilot/embedding/test_github_copilot_embedding_transformation.py+++ b/tests/test_litellm/llms/github_copilot/embedding/test_github_copilot_embedding_transformation.py@@ -1,10 +1,7 @@-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.exceptions import AuthenticationErrorfrom litellm.llms.github_copilot.embedding.transformation import (diff --git a/tests/test_litellm/llms/github_copilot/messages/test_github_copilot_messages_transformation.py b/tests/test_litellm/llms/github_copilot/messages/test_github_copilot_messages_transformation.pyindex 8ed84b3ed8d..8039e744f46 100644--- a/tests/test_litellm/llms/github_copilot/messages/test_github_copilot_messages_transformation.py+++ b/tests/test_litellm/llms/github_copilot/messages/test_github_copilot_messages_transformation.py@@ -1,10 +1,7 @@-import os-import sysfrom unittest.mock import MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.exceptions import AuthenticationErrorfrom litellm.llms.github_copilot.common_utils import GetAPIKeyErrordiff --git a/tests/test_litellm/llms/github_copilot/responses/test_github_copilot_responses_transformation.py b/tests/test_litellm/llms/github_copilot/responses/test_github_copilot_responses_transformation.pyindex 174efceb499..c761d084da8 100644--- a/tests/test_litellm/llms/github_copilot/responses/test_github_copilot_responses_transformation.py+++ b/tests/test_litellm/llms/github_copilot/responses/test_github_copilot_responses_transformation.py@@ -7,11 +7,8 @@ transformations for the Responses API.Source: litellm/llms/github_copilot/responses/transformation.py"""-import sys-import osfrom unittest.mock import patch, MagicMock-sys.path.insert(0, os.path.abspath("../../../../.."))import pytestimport litellmdiff --git a/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.py b/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.pyindex 51cffd5e51a..f1f1978b06f 100644--- a/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.py+++ b/tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.py@@ -1,14 +1,11 @@import asyncioimport json-import os-import sysfrom datetime import datetime, timedeltafrom typing import AsyncGeneratorfrom unittest.mock import AsyncMock, MagicMock, mock_open, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import httpxfrom respx import MockRouterdiff --git a/tests/test_litellm/llms/gradient_ai/chat/test_gradient_ai_chat_transformation.py b/tests/test_litellm/llms/gradient_ai/chat/test_gradient_ai_chat_transformation.pyindex 6eabf2472ea..6586f970b80 100644--- a/tests/test_litellm/llms/gradient_ai/chat/test_gradient_ai_chat_transformation.py+++ b/tests/test_litellm/llms/gradient_ai/chat/test_gradient_ai_chat_transformation.py@@ -1,10 +1,5 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.gradient_ai.chat.transformation import (GradientAIConfig,diff --git a/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_chat_transformation.py b/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_chat_transformation.pyindex 3ddb67b9f8d..e316cd14dd4 100644--- a/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_chat_transformation.py+++ b/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_chat_transformation.py@@ -1,11 +1,6 @@import json-import os-import sysfrom unittest.mock import MagicMock, patch-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.constants import (DEFAULT_REASONING_EFFORT_HIGH_THINKING_BUDGET,diff --git a/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_ssl_verify.py b/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_ssl_verify.pyindex 8f98b3ca8f1..2364468efe1 100644--- a/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_ssl_verify.py+++ b/tests/test_litellm/llms/hosted_vllm/chat/test_hosted_vllm_ssl_verify.py@@ -8,15 +8,10 @@ Issue: ssl_verify parameter was being ignored because hosted_vllm fell throughto the OpenAI catch-all path in main.py, which doesn't pass ssl_verify to the HTTP client."""-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_ssl_verify.py b/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_ssl_verify.pyindex bb911814c23..de94da49384 100644--- a/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_ssl_verify.py+++ b/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_ssl_verify.py@@ -8,15 +8,10 @@ Issue: ssl_verify parameter was being ignored because hosted_vllm fell throughto the openai_like catch-all path in main.py, which doesn't pass ssl_verify to the HTTP client."""-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_transformation.py b/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_transformation.pyindex 93c518599d6..34be3e12abd 100644--- a/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_transformation.py+++ b/tests/test_litellm/llms/hosted_vllm/embedding/test_hosted_vllm_embedding_transformation.py@@ -6,15 +6,10 @@ especially ensuring that encoding_format is not included when not provided."""import json-import os-import sysfrom unittest.mock import Mock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.hosted_vllm.embedding.transformation import (diff --git a/tests/test_litellm/llms/hosted_vllm/responses/test_hosted_vllm_responses.py b/tests/test_litellm/llms/hosted_vllm/responses/test_hosted_vllm_responses.pyindex eb578b86af0..e81bf0c4f1f 100644--- a/tests/test_litellm/llms/hosted_vllm/responses/test_hosted_vllm_responses.py+++ b/tests/test_litellm/llms/hosted_vllm/responses/test_hosted_vllm_responses.py@@ -8,15 +8,10 @@ hosted_vllm (and any OpenAI-compatible provider using add_provider_specific_para"""import json-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.hosted_vllm.responses.transformation import (diff --git a/tests/test_litellm/llms/huggingface/embedding/test_huggingface_embedding_handler.py b/tests/test_litellm/llms/huggingface/embedding/test_huggingface_embedding_handler.pyindex c907e3249d1..f1226311b5e 100644--- a/tests/test_litellm/llms/huggingface/embedding/test_huggingface_embedding_handler.py+++ b/tests/test_litellm/llms/huggingface/embedding/test_huggingface_embedding_handler.py@@ -1,11 +1,6 @@import json-import os-import sysfrom unittest.mock import patch, MagicMock, AsyncMock-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmimport pytestdiff --git a/tests/test_litellm/llms/jina_ai/embedding/test_jina_embedding_transformation.py b/tests/test_litellm/llms/jina_ai/embedding/test_jina_embedding_transformation.pyindex 9e761817ef5..38355f32da1 100644--- a/tests/test_litellm/llms/jina_ai/embedding/test_jina_embedding_transformation.py+++ b/tests/test_litellm/llms/jina_ai/embedding/test_jina_embedding_transformation.py@@ -1,10 +1,7 @@-import os-import sysfrom unittest.mock import MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../../../..")) # Adds the parent directory to the system pathfrom litellm.llms.jina_ai.embedding.transformation import JinaAIEmbeddingConfigdiff --git a/tests/test_litellm/llms/lemonade/test_lemonade.py b/tests/test_litellm/llms/lemonade/test_lemonade.pyindex cb70e7794a8..fa0d9d279a7 100644--- a/tests/test_litellm/llms/lemonade/test_lemonade.py+++ b/tests/test_litellm/llms/lemonade/test_lemonade.py@@ -1,9 +1,4 @@-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchimport litellmdiff --git a/tests/test_litellm/llms/manus/responses/test_manus_responses_transformation.py b/tests/test_litellm/llms/manus/responses/test_manus_responses_transformation.pyindex 43ce030323b..d6f76a16a9a 100644--- a/tests/test_litellm/llms/manus/responses/test_manus_responses_transformation.py+++ b/tests/test_litellm/llms/manus/responses/test_manus_responses_transformation.py@@ -7,10 +7,7 @@ transformations for the Responses API.Source: litellm/llms/manus/responses/transformation.py"""-import os-import sys-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.manus.responses.transformation import ManusResponsesAPIConfigfrom litellm.types.llms.openai import ResponsesAPIOptionalRequestParamsdiff --git a/tests/test_litellm/llms/meta_llama/test_meta_llama_chat_transformation.py b/tests/test_litellm/llms/meta_llama/test_meta_llama_chat_transformation.pyindex 7b974aba35c..15995d873c2 100644--- a/tests/test_litellm/llms/meta_llama/test_meta_llama_chat_transformation.py+++ b/tests/test_litellm/llms/meta_llama/test_meta_llama_chat_transformation.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.meta_llama.chat.transformation import LlamaAPIConfigdiff --git a/tests/test_litellm/llms/minimax/chat/test_transformation.py b/tests/test_litellm/llms/minimax/chat/test_transformation.pyindex 286498830c5..9d51b556500 100644--- a/tests/test_litellm/llms/minimax/chat/test_transformation.py+++ b/tests/test_litellm/llms/minimax/chat/test_transformation.py@@ -3,14 +3,10 @@ Test MiniMax OpenAI-compatible API support"""import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../")-) # Adds the parent directory to the system pathimport litellmfrom litellm import completiondiff --git a/tests/test_litellm/llms/minimax/messages/test_transformation.py b/tests/test_litellm/llms/minimax/messages/test_transformation.pyindex 6e4b0428bb9..01d32221fe5 100644--- a/tests/test_litellm/llms/minimax/messages/test_transformation.py+++ b/tests/test_litellm/llms/minimax/messages/test_transformation.py@@ -3,14 +3,10 @@ Test MiniMax Anthropic-compatible API support"""import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../")-) # Adds the parent directory to the system pathimport litellmfrom litellm import completiondiff --git a/tests/test_litellm/llms/mistral/test_mistral_chat_transformation.py b/tests/test_litellm/llms/mistral/test_mistral_chat_transformation.pyindex 55c5d05cdc0..15694d9f218 100644--- a/tests/test_litellm/llms/mistral/test_mistral_chat_transformation.py+++ b/tests/test_litellm/llms/mistral/test_mistral_chat_transformation.py@@ -1,5 +1,3 @@-import os-import sysfrom typing import List, castfrom unittest.mock import MagicMock, patch@@ -8,9 +6,6 @@ import pytestfrom litellm.litellm_core_utils.prompt_templates.common_utils import TOOL_RESULT_IMAGE_BOUNDARYfrom litellm.types.llms.openai import AllMessageValues-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom litellm.llms.mistral.chat.transformation import (MistralChatResponseIterator,diff --git a/tests/test_litellm/llms/modelscope/chat/test_modelscope_chat_transformation.py b/tests/test_litellm/llms/modelscope/chat/test_modelscope_chat_transformation.pyindex 2767deae176..6fe39798f4f 100644--- a/tests/test_litellm/llms/modelscope/chat/test_modelscope_chat_transformation.py+++ b/tests/test_litellm/llms/modelscope/chat/test_modelscope_chat_transformation.py@@ -7,11 +7,7 @@ ModelScope is an OpenAI-compatible provider with minor customizations.import jsonimport os-import sys-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import patchdiff --git a/tests/test_litellm/llms/modelscope/image_generation/test_modelscope_image_gen_transformation.py b/tests/test_litellm/llms/modelscope/image_generation/test_modelscope_image_gen_transformation.pyindex fbcec3d4d2e..2ffe7c3e686 100644--- a/tests/test_litellm/llms/modelscope/image_generation/test_modelscope_image_gen_transformation.py+++ b/tests/test_litellm/llms/modelscope/image_generation/test_modelscope_image_gen_transformation.py@@ -5,15 +5,10 @@ These tests validate the ModelScopeImageGenerationConfig class which handlestransformation between OpenAI-compatible format and ModelScope API format."""-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.modelscope.image_generation.transformation import (ModelScopeImageGenerationConfig,diff --git a/tests/test_litellm/llms/moonshot/test_moonshot_chat_transformation.py b/tests/test_litellm/llms/moonshot/test_moonshot_chat_transformation.pyindex 417dd4a767c..50f476eaaaa 100644--- a/tests/test_litellm/llms/moonshot/test_moonshot_chat_transformation.py+++ b/tests/test_litellm/llms/moonshot/test_moonshot_chat_transformation.py@@ -5,11 +5,8 @@ These tests validate the MoonshotChatConfig class which extends OpenAIGPTConfig.Moonshot AI is an OpenAI-compatible provider with minor customizations."""-import os-import sysfrom unittest.mock import patch-sys.path.insert(0, os.path.abspath("../../../../..")) # Adds the parent directory to the system pathimport pytestdiff --git a/tests/test_litellm/llms/nebius/test_nebius_chat_transformation.py b/tests/test_litellm/llms/nebius/test_nebius_chat_transformation.pyindex cb15dd3fa3e..6d77e81b767 100644--- a/tests/test_litellm/llms/nebius/test_nebius_chat_transformation.py+++ b/tests/test_litellm/llms/nebius/test_nebius_chat_transformation.py@@ -5,12 +5,7 @@ These tests validate the NebiusConfig class which extends OpenAIGPTConfig.Nebius AI Studio is an OpenAI-compatible provider with minor customizations."""-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport pytestdiff --git a/tests/test_litellm/llms/novita/chat/test_novita_chat_transformation.py b/tests/test_litellm/llms/novita/chat/test_novita_chat_transformation.pyindex ade5e4176e8..3f2a3f77c41 100644--- a/tests/test_litellm/llms/novita/chat/test_novita_chat_transformation.py+++ b/tests/test_litellm/llms/novita/chat/test_novita_chat_transformation.py@@ -5,16 +5,11 @@ These tests validate the NovitaConfig class which extends OpenAIGPTConfig.Novita AI is an OpenAI-compatible provider with a few customizations."""-import os-import sysfrom typing import Dict, List, Optionalfrom unittest.mock import patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.novita.chat.transformation import NovitaConfigdiff --git a/tests/test_litellm/llms/nscale/chat/test_nscale_chat_transformation.py b/tests/test_litellm/llms/nscale/chat/test_nscale_chat_transformation.pyindex 4fcd79ae2a1..415ce9ce9c9 100644--- a/tests/test_litellm/llms/nscale/chat/test_nscale_chat_transformation.py+++ b/tests/test_litellm/llms/nscale/chat/test_nscale_chat_transformation.py@@ -1,10 +1,6 @@import os-import sysfrom unittest.mock import patch-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.nscale.chat.transformation import NscaleConfigdiff --git a/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_audio_utils.py b/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_audio_utils.pyindex 0e355b91ca8..63a53c2c97b 100644--- a/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_audio_utils.py+++ b/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_audio_utils.py@@ -15,7 +15,6 @@ import numpy as npimport pytestimport soundfile as sf-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.nvidia_riva.audio_transcription.audio_utils import (resample_to_riva_pcm,diff --git a/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_handler.py b/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_handler.pyindex 341a0e77ce0..7ecc0b47d9f 100644--- a/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_handler.py+++ b/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_handler.py@@ -9,8 +9,6 @@ is aggregated.import asyncioimport io-import os-import sysfrom types import SimpleNamespacefrom unittest.mock import MagicMock@@ -18,7 +16,6 @@ import numpy as npimport pytestimport soundfile as sf-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.nvidia_riva.audio_transcription import handler as handler_modfrom litellm.llms.nvidia_riva.audio_transcription.handler import (diff --git a/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_transformation.py b/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_transformation.pyindex c4cca8490bf..38489328e30 100644--- a/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_transformation.py+++ b/tests/test_litellm/llms/nvidia_riva/audio_transcription/test_transformation.py@@ -5,12 +5,9 @@ These tests do not require ``nvidia-riva-client`` or any audio libs to beinstalled; the transformation layer is intentionally pure-Python on dicts."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.base_llm.audio_transcription.transformation import (AudioTranscriptionRequestData,diff --git a/tests/test_litellm/llms/oci/chat/test_oci_chat_transformation.py b/tests/test_litellm/llms/oci/chat/test_oci_chat_transformation.pyindex 5aa96a66d2d..86c534c73c2 100644--- a/tests/test_litellm/llms/oci/chat/test_oci_chat_transformation.py+++ b/tests/test_litellm/llms/oci/chat/test_oci_chat_transformation.py@@ -1,6 +1,4 @@import datetime-import os-import sysimport httpximport pytestimport json@@ -8,7 +6,6 @@ import jsonimport litellm# Adds the parent directory to the system path-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm import ModelResponsefrom litellm.constants import DEFAULT_OCI_CHAT_MAX_TOKENSdiff --git a/tests/test_litellm/llms/oci/chat/test_oci_streaming_tool_calls.py b/tests/test_litellm/llms/oci/chat/test_oci_streaming_tool_calls.pyindex acad5da93e2..002def9196d 100644--- a/tests/test_litellm/llms/oci/chat/test_oci_streaming_tool_calls.py+++ b/tests/test_litellm/llms/oci/chat/test_oci_streaming_tool_calls.py@@ -9,10 +9,7 @@ Issue: OCI API returns tool calls with incomplete structures during streamingError: ValidationError: 1 validation error for OCIStreamChunk message.toolCalls.0.arguments Field required"""-import os-import sys-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.oci.chat.generic import handle_generic_stream_chunkfrom litellm.types.utils import ModelResponseStreamdiff --git a/tests/test_litellm/llms/oci/embed/test_oci_embed_transformation.py b/tests/test_litellm/llms/oci/embed/test_oci_embed_transformation.pyindex 30f49bea344..363c0b46809 100644--- a/tests/test_litellm/llms/oci/embed/test_oci_embed_transformation.py+++ b/tests/test_litellm/llms/oci/embed/test_oci_embed_transformation.py@@ -5,15 +5,12 @@ These tests exercise the transformation layer only — no real OCI calls are mad"""import json-import os-import sysfrom typing import Anyfrom unittest.mock import MagicMockimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.oci.common_utils import OCIErrorfrom litellm.llms.oci.embed.transformation import OCI_EMBED_BATCH_LIMIT, OCIEmbedConfigdiff --git a/tests/test_litellm/llms/oci/embed/test_oci_embedding.py b/tests/test_litellm/llms/oci/embed/test_oci_embedding.pyindex 61c13ad62a1..46a91520ab0 100644--- a/tests/test_litellm/llms/oci/embed/test_oci_embedding.py+++ b/tests/test_litellm/llms/oci/embed/test_oci_embedding.py@@ -1,12 +1,10 @@import jsonimport os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.oci.embed.transformation import OCIEmbeddingConfigfrom litellm.types.utils import EmbeddingResponsediff --git a/tests/test_litellm/llms/ocr/guardrail_translation/test_ocr_guardrail_handler.py b/tests/test_litellm/llms/ocr/guardrail_translation/test_ocr_guardrail_handler.pyindex f6151497e1c..525788c158a 100644--- a/tests/test_litellm/llms/ocr/guardrail_translation/test_ocr_guardrail_handler.py+++ b/tests/test_litellm/llms/ocr/guardrail_translation/test_ocr_guardrail_handler.py@@ -2,13 +2,10 @@Unit tests for OCR Guardrail Translation Handler"""-import osimport re-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.llms import get_guardrail_translation_mappingdiff --git a/tests/test_litellm/llms/ollama/test_ollama_completion_transformation.py b/tests/test_litellm/llms/ollama/test_ollama_completion_transformation.pyindex dd59cdcac1c..acd69b94d02 100644--- a/tests/test_litellm/llms/ollama/test_ollama_completion_transformation.py+++ b/tests/test_litellm/llms/ollama/test_ollama_completion_transformation.py@@ -1,14 +1,9 @@import json-import os-import sysfrom litellm._uuid import uuidfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.ollama.completion.transformation import (OllamaConfig,diff --git a/tests/test_litellm/llms/ollama/test_ollama_model_info.py b/tests/test_litellm/llms/ollama/test_ollama_model_info.pyindex 8d46151ecce..053d4da035f 100644--- a/tests/test_litellm/llms/ollama/test_ollama_model_info.py+++ b/tests/test_litellm/llms/ollama/test_ollama_model_info.py@@ -3,15 +3,11 @@ import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system path"""Unit tests for OllamaModelInfo.get_models functionality."""# Ensure a dummy httpx module is available for import in tests-import sysimport types# Provide a dummy httpx module for import in get_modelsdiff --git a/tests/test_litellm/llms/oobabooga/chat/test_oobabooga.py b/tests/test_litellm/llms/oobabooga/chat/test_oobabooga.pyindex 91ebb2bd9d4..395a4fb5715 100644--- a/tests/test_litellm/llms/oobabooga/chat/test_oobabooga.py+++ b/tests/test_litellm/llms/oobabooga/chat/test_oobabooga.py@@ -1,8 +1,5 @@-import os-import sysfrom unittest.mock import MagicMock, patch-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmdiff --git a/tests/test_litellm/llms/openai/chat/guardrail_translation/test_openai_guardrail_handler.py b/tests/test_litellm/llms/openai/chat/guardrail_translation/test_openai_guardrail_handler.pyindex 2e75f29b1c5..a29e0be4655 100644--- a/tests/test_litellm/llms/openai/chat/guardrail_translation/test_openai_guardrail_handler.py+++ b/tests/test_litellm/llms/openai/chat/guardrail_translation/test_openai_guardrail_handler.py@@ -6,15 +6,10 @@ with guardrail transformations, including tool calls."""import json-import os-import sysfrom typing import Any, Literal, Optionalimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../../../..")-) # Adds the parent directory to the system pathfrom litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.llms.openai.chat.guardrail_translation.handler import (diff --git a/tests/test_litellm/llms/openai/chat/test_openai_gpt_transformation.py b/tests/test_litellm/llms/openai/chat/test_openai_gpt_transformation.pyindex 101c5363bf7..f4c38f8f797 100644--- a/tests/test_litellm/llms/openai/chat/test_openai_gpt_transformation.py+++ b/tests/test_litellm/llms/openai/chat/test_openai_gpt_transformation.py@@ -2,12 +2,9 @@Tests for OpenAI GPT transformation (litellm/llms/openai/chat/gpt_transformation.py)"""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.litellm_core_utils.prompt_templates.common_utils import TOOL_RESULT_IMAGE_BOUNDARYdiff --git a/tests/test_litellm/llms/openai/completion/test_completion_handler.py b/tests/test_litellm/llms/openai/completion/test_completion_handler.pyindex c6af96fa375..329956605ab 100644--- a/tests/test_litellm/llms/openai/completion/test_completion_handler.py+++ b/tests/test_litellm/llms/openai/completion/test_completion_handler.py@@ -5,14 +5,11 @@ text completion path.Regression tests for https://github.com/BerriAI/litellm/issues/27410"""-import os-import sysimport pytestimport respxfrom httpx import Response-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm import atext_completion, text_completiondiff --git a/tests/test_litellm/llms/openai/completion/test_text_completion_guardrail_handler.py b/tests/test_litellm/llms/openai/completion/test_text_completion_guardrail_handler.pyindex 257db89d073..c96fbf34fe1 100644--- a/tests/test_litellm/llms/openai/completion/test_text_completion_guardrail_handler.py+++ b/tests/test_litellm/llms/openai/completion/test_text_completion_guardrail_handler.py@@ -2,14 +2,11 @@Unit tests for OpenAI Text Completion Guardrail Translation Handler"""-import os-import sysfrom typing import List, Optional, Tuplefrom unittest.mock import MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.llms import get_guardrail_translation_mappingdiff --git a/tests/test_litellm/llms/openai/completion/test_text_completion_token_ids.py b/tests/test_litellm/llms/openai/completion/test_text_completion_token_ids.pyindex 9c612af3898..35faeeb268a 100644--- a/tests/test_litellm/llms/openai/completion/test_text_completion_token_ids.py+++ b/tests/test_litellm/llms/openai/completion/test_text_completion_token_ids.py@@ -3,14 +3,11 @@ Unit tests for text_completion with token IDs (list of integers) as prompt.Tests the fix for https://github.com/BerriAI/litellm/issues/17118"""-import os-import sysimport pytestimport respxfrom httpx import Response-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm import text_completiondiff --git a/tests/test_litellm/llms/openai/image_generation/test_image_generation_guardrail_handler.py b/tests/test_litellm/llms/openai/image_generation/test_image_generation_guardrail_handler.pyindex cfccd6f3bbe..0d699b1ec95 100644--- a/tests/test_litellm/llms/openai/image_generation/test_image_generation_guardrail_handler.py+++ b/tests/test_litellm/llms/openai/image_generation/test_image_generation_guardrail_handler.py@@ -2,13 +2,10 @@Unit tests for OpenAI Image Generation Guardrail Translation Handler"""-import os-import sysfrom typing import List, Optional, Tupleimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.llms import get_guardrail_translation_mappingdiff --git a/tests/test_litellm/llms/openai/image_generation/test_openai_image_generation_extra_headers.py b/tests/test_litellm/llms/openai/image_generation/test_openai_image_generation_extra_headers.pyindex 33db9d33c1c..06871edb773 100644--- a/tests/test_litellm/llms/openai/image_generation/test_openai_image_generation_extra_headers.py+++ b/tests/test_litellm/llms/openai/image_generation/test_openai_image_generation_extra_headers.py@@ -6,13 +6,10 @@ litellm.aimage_generation() are forwarded to the OpenAI API client asextra_headers in the images.generate() call."""-import os-import sysfrom unittest.mock import MagicMock, AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.openai.openai import OpenAIChatCompletiondiff --git a/tests/test_litellm/llms/openai/realtime/test_openai_realtime_handler.py b/tests/test_litellm/llms/openai/realtime/test_openai_realtime_handler.pyindex 2633e76b0f3..4221954d787 100644--- a/tests/test_litellm/llms/openai/realtime/test_openai_realtime_handler.py+++ b/tests/test_litellm/llms/openai/realtime/test_openai_realtime_handler.py@@ -1,6 +1,4 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpx@@ -8,9 +6,6 @@ import pytestfrom litellm.llms.custom_httpx.http_handler import get_shared_realtime_ssl_context-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system path@pytest.mark.parametrize(diff --git a/tests/test_litellm/llms/openai/realtime/test_transcription_sessions.py b/tests/test_litellm/llms/openai/realtime/test_transcription_sessions.pyindex 62fc3a8d0aa..54f206d098d 100644--- a/tests/test_litellm/llms/openai/realtime/test_transcription_sessions.py+++ b/tests/test_litellm/llms/openai/realtime/test_transcription_sessions.py@@ -5,14 +5,11 @@ Tests for the Realtime transcription_sessions surface used by gpt-realtime-whisp- BaseLLMHTTPHandler.async_realtime_transcription_session_handler targeting"""-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.azure.realtime.http_transformation import AzureRealtimeHTTPConfigfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandlerdiff --git a/tests/test_litellm/llms/openai/responses/test_openai_count_tokens_transformation.py b/tests/test_litellm/llms/openai/responses/test_openai_count_tokens_transformation.pyindex 195fba69010..e1cc6a92927 100644--- a/tests/test_litellm/llms/openai/responses/test_openai_count_tokens_transformation.py+++ b/tests/test_litellm/llms/openai/responses/test_openai_count_tokens_transformation.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.openai.responses.count_tokens.transformation import (OpenAICountTokensConfig,)diff --git a/tests/test_litellm/llms/openai/responses/test_openai_responses_guardrail_handler.py b/tests/test_litellm/llms/openai/responses/test_openai_responses_guardrail_handler.pyindex 4c45eaac7b9..447175b09a6 100644--- a/tests/test_litellm/llms/openai/responses/test_openai_responses_guardrail_handler.py+++ b/tests/test_litellm/llms/openai/responses/test_openai_responses_guardrail_handler.py@@ -5,16 +5,11 @@ Tests the handler's ability to process input/output for the Responses APIwith guardrail transformations."""-import os-import sysfrom typing import Any, List, Literal, Optional, Tuplefrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../../..")-) # Adds the parent directory to the system pathfrom fastapi import HTTPExceptionfrom openai.types.responses import ResponseFunctionToolCalldiff --git a/tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py b/tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.pyindex 13b96dc9943..c03c632363d 100644--- a/tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py+++ b/tests/test_litellm/llms/openai/responses/test_openai_responses_transformation.py@@ -1,14 +1,9 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, Mock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.base_llm.responses.transformation import BaseResponsesAPIConfigdiff --git a/tests/test_litellm/llms/openai/speech/test_text_to_speech_guardrail_handler.py b/tests/test_litellm/llms/openai/speech/test_text_to_speech_guardrail_handler.pyindex 5b6387cb100..88149d82c52 100644--- a/tests/test_litellm/llms/openai/speech/test_text_to_speech_guardrail_handler.py+++ b/tests/test_litellm/llms/openai/speech/test_text_to_speech_guardrail_handler.py@@ -2,13 +2,10 @@Unit tests for OpenAI Text-to-Speech Guardrail Translation Handler"""-import os-import sysfrom typing import List, Optional, Tupleimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.llms import get_guardrail_translation_mappingdiff --git a/tests/test_litellm/llms/openai/test_openai_common_utils.py b/tests/test_litellm/llms/openai/test_openai_common_utils.pyindex bef8d02b0df..3ae29e411e8 100644--- a/tests/test_litellm/llms/openai/test_openai_common_utils.py+++ b/tests/test_litellm/llms/openai/test_openai_common_utils.py@@ -1,14 +1,9 @@-import os-import sysfrom unittest.mock import MagicMock, call, patchimport httpximport openaiimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.litellm_core_utils.token_counter import token_counterdiff --git a/tests/test_litellm/llms/openai/test_openai_empty_response.py b/tests/test_litellm/llms/openai/test_openai_empty_response.pyindex 8a0ff237869..26b28f967db 100644--- a/tests/test_litellm/llms/openai/test_openai_empty_response.py+++ b/tests/test_litellm/llms/openai/test_openai_empty_response.py@@ -2,13 +2,10 @@Test for issue #17209: Clearer error when LLM endpoint returns empty response"""-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.llms.openai.openai import OpenAIChatCompletionfrom litellm.llms.openai.common_utils import OpenAIErrordiff --git a/tests/test_litellm/llms/openai/test_use_chat_completions_api_no_leak.py b/tests/test_litellm/llms/openai/test_use_chat_completions_api_no_leak.pyindex 9a266fca81f..7013afc7a5f 100644--- a/tests/test_litellm/llms/openai/test_use_chat_completions_api_no_leak.py+++ b/tests/test_litellm/llms/openai/test_use_chat_completions_api_no_leak.py@@ -7,11 +7,8 @@ proxy config, it must never be forwarded to the upstream provider's requestbody. OpenAI/Anthropic reject unknown body params with HTTP 400."""-import os-import sysfrom unittest.mock import MagicMock-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.types.utils import all_litellm_paramsdiff --git a/tests/test_litellm/llms/openai/transcriptions/test_audio_transcription_guardrail_handler.py b/tests/test_litellm/llms/openai/transcriptions/test_audio_transcription_guardrail_handler.pyindex 307972ff477..269cbc7855d 100644--- a/tests/test_litellm/llms/openai/transcriptions/test_audio_transcription_guardrail_handler.py+++ b/tests/test_litellm/llms/openai/transcriptions/test_audio_transcription_guardrail_handler.py@@ -2,13 +2,10 @@Unit tests for OpenAI Audio Transcription Guardrail Translation Handler"""-import os-import sysfrom typing import List, Optional, Tupleimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.integrations.custom_guardrail import CustomGuardrailfrom litellm.llms import get_guardrail_translation_mappingdiff --git a/tests/test_litellm/llms/openrouter/chat/test_openrouter_chat_transformation.py b/tests/test_litellm/llms/openrouter/chat/test_openrouter_chat_transformation.pyindex 8d1129cc5da..b177b80aed1 100644--- a/tests/test_litellm/llms/openrouter/chat/test_openrouter_chat_transformation.py+++ b/tests/test_litellm/llms/openrouter/chat/test_openrouter_chat_transformation.py@@ -1,12 +1,7 @@-import os-import sysimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.openai.chat.gpt_transformation import OpenAIGPTConfigfrom litellm.llms.openrouter.chat.transformation import (diff --git a/tests/test_litellm/llms/openrouter/image_edit/test_openrouter_image_edit_transformation.py b/tests/test_litellm/llms/openrouter/image_edit/test_openrouter_image_edit_transformation.pyindex f352c077fc4..5a78560f61b 100644--- a/tests/test_litellm/llms/openrouter/image_edit/test_openrouter_image_edit_transformation.py+++ b/tests/test_litellm/llms/openrouter/image_edit/test_openrouter_image_edit_transformation.py@@ -1,16 +1,11 @@import base64import json-import os-import sysfrom io import BytesIOfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.openrouter.common_utils import OpenRouterExceptionfrom litellm.llms.openrouter.image_edit.transformation import (diff --git a/tests/test_litellm/llms/openrouter/image_generation/test_openrouter_image_gen_transformation.py b/tests/test_litellm/llms/openrouter/image_generation/test_openrouter_image_gen_transformation.pyindex 52a4fabaed7..e45270fb5e3 100644--- a/tests/test_litellm/llms/openrouter/image_generation/test_openrouter_image_gen_transformation.py+++ b/tests/test_litellm/llms/openrouter/image_generation/test_openrouter_image_gen_transformation.py@@ -1,14 +1,9 @@import json-import os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.openrouter.image_generation.transformation import (OpenRouterImageGenerationConfig,diff --git a/tests/test_litellm/llms/openrouter/test_openrouter_provider_routing.py b/tests/test_litellm/llms/openrouter/test_openrouter_provider_routing.pyindex 0815b15c873..d2e4e88e77f 100644--- a/tests/test_litellm/llms/openrouter/test_openrouter_provider_routing.py+++ b/tests/test_litellm/llms/openrouter/test_openrouter_provider_routing.py@@ -11,12 +11,9 @@ so the correct model ID is sent to the OpenRouter API.See: https://github.com/BerriAI/litellm/issues/16353"""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmdiff --git a/tests/test_litellm/llms/ovhcloud/test_ovhcloud_chat_transformation.py b/tests/test_litellm/llms/ovhcloud/test_ovhcloud_chat_transformation.pyindex 40d57c76d02..057ab9ede9a 100644--- a/tests/test_litellm/llms/ovhcloud/test_ovhcloud_chat_transformation.py+++ b/tests/test_litellm/llms/ovhcloud/test_ovhcloud_chat_transformation.py@@ -3,16 +3,12 @@ Unit tests for OVHCloud AI Endpoints chat integration."""import os-import sysimport pytestfrom litellm.llms.ovhcloud.utils import OVHCloudExceptionfrom litellm.utils import get_optional_params-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.ovhcloud.chat.transformation import (OVHCloudChatCompletionStreamingHandler,@@ -179,7 +175,6 @@ class TestOVHCloudConfig:def test_ovhcloud_integration():- import osfrom litellm import completionapi_key = os.getenv("OVHCLOUD_API_KEY")@@ -207,7 +202,6 @@ def test_OVHCloud_streaming_integration():Integration test for streaming - requires real API keyRun with: pytest -k test_OVHCloud_streaming_integration -s"""- import osfrom litellm import completionapi_key = os.getenv("OVHCLOUD_API_KEY")@@ -262,7 +256,6 @@ def test_ovhcloud_with_custom_base_url():"""Test OVHCloud with custom base URL"""- import osfrom litellm import completionapi_key = os.getenv("OVHCLOUD_API_KEY")diff --git a/tests/test_litellm/llms/parallel_ai/test_parallel_ai_search.py b/tests/test_litellm/llms/parallel_ai/test_parallel_ai_search.pyindex 7be295826e3..8a9ae4dae6d 100644--- a/tests/test_litellm/llms/parallel_ai/test_parallel_ai_search.py+++ b/tests/test_litellm/llms/parallel_ai/test_parallel_ai_search.py@@ -2,13 +2,10 @@Tests for Parallel AI Search API integration (v1 endpoint)."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmdiff --git a/tests/test_litellm/llms/perplexity/chat/test_perplexity_chat_transformation.py b/tests/test_litellm/llms/perplexity/chat/test_perplexity_chat_transformation.pyindex af441313d58..29d185b686d 100644--- a/tests/test_litellm/llms/perplexity/chat/test_perplexity_chat_transformation.py+++ b/tests/test_litellm/llms/perplexity/chat/test_perplexity_chat_transformation.py@@ -5,14 +5,11 @@ Tests the response transformation to extract citation tokens and search queriesfrom Perplexity API responses."""-import os-import sysfrom unittest.mock import Mockimport pytest# Add the project root to Python path-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm import ModelResponsefrom litellm.llms.perplexity.chat.transformation import PerplexityChatConfigdiff --git a/tests/test_litellm/llms/perplexity/responses/test_perplexity_responses_transformation.py b/tests/test_litellm/llms/perplexity/responses/test_perplexity_responses_transformation.pyindex a3ec81c569c..534176e381a 100644--- a/tests/test_litellm/llms/perplexity/responses/test_perplexity_responses_transformation.py+++ b/tests/test_litellm/llms/perplexity/responses/test_perplexity_responses_transformation.py@@ -8,13 +8,10 @@ Source: litellm/llms/perplexity/responses/transformation.py"""import json-import os-import sysimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjfrom litellm.llms.base_llm.chat.transformation import BaseLLMExceptiondiff --git a/tests/test_litellm/llms/perplexity/test_perplexity.py b/tests/test_litellm/llms/perplexity/test_perplexity.pyindex c6fb819e97b..797a56070c6 100644--- a/tests/test_litellm/llms/perplexity/test_perplexity.py+++ b/tests/test_litellm/llms/perplexity/test_perplexity.py@@ -1,7 +1,4 @@-import os-import sys-sys.path.insert(0, os.path.abspath("../../.."))import pytestdiff --git a/tests/test_litellm/llms/perplexity/test_perplexity_cost_calculator.py b/tests/test_litellm/llms/perplexity/test_perplexity_cost_calculator.pyindex 16708e062e4..117379c331a 100644--- a/tests/test_litellm/llms/perplexity/test_perplexity_cost_calculator.py+++ b/tests/test_litellm/llms/perplexity/test_perplexity_cost_calculator.py@@ -8,13 +8,11 @@ search queries, and reasoning tokens.import jsonimport mathimport os-import sysfrom unittest.mock import patchimport pytest# Add the project root to Python path-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.cost_calculator import completion_cost, cost_per_tokendiff --git a/tests/test_litellm/llms/perplexity/test_perplexity_integration.py b/tests/test_litellm/llms/perplexity/test_perplexity_integration.pyindex 8691e6a1ee5..990fa7eb464 100644--- a/tests/test_litellm/llms/perplexity/test_perplexity_integration.py+++ b/tests/test_litellm/llms/perplexity/test_perplexity_integration.py@@ -8,12 +8,10 @@ including integration with the main LiteLLM cost calculator.import jsonimport mathimport os-import sysimport pytest# Add the project root to Python path-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm import ModelResponsediff --git a/tests/test_litellm/llms/publicai/test_publicai_chat_transformation.py b/tests/test_litellm/llms/publicai/test_publicai_chat_transformation.pyindex 2dabf604b98..487f311b2fc 100644--- a/tests/test_litellm/llms/publicai/test_publicai_chat_transformation.py+++ b/tests/test_litellm/llms/publicai/test_publicai_chat_transformation.py@@ -5,11 +5,8 @@ These tests validate the PublicAI configuration which is now JSON-based.PublicAI is an OpenAI-compatible provider with minor customizations."""-import os-import sysfrom unittest.mock import patch-sys.path.insert(0, os.path.abspath("../../../../.."))import pytestdiff --git a/tests/test_litellm/llms/ragflow/chat/test_ragflow_chat_transformation.py b/tests/test_litellm/llms/ragflow/chat/test_ragflow_chat_transformation.pyindex baf2ab33910..437f53fea1a 100644--- a/tests/test_litellm/llms/ragflow/chat/test_ragflow_chat_transformation.py+++ b/tests/test_litellm/llms/ragflow/chat/test_ragflow_chat_transformation.py@@ -6,13 +6,11 @@ for RAGFlow's OpenAI-compatible API with custom path structures."""import os-import sysfrom unittest.mock import Mock, patchimport pytest# Add the project root to Python path-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.llms.ragflow.chat.transformation import RAGFlowConfigdiff --git a/tests/test_litellm/llms/recraft/image_edit/test_recraft_image_edit_transformation.py b/tests/test_litellm/llms/recraft/image_edit/test_recraft_image_edit_transformation.pyindex 47811321133..97d65935a1b 100644--- a/tests/test_litellm/llms/recraft/image_edit/test_recraft_image_edit_transformation.py+++ b/tests/test_litellm/llms/recraft/image_edit/test_recraft_image_edit_transformation.py@@ -1,6 +1,4 @@import json-import os-import sysfrom io import BufferedReader, BytesIOfrom typing import Dict, Listfrom unittest.mock import MagicMock, mock_open, patch@@ -8,9 +6,6 @@ from unittest.mock import MagicMock, mock_open, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.recraft.image_edit.transformation import RecraftImageEditConfigfrom litellm.types.images.main import ImageEditOptionalRequestParamsdiff --git a/tests/test_litellm/llms/recraft/image_generation/test_recraft_image_gen_transformation.py b/tests/test_litellm/llms/recraft/image_generation/test_recraft_image_gen_transformation.pyindex ccc72dde7b8..2dfe33b828c 100644--- a/tests/test_litellm/llms/recraft/image_generation/test_recraft_image_gen_transformation.py+++ b/tests/test_litellm/llms/recraft/image_generation/test_recraft_image_gen_transformation.py@@ -1,15 +1,10 @@import json-import os-import sysfrom typing import List, Optionalfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.recraft.image_generation.transformation import (RecraftImageGenerationConfig,diff --git a/tests/test_litellm/llms/runwayml/test_text_to_speech_transformation.py b/tests/test_litellm/llms/runwayml/test_text_to_speech_transformation.pyindex 8871260813d..2e4d68a02da 100644--- a/tests/test_litellm/llms/runwayml/test_text_to_speech_transformation.py+++ b/tests/test_litellm/llms/runwayml/test_text_to_speech_transformation.py@@ -2,10 +2,7 @@Test RunwayML text-to-speech transformation"""-import os-import sys-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.llms.runwayml.text_to_speech.transformation import (RunwayMLTextToSpeechConfig,diff --git a/tests/test_litellm/llms/sagemaker/test_sagemaker_common_utils.py b/tests/test_litellm/llms/sagemaker/test_sagemaker_common_utils.pyindex f928964dab8..e2dd3bca74f 100644--- a/tests/test_litellm/llms/sagemaker/test_sagemaker_common_utils.py+++ b/tests/test_litellm/llms/sagemaker/test_sagemaker_common_utils.py@@ -1,12 +1,9 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.sagemaker.common_utils import AWSEventStreamDecoderfrom litellm.llms.sagemaker.completion.transformation import SagemakerConfigdiff --git a/tests/test_litellm/llms/sagemaker/test_sagemaker_embedding_role_assumption.py b/tests/test_litellm/llms/sagemaker/test_sagemaker_embedding_role_assumption.pyindex c7ffe727d1a..2a14d58a187 100644--- a/tests/test_litellm/llms/sagemaker/test_sagemaker_embedding_role_assumption.py+++ b/tests/test_litellm/llms/sagemaker/test_sagemaker_embedding_role_assumption.py@@ -7,12 +7,9 @@ matching the behavior of the completion handler."""import json-import os-import sysfrom datetime import timezonefrom unittest.mock import MagicMock, call, patch-sys.path.insert(0, os.path.abspath("../../../../.."))from botocore.credentials import Credentialsdiff --git a/tests/test_litellm/llms/sagemaker/test_sagemaker_embedding_voyage.py b/tests/test_litellm/llms/sagemaker/test_sagemaker_embedding_voyage.pyindex 943a3160bb7..3951b17db92 100644--- a/tests/test_litellm/llms/sagemaker/test_sagemaker_embedding_voyage.py+++ b/tests/test_litellm/llms/sagemaker/test_sagemaker_embedding_voyage.py@@ -7,14 +7,11 @@ transformation, and model type detection."""import json-import os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm import embeddingfrom litellm.llms.sagemaker.embedding.cohere_transformation import (diff --git a/tests/test_litellm/llms/test_cache_control_and_reasoning.py b/tests/test_litellm/llms/test_cache_control_and_reasoning.pyindex 42f754bc093..be1ba1e7dbd 100644--- a/tests/test_litellm/llms/test_cache_control_and_reasoning.py+++ b/tests/test_litellm/llms/test_cache_control_and_reasoning.py@@ -7,14 +7,9 @@ This test file verifies the fixes for Issue #19923:- Model metadata correctly reflects capabilities"""-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.minimax.chat.transformation import MinimaxChatConfigfrom litellm.llms.openrouter.chat.transformation import OpenrouterConfigdiff --git a/tests/test_litellm/llms/vercel_ai_gateway/chat/test_vercel_ai_gateway_transformation.py b/tests/test_litellm/llms/vercel_ai_gateway/chat/test_vercel_ai_gateway_transformation.pyindex f6ac8af1115..a58942559fd 100644--- a/tests/test_litellm/llms/vercel_ai_gateway/chat/test_vercel_ai_gateway_transformation.py+++ b/tests/test_litellm/llms/vercel_ai_gateway/chat/test_vercel_ai_gateway_transformation.py@@ -1,12 +1,7 @@-import os-import sysfrom unittest.mock import patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.vercel_ai_gateway.chat.transformation import (VercelAIGatewayConfig,diff --git a/tests/test_litellm/llms/vercel_ai_gateway/embedding/test_vercel_ai_gateway_embedding.py b/tests/test_litellm/llms/vercel_ai_gateway/embedding/test_vercel_ai_gateway_embedding.pyindex af1e1df92fd..7ce91558f39 100644--- a/tests/test_litellm/llms/vercel_ai_gateway/embedding/test_vercel_ai_gateway_embedding.py+++ b/tests/test_litellm/llms/vercel_ai_gateway/embedding/test_vercel_ai_gateway_embedding.py@@ -1,13 +1,9 @@import os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.vercel_ai_gateway.embedding.transformation import (VercelAIGatewayEmbeddingConfig,diff --git a/tests/test_litellm/llms/vertex_ai/agent_engine/test_transformation.py b/tests/test_litellm/llms/vertex_ai/agent_engine/test_transformation.pyindex af0faee9e21..19616682c59 100644--- a/tests/test_litellm/llms/vertex_ai/agent_engine/test_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/agent_engine/test_transformation.py@@ -4,12 +4,9 @@ Tests for Vertex AI Agent Engine transformation.Tests the request transformation and streaming chunk parsing without making real API calls."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.vertex_ai.agent_engine.sse_iterator import (VertexAgentEngineResponseIterator,diff --git a/tests/test_litellm/llms/vertex_ai/audio_transcription/test_vertex_ai_audio_transcription_transformation.py b/tests/test_litellm/llms/vertex_ai/audio_transcription/test_vertex_ai_audio_transcription_transformation.pyindex 3fa28699f73..3a1922d1021 100644--- a/tests/test_litellm/llms/vertex_ai/audio_transcription/test_vertex_ai_audio_transcription_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/audio_transcription/test_vertex_ai_audio_transcription_transformation.py@@ -1,13 +1,11 @@import base64import jsonimport os-import sysfrom urllib.parse import urlparseimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.llms.vertex_ai.audio_transcription.transformation import (diff --git a/tests/test_litellm/llms/vertex_ai/batches/test_handler.py b/tests/test_litellm/llms/vertex_ai/batches/test_handler.pyindex 9535bf17411..38fde3caa63 100644--- a/tests/test_litellm/llms/vertex_ai/batches/test_handler.py+++ b/tests/test_litellm/llms/vertex_ai/batches/test_handler.py@@ -30,14 +30,11 @@ from __future__ import annotationsimport asyncioimport json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.vertex_ai.batches.handler import ( # noqa: E402VertexAIBatchPrediction,diff --git a/tests/test_litellm/llms/vertex_ai/batches/test_transformation.py b/tests/test_litellm/llms/vertex_ai/batches/test_transformation.pyindex 8352ec16389..ccb2d7e310d 100644--- a/tests/test_litellm/llms/vertex_ai/batches/test_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/batches/test_transformation.py@@ -13,13 +13,10 @@ There are no real I/O seams here; ``uuid.uuid4`` is the only nondeterministicdependency and is patched where the displayName is asserted."""-import os-import sysfrom unittest.mock import patchimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.llms.vertex_ai.batches.transformation import ( # noqa: E402VertexAIBatchTransformation,diff --git a/tests/test_litellm/llms/vertex_ai/context_caching/test_vertex_ai_context_caching.py b/tests/test_litellm/llms/vertex_ai/context_caching/test_vertex_ai_context_caching.pyindex ad890d0c7ea..f666829d2e8 100644--- a/tests/test_litellm/llms/vertex_ai/context_caching/test_vertex_ai_context_caching.py+++ b/tests/test_litellm/llms/vertex_ai/context_caching/test_vertex_ai_context_caching.py@@ -1,14 +1,9 @@-import os-import sysfrom typing import Listfrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.litellm_logging import Loggingfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandlerdiff --git a/tests/test_litellm/llms/vertex_ai/gemini/test_transformation.py b/tests/test_litellm/llms/vertex_ai/gemini/test_transformation.pyindex 756923c5df6..fad310fc5c0 100644--- a/tests/test_litellm/llms/vertex_ai/gemini/test_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/gemini/test_transformation.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.vertex_ai.gemini import transformationfrom litellm.llms.vertex_ai.gemini.vertex_and_google_ai_studio_gemini import (VertexGeminiConfig,diff --git a/tests/test_litellm/llms/vertex_ai/image_generation/test_vertex_ai_image_generation_transformation.py b/tests/test_litellm/llms/vertex_ai/image_generation/test_vertex_ai_image_generation_transformation.pyindex 8c72bdee525..54607cc5284 100644--- a/tests/test_litellm/llms/vertex_ai/image_generation/test_vertex_ai_image_generation_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/image_generation/test_vertex_ai_image_generation_transformation.py@@ -1,11 +1,9 @@import os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.llms.vertex_ai.image_generation import (get_vertex_ai_image_generation_config,diff --git a/tests/test_litellm/llms/vertex_ai/multimodal_embeddings/test_vertex_ai_multimodal_embedding_transformation.py b/tests/test_litellm/llms/vertex_ai/multimodal_embeddings/test_vertex_ai_multimodal_embedding_transformation.pyindex 6b605aed0ca..edb6e889814 100644--- a/tests/test_litellm/llms/vertex_ai/multimodal_embeddings/test_vertex_ai_multimodal_embedding_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/multimodal_embeddings/test_vertex_ai_multimodal_embedding_transformation.py@@ -1,14 +1,9 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.vertex_ai.multimodal_embeddings.transformation import (VertexAIMultimodalEmbeddingConfig,diff --git a/tests/test_litellm/llms/vertex_ai/realtime/test_vertex_ai_realtime_transformation.py b/tests/test_litellm/llms/vertex_ai/realtime/test_vertex_ai_realtime_transformation.pyindex f11b00d204d..720c629cbf7 100644--- a/tests/test_litellm/llms/vertex_ai/realtime/test_vertex_ai_realtime_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/realtime/test_vertex_ai_realtime_transformation.py@@ -10,14 +10,11 @@ Validates:"""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport pytestimport websockets.exceptions # registers websockets.exceptions on the websockets namespace-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.llms.vertex_ai.realtime.transformation import VertexAIRealtimeConfigdiff --git a/tests/test_litellm/llms/vertex_ai/test_bge_embedding.py b/tests/test_litellm/llms/vertex_ai/test_bge_embedding.pyindex d8b299dcf66..7538c070cd0 100644--- a/tests/test_litellm/llms/vertex_ai/test_bge_embedding.py+++ b/tests/test_litellm/llms/vertex_ai/test_bge_embedding.py@@ -6,11 +6,8 @@ and that the request body is properly formatted."""import json-import os-import sysfrom unittest.mock import MagicMock, patch-sys.path.insert(0, os.path.abspath("../../../.."))import pytestdiff --git a/tests/test_litellm/llms/vertex_ai/test_bge_response_transformation.py b/tests/test_litellm/llms/vertex_ai/test_bge_response_transformation.pyindex 26aa85a886e..9e960570036 100644--- a/tests/test_litellm/llms/vertex_ai/test_bge_response_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/test_bge_response_transformation.py@@ -5,10 +5,7 @@ This test verifies that the BGE response transformer properly validatesand handles different response formats."""-import os-import sys-sys.path.insert(0, os.path.abspath("../../../.."))import pytestdiff --git a/tests/test_litellm/llms/vertex_ai/test_gemini_empty_properties.py b/tests/test_litellm/llms/vertex_ai/test_gemini_empty_properties.pyindex 1a4e4d35ca9..441b598e751 100644--- a/tests/test_litellm/llms/vertex_ai/test_gemini_empty_properties.py+++ b/tests/test_litellm/llms/vertex_ai/test_gemini_empty_properties.py@@ -1,9 +1,6 @@"""Test for Gemini schema handling with empty properties."""-import os-import sys-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.llms.vertex_ai.common_utils import add_object_typediff --git a/tests/test_litellm/llms/vertex_ai/test_vertex.py b/tests/test_litellm/llms/vertex_ai/test_vertex.pyindex ae260a2d887..e3007bac7f3 100644--- a/tests/test_litellm/llms/vertex_ai/test_vertex.py+++ b/tests/test_litellm/llms/vertex_ai/test_vertex.py@@ -1,7 +1,5 @@import base64import json-import os-import sysfrom dotenv import load_dotenv@@ -12,9 +10,6 @@ import litellm.litellm_core_utils.prompt_templates.factoryload_dotenv()from unittest.mock import MagicMock-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport pytestimport litellmdiff --git a/tests/test_litellm/llms/vertex_ai/test_vertex_ai_common_utils.py b/tests/test_litellm/llms/vertex_ai/test_vertex_ai_common_utils.pyindex 39a06c68913..cc923f05831 100644--- a/tests/test_litellm/llms/vertex_ai/test_vertex_ai_common_utils.py+++ b/tests/test_litellm/llms/vertex_ai/test_vertex_ai_common_utils.py@@ -1,14 +1,9 @@-import os-import sysfrom unittest.mock import patchimport pytestfrom litellm.constants import DEFAULT_MAX_RECURSE_DEPTH-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.vertex_ai.common_utils import (_get_vertex_url,diff --git a/tests/test_litellm/llms/vertex_ai/test_vertex_gemini_gcs_uri_mime.py b/tests/test_litellm/llms/vertex_ai/test_vertex_gemini_gcs_uri_mime.pyindex e0eccad80e2..55493d47f3d 100644--- a/tests/test_litellm/llms/vertex_ai/test_vertex_gemini_gcs_uri_mime.py+++ b/tests/test_litellm/llms/vertex_ai/test_vertex_gemini_gcs_uri_mime.py@@ -3,8 +3,6 @@Split from test_vertex.py to satisfy CI per-file size limits."""import asyncio-import os-import sysimport timefrom dotenv import load_dotenv@@ -16,7 +14,6 @@ import pytestimport litellmfrom unittest.mock import MagicMock, patch-sys.path.insert(0, os.path.abspath("../.."))from litellm.llms.vertex_ai.gemini.transformation import _process_gemini_mediadiff --git a/tests/test_litellm/llms/vertex_ai/test_vertex_image_generation.py b/tests/test_litellm/llms/vertex_ai/test_vertex_image_generation.pyindex 2a87d84e20f..84444690fa2 100644--- a/tests/test_litellm/llms/vertex_ai/test_vertex_image_generation.py+++ b/tests/test_litellm/llms/vertex_ai/test_vertex_image_generation.py@@ -1,12 +1,7 @@-import os-import sysfrom unittest.mock import MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.vertex_ai.image_generation.image_generation_handler import (diff --git a/tests/test_litellm/llms/vertex_ai/test_vertex_llm_base.py b/tests/test_litellm/llms/vertex_ai/test_vertex_llm_base.pyindex 18fc239b7c6..29d22e844a5 100644--- a/tests/test_litellm/llms/vertex_ai/test_vertex_llm_base.py+++ b/tests/test_litellm/llms/vertex_ai/test_vertex_llm_base.py@@ -1,16 +1,11 @@import asyncioimport json-import os-import sysfrom unittest.mock import MagicMock, call, patchimport pytestfrom litellm.constants import DEFAULT_MAX_RECURSE_DEPTH-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.vertex_ai.vertex_ai_aws_wif import VertexAIAwsWifAuthdiff --git a/tests/test_litellm/llms/vertex_ai/text_to_speech/test_transformation.py b/tests/test_litellm/llms/vertex_ai/text_to_speech/test_transformation.pyindex 1e5ae05aa25..05da22a73fd 100644--- a/tests/test_litellm/llms/vertex_ai/text_to_speech/test_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/text_to_speech/test_transformation.py@@ -1,13 +1,8 @@-import os-import sysfrom unittest.mock import MagicMock, Mock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.vertex_ai.text_to_speech.transformation import (diff --git a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_anthropic_image_url_handling.py b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_anthropic_image_url_handling.pyindex b1aa7f629d5..fa286f6f609 100644--- a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_anthropic_image_url_handling.py+++ b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_anthropic_image_url_handling.py@@ -6,15 +6,10 @@ Vertex AI Anthropic models don't support URL sources for images.LiteLLM should convert image URLs to base64 when using Vertex AI Anthropic."""-import os-import sysfrom unittest.mock import patch, MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../../..")-) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.prompt_templates.factory import (anthropic_messages_pt,diff --git a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_partner_models_anthropic_transformation.py b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_partner_models_anthropic_transformation.pyindex ac2368130d8..552ca98441f 100644--- a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_partner_models_anthropic_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/test_vertex_ai_partner_models_anthropic_transformation.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../../..")-) # Adds the parent directory to the system pathfrom litellm.anthropic_beta_headers_manager import (update_headers_with_filtered_beta,)diff --git a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/gemma/test_vertex_ai_gemma_global_endpoint.py b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/gemma/test_vertex_ai_gemma_global_endpoint.pyindex 7c61aba4f99..957d7475d91 100644--- a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/gemma/test_vertex_ai_gemma_global_endpoint.py+++ b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/gemma/test_vertex_ai_gemma_global_endpoint.py@@ -13,14 +13,10 @@ These tests verify that:import jsonimport os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.vertex_ai.vertex_ai_partner_models.main import VertexAIPartnerModelsdiff --git a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/gpt_oss/test_vertex_ai_gpt_oss_transformation.py b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/gpt_oss/test_vertex_ai_gpt_oss_transformation.pyindex f617a8db850..6255394d838 100644--- a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/gpt_oss/test_vertex_ai_gpt_oss_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/gpt_oss/test_vertex_ai_gpt_oss_transformation.py@@ -1,13 +1,9 @@import jsonimport os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.vertex_ai.vertex_ai_partner_models.gpt_oss.transformation import (diff --git a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/llama3/test_vertex_ai_partner_models_llama3_transformation.py b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/llama3/test_vertex_ai_partner_models_llama3_transformation.pyindex 242a89d729a..3bca51ec6b3 100644--- a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/llama3/test_vertex_ai_partner_models_llama3_transformation.py+++ b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/llama3/test_vertex_ai_partner_models_llama3_transformation.py@@ -1,14 +1,9 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.vertex_ai.vertex_ai_partner_models.llama3.transformation import (VertexAILlama3Config,diff --git a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/qwen/test_vertex_ai_qwen_global_endpoint.py b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/qwen/test_vertex_ai_qwen_global_endpoint.pyindex 5a86325b7fd..4a11c84a96d 100644--- a/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/qwen/test_vertex_ai_qwen_global_endpoint.py+++ b/tests/test_litellm/llms/vertex_ai/vertex_ai_partner_models/qwen/test_vertex_ai_qwen_global_endpoint.py@@ -8,14 +8,10 @@ These tests verify that:"""import os-import sysfrom unittest.mock import MagicMock, patch, AsyncMockimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.vertex_ai.vertex_llm_base import VertexBasediff --git a/tests/test_litellm/llms/volcengine/responses/test_volcengine_responses_transformation.py b/tests/test_litellm/llms/volcengine/responses/test_volcengine_responses_transformation.pyindex 7922331d19f..d42bf7b7a1c 100644--- a/tests/test_litellm/llms/volcengine/responses/test_volcengine_responses_transformation.py+++ b/tests/test_litellm/llms/volcengine/responses/test_volcengine_responses_transformation.py@@ -2,15 +2,12 @@Tests for Volcengine Responses API transformation."""-import os-import sysfrom typing import List, Literal, Optional, Unionimport httpximport pytestfrom pydantic import BaseModel, Field-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.llms.volcengine.responses.transformation import (diff --git a/tests/test_litellm/llms/volcengine/test_volcengine_embedding.py b/tests/test_litellm/llms/volcengine/test_volcengine_embedding.pyindex 04caecab478..0122bc50695 100644--- a/tests/test_litellm/llms/volcengine/test_volcengine_embedding.py+++ b/tests/test_litellm/llms/volcengine/test_volcengine_embedding.py@@ -3,13 +3,10 @@ Integration tests for Volcengine embedding following LiteLLM testing patternsBased on the BaseLLMEmbeddingTest framework"""-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest# Add parent directory to path for imports-sys.path.insert(0, os.path.abspath("../../../../.."))from tests.llm_translation.base_embedding_unit_tests import BaseLLMEmbeddingTestimport litellmdiff --git a/tests/test_litellm/llms/wandb/test_wandb_chat_transformation.py b/tests/test_litellm/llms/wandb/test_wandb_chat_transformation.pyindex ef7bb0e44f0..a5d1eccebe0 100644--- a/tests/test_litellm/llms/wandb/test_wandb_chat_transformation.py+++ b/tests/test_litellm/llms/wandb/test_wandb_chat_transformation.py@@ -5,12 +5,7 @@ These tests validate the WandbInferenceConfig class which extends OpenAIGPTConfiNebius AI Studio is an OpenAI-compatible provider with minor customizations."""-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathimport pytestdiff --git a/tests/test_litellm/llms/watsonx/audio_transcription/test_watsonx_audio_transcription_transformation.py b/tests/test_litellm/llms/watsonx/audio_transcription/test_watsonx_audio_transcription_transformation.pyindex 6ff53287e9d..e269e782061 100644--- a/tests/test_litellm/llms/watsonx/audio_transcription/test_watsonx_audio_transcription_transformation.py+++ b/tests/test_litellm/llms/watsonx/audio_transcription/test_watsonx_audio_transcription_transformation.py@@ -5,13 +5,10 @@ Validates that litellm.transcription transforms requests correctly for WatsonX."""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.llms.watsonx.audio_transcription.transformation import (diff --git a/tests/test_litellm/llms/watsonx/embed/test_watsonx_embedding_transformation.py b/tests/test_litellm/llms/watsonx/embed/test_watsonx_embedding_transformation.pyindex 5c2688620d4..58f6bb23498 100644--- a/tests/test_litellm/llms/watsonx/embed/test_watsonx_embedding_transformation.py+++ b/tests/test_litellm/llms/watsonx/embed/test_watsonx_embedding_transformation.py@@ -1,7 +1,4 @@-import os-import sys-sys.path.insert(0, os.path.abspath("../../../../.."))import pytestdiff --git a/tests/test_litellm/llms/watsonx/passthrough/test_watsonx_passthrough_transformation.py b/tests/test_litellm/llms/watsonx/passthrough/test_watsonx_passthrough_transformation.pyindex d1db04f5215..d8976d19f5c 100644--- a/tests/test_litellm/llms/watsonx/passthrough/test_watsonx_passthrough_transformation.py+++ b/tests/test_litellm/llms/watsonx/passthrough/test_watsonx_passthrough_transformation.py@@ -5,14 +5,11 @@ Tests the Watsonx-specific passthrough configuration including URL construction,streaming detection, and authentication handling."""-import os-import sysfrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))import litellmfrom litellm.llms.watsonx.passthrough.transformation import WatsonxPassthroughConfigdiff --git a/tests/test_litellm/llms/watsonx/test_watsonx.py b/tests/test_litellm/llms/watsonx/test_watsonx.pyindex 315ffdb45a9..8ac4472b22d 100644--- a/tests/test_litellm/llms/watsonx/test_watsonx.py+++ b/tests/test_litellm/llms/watsonx/test_watsonx.py@@ -1,10 +1,5 @@import json-import os-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom typing import Optionalfrom unittest.mock import Mock, patchdiff --git a/tests/test_litellm/llms/watsonx/test_watsonx_common_utils.py b/tests/test_litellm/llms/watsonx/test_watsonx_common_utils.pyindex be74dc40eda..ffc48ecfae9 100644--- a/tests/test_litellm/llms/watsonx/test_watsonx_common_utils.py+++ b/tests/test_litellm/llms/watsonx/test_watsonx_common_utils.py@@ -1,12 +1,7 @@-import os-import sysfrom unittest.mock import MagicMock, call, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.llms.watsonx.common_utils import generate_iam_tokendiff --git a/tests/test_litellm/llms/xai/responses/test_xai_responses_transformation.py b/tests/test_litellm/llms/xai/responses/test_xai_responses_transformation.pyindex 871613c9c9a..befd4c5ffbd 100644--- a/tests/test_litellm/llms/xai/responses/test_xai_responses_transformation.py+++ b/tests/test_litellm/llms/xai/responses/test_xai_responses_transformation.py@@ -7,11 +7,8 @@ transformations for the Responses API.Source: litellm/llms/xai/responses/transformation.py"""-import os-import sysfrom unittest.mock import MagicMock-sys.path.insert(0, os.path.abspath("../../../../.."))import pytestdiff --git a/tests/test_litellm/llms/xai/test_xai_chat_transformation.py b/tests/test_litellm/llms/xai/test_xai_chat_transformation.pyindex eac5b89e4f3..e5e853ec82f 100644--- a/tests/test_litellm/llms/xai/test_xai_chat_transformation.py+++ b/tests/test_litellm/llms/xai/test_xai_chat_transformation.py@@ -1,9 +1,4 @@-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport pytestdiff --git a/tests/test_litellm/llms/xai/test_xai_cost_calculator.py b/tests/test_litellm/llms/xai/test_xai_cost_calculator.pyindex b3855202ae0..55e28dff81d 100644--- a/tests/test_litellm/llms/xai/test_xai_cost_calculator.py+++ b/tests/test_litellm/llms/xai/test_xai_cost_calculator.py@@ -4,7 +4,6 @@ Test suite for XAI cost calculation functionality.import mathimport os-import sysimport litellmfrom litellm.types.utils import (@@ -13,9 +12,6 @@ from litellm.types.utils import (Usage,)-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.llm_cost_calc.tool_call_cost_tracking import (StandardBuiltInToolCostTracking,diff --git a/tests/test_litellm/llms/xai/test_xai_key_fallback.py b/tests/test_litellm/llms/xai/test_xai_key_fallback.pyindex ec3eb83309c..092e4951547 100644--- a/tests/test_litellm/llms/xai/test_xai_key_fallback.py+++ b/tests/test_litellm/llms/xai/test_xai_key_fallback.py@@ -1,10 +1,5 @@import asyncio-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport pytestdiff --git a/tests/test_litellm/llms/xai/xai_responses/test_transformation.py b/tests/test_litellm/llms/xai/xai_responses/test_transformation.pyindex dc535cf709b..c783918ca06 100644--- a/tests/test_litellm/llms/xai/xai_responses/test_transformation.py+++ b/tests/test_litellm/llms/xai/xai_responses/test_transformation.py@@ -7,10 +7,7 @@ transformations for the Responses API.Source: litellm/llms/xai/responses/transformation.py"""-import sys-import os-sys.path.insert(0, os.path.abspath("../../../../.."))import pytestfrom litellm.types.utils import LlmProvidersdiff --git a/tests/test_litellm/llms/you_com/test_you_com_search.py b/tests/test_litellm/llms/you_com/test_you_com_search.pyindex eacc495cede..13d1be6062f 100644--- a/tests/test_litellm/llms/you_com/test_you_com_search.py+++ b/tests/test_litellm/llms/you_com/test_you_com_search.py@@ -2,12 +2,9 @@Tests for You.com Search API integration."""-import os-import sysimport pytestfrom unittest.mock import AsyncMock, patch, MagicMock-sys.path.insert(0, os.path.abspath("../.."))import litellmdiff --git a/tests/test_litellm/passthrough/test_passthrough_main.py b/tests/test_litellm/passthrough/test_passthrough_main.pyindex e43e4be8bcc..b8f265ad7ea 100644--- a/tests/test_litellm/passthrough/test_passthrough_main.py+++ b/tests/test_litellm/passthrough/test_passthrough_main.py@@ -1,6 +1,4 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpx@@ -9,9 +7,6 @@ from fastapi.testclient import TestClientfrom litellm.llms.custom_httpx.http_handler import AsyncHTTPHandler, HTTPHandler-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathdiff --git a/tests/test_litellm/proxy/_experimental/mcp_server/auth/test_user_api_key_auth_mcp.py b/tests/test_litellm/proxy/_experimental/mcp_server/auth/test_user_api_key_auth_mcp.pyindex 17c4d773981..697c9b018ec 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/auth/test_user_api_key_auth_mcp.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/auth/test_user_api_key_auth_mcp.py@@ -1,7 +1,6 @@import contextlibimport jsonimport os-import sysfrom datetime import datetime, timedelta, timezonefrom unittest.mock import AsyncMock, MagicMock, patch@@ -9,7 +8,6 @@ import pytestfrom fastapi import HTTPExceptionfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../..")) # Adds the parent directory to the system pathfrom starlette.datastructures import Headers@@ -6240,7 +6238,6 @@ class TestAggregateGatewayDcrChallenge:well_known_root_suffix), so a DCR client behind a sub-path is pointed at a route thatexists instead of a 404. Regression: the challenge used to hard-code /mcp and omit theroot path the route inserts."""- import oswith (patch.dict(os.environ, {"SERVER_ROOT_PATH": "/litellm"}),@@ -6321,7 +6318,6 @@ class TestAggregateGatewayDcrChallenge:used to fail, silently pointing a legacy-spelling client at the standard-pattern documentwhose ``resource`` is ``{base}/mcp/{server}`` rather than the ``{base}/{server}/mcp`` URL itcalled, which a strict RFC 9728 section 3 client rejects."""- import osfrom litellm.types.mcp import MCPAuthfrom litellm.types.mcp_server.mcp_server_manager import MCPServerdiff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_cost_calculator.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_cost_calculator.pyindex 4b9e7f2258b..5357e0dce9e 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_cost_calculator.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_cost_calculator.py@@ -1,6 +1,4 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport orjson@@ -8,9 +6,6 @@ import pytestfrom fastapi import Requestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._experimental.mcp_server.cost_calculator import MCPCostCalculatordiff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_custom_fields.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_custom_fields.pyindex 7a096fdc899..333d4c98899 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_custom_fields.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_custom_fields.py@@ -5,13 +5,10 @@ Tests that mcp_info can accept arbitrary custom fields in addition to predefined"""import pytest-import sys-import osfrom unittest.mock import Mock, patchfrom typing import Dict, Any# Add the path to find the modules-sys.path.insert(0, os.path.abspath("../../../..")) # Adjust the path as neededfrom litellm.proxy._experimental.mcp_server.mcp_server_manager import MCPServerManagerfrom litellm.types.mcp import MCPAuthdiff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_discovery.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_discovery.pyindex 9a741a3f861..43cf35c152d 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_discovery.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_discovery.py@@ -1,12 +1,8 @@import jsonimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathclass TestMCPRegistryFile:diff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_metadata_preservation.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_metadata_preservation.pyindex 3182318caed..5a24ca00c25 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_metadata_preservation.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_metadata_preservation.py@@ -5,12 +5,10 @@ This module tests that tool metadata is preserved when creating prefixed tools,which is critical for ChatGPT UI widget rendering."""-import sysimport pytest# Add the parent directory to the path so we can import litellm-sys.path.insert(0, "../../../../../")from mcp.types import Tool as MCPTooldiff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough.pyindex fe583ace897..1c59b7b87e0 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough.py@@ -8,7 +8,6 @@ Covers:"""import asyncio-import sysimport timefrom unittest.mock import AsyncMock, MagicMock, patch@@ -16,7 +15,6 @@ import httpximport pytestfrom fastapi import HTTPException, Request-sys.path.insert(0, "../../../../../")from litellm.proxy._experimental.mcp_server import discoverable_endpointsdiff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough_cold_start.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough_cold_start.pyindex f25d3baea0a..67663448d65 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough_cold_start.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough_cold_start.py@@ -1,10 +1,8 @@"""Unit tests for MCP OAuth passthrough cold-start route behavior."""-import sysimport pytest-sys.path.insert(0, "../../../../../")from litellm.proxy._types import MCPTransportfrom litellm.types.mcp import MCPAuthdiff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough_tools.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough_tools.pyindex 095ae00fd45..6d66748bf3f 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough_tools.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_oauth_passthrough_tools.py@@ -1,12 +1,10 @@"""Unit tests for MCP OAuth passthrough tool-fetch behavior."""-import sysfrom unittest.mock import AsyncMock, MagicMockimport httpximport pytest-sys.path.insert(0, "../../../../../")from litellm.proxy._experimental.mcp_server.exceptions import MCPUpstreamAuthErrorfrom litellm.proxy._experimental.mcp_server.mcp_server_manager import (diff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.pyindex 09e8c78a3f8..cdea803ebf3 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server_manager.py@@ -18,7 +18,6 @@ from litellm.proxy._experimental.mcp_server.exceptions import (from litellm.proxy._experimental.mcp_server.faults.list_outcomes import ServerListFault# Add the parent directory to the path so we can import litellm-sys.path.insert(0, "../../../../../")import httpxdiff --git a/tests/test_litellm/proxy/_experimental/mcp_server/test_semantic_tool_filter.py b/tests/test_litellm/proxy/_experimental/mcp_server/test_semantic_tool_filter.pyindex 0b211255218..054146d474d 100644--- a/tests/test_litellm/proxy/_experimental/mcp_server/test_semantic_tool_filter.py+++ b/tests/test_litellm/proxy/_experimental/mcp_server/test_semantic_tool_filter.py@@ -6,7 +6,6 @@ an ordered set of top K tools based on semantic similarity."""import asyncio-import osimport sysfrom unittest.mock import AsyncMock, Mock, patch@@ -15,7 +14,6 @@ import pytestif sys.version_info < (3, 11): # BaseExceptionGroup is a builtin only from 3.11from exceptiongroup import BaseExceptionGroup-sys.path.insert(0, os.path.abspath("../.."))from mcp.types import Tool as MCPTooldiff --git a/tests/test_litellm/proxy/agent_endpoints/auth/test_agent_permission_handler.py b/tests/test_litellm/proxy/agent_endpoints/auth/test_agent_permission_handler.pyindex 066d33dc187..82528c58ae0 100644--- a/tests/test_litellm/proxy/agent_endpoints/auth/test_agent_permission_handler.py+++ b/tests/test_litellm/proxy/agent_endpoints/auth/test_agent_permission_handler.py@@ -4,14 +4,11 @@ Unit tests for AgentRequestHandler - Agent permission management for keys and teimport hashlibimport json-import os-import sysfrom typing import Finalfrom unittest.mock import AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import UserAPIKeyAuthfrom litellm.proxy.agent_endpoints.agent_registry import AgentRegistrydiff --git a/tests/test_litellm/proxy/agent_endpoints/test_model_list_helpers.py b/tests/test_litellm/proxy/agent_endpoints/test_model_list_helpers.pyindex ccf5942c89d..939ab1cab40 100644--- a/tests/test_litellm/proxy/agent_endpoints/test_model_list_helpers.py+++ b/tests/test_litellm/proxy/agent_endpoints/test_model_list_helpers.py@@ -4,10 +4,7 @@ Test appending A2A agents to model lists.Maps to: litellm/proxy/agent_endpoints/model_list_helpers.py"""-import os-import sys-sys.path.insert(0, os.path.abspath("../../../.."))from unittest.mock import AsyncMock, Mock, patchdiff --git a/tests/test_litellm/proxy/auth/test_admin_viewer_handler_access.py b/tests/test_litellm/proxy/auth/test_admin_viewer_handler_access.pyindex 36f656a7adc..2309b0a931f 100644--- a/tests/test_litellm/proxy/auth/test_admin_viewer_handler_access.py+++ b/tests/test_litellm/proxy/auth/test_admin_viewer_handler_access.py@@ -11,15 +11,12 @@ The principle (see Admin Viewer role doc): anything Proxy Admin can read,Admin Viewer can read. No writes, no cost-incurring actions."""-import os-import sysimport typesfrom unittest.mock import AsyncMock, MagicMockimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../"))import litellm.proxy.proxy_server as psfrom litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuthdiff --git a/tests/test_litellm/proxy/auth/test_auth_checks.py b/tests/test_litellm/proxy/auth/test_auth_checks.pyindex 762d2cbf3c7..a34df54adfa 100644--- a/tests/test_litellm/proxy/auth/test_auth_checks.py+++ b/tests/test_litellm/proxy/auth/test_auth_checks.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysfrom types import SimpleNamespacefrom typing import TYPE_CHECKING, Optionalfrom unittest.mock import AsyncMock, MagicMock, patch@@ -9,9 +7,6 @@ from unittest.mock import AsyncMock, MagicMock, patchif TYPE_CHECKING:from litellm.router import Router-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom datetime import datetime, timedelta, timezonediff --git a/tests/test_litellm/proxy/auth/test_auth_exception_handler.py b/tests/test_litellm/proxy/auth/test_auth_exception_handler.pyindex 721857e5411..b0094b81112 100644--- a/tests/test_litellm/proxy/auth/test_auth_exception_handler.py+++ b/tests/test_litellm/proxy/auth/test_auth_exception_handler.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport httpx@@ -26,9 +24,6 @@ from prisma.errors import (UniqueViolationError,)-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm._logging import verbose_proxy_loggerfrom litellm.exceptions import BudgetExceededErrordiff --git a/tests/test_litellm/proxy/auth/test_auth_hot_path_network_requests.py b/tests/test_litellm/proxy/auth/test_auth_hot_path_network_requests.pyindex 6b2d2babedc..e3b76cac8ce 100644--- a/tests/test_litellm/proxy/auth/test_auth_hot_path_network_requests.py+++ b/tests/test_litellm/proxy/auth/test_auth_hot_path_network_requests.py@@ -18,15 +18,12 @@ NOTE: This test does NOT require proxy extras (apscheduler, etc.) becauseit tests at the auth_checks level, not the full proxy_server level."""-import os-import sysimport timefrom typing import Any, Dict, List, Optionalfrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.caching.dual_cache import DualCachefrom litellm.caching.in_memory_cache import InMemoryCachediff --git a/tests/test_litellm/proxy/auth/test_litellm_license.py b/tests/test_litellm/proxy/auth/test_litellm_license.pyindex 77dd45046a0..8da365cb587 100644--- a/tests/test_litellm/proxy/auth/test_litellm_license.py+++ b/tests/test_litellm/proxy/auth/test_litellm_license.py@@ -1,12 +1,7 @@import asyncioimport json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patch-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.auth.litellm_license import LicenseCheckdiff --git a/tests/test_litellm/proxy/auth/test_oauth2_proxy_hook.py b/tests/test_litellm/proxy/auth/test_oauth2_proxy_hook.pyindex 2d81d48de1e..315fc1471b3 100644--- a/tests/test_litellm/proxy/auth/test_oauth2_proxy_hook.py+++ b/tests/test_litellm/proxy/auth/test_oauth2_proxy_hook.py@@ -13,14 +13,11 @@ constructs a ``UserAPIKeyAuth`` from them. The fix has two parts:``"proxy_admin"`` into ``LitellmUserRoles.PROXY_ADMIN``."""-import os-import sysimport pytestfrom fastapi import Requestfrom starlette.datastructures import Headers-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import LitellmUserRolesfrom litellm.proxy.auth.oauth2_proxy_hook import (diff --git a/tests/test_litellm/proxy/auth/test_object_permission_loading.py b/tests/test_litellm/proxy/auth/test_object_permission_loading.pyindex 0dfd82e0ea0..8db4e210107 100644--- a/tests/test_litellm/proxy/auth/test_object_permission_loading.py+++ b/tests/test_litellm/proxy/auth/test_object_permission_loading.py@@ -2,13 +2,10 @@Test that object_permission is automatically loaded when fetching keys and teams."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import (LiteLLM_ObjectPermissionTable,diff --git a/tests/test_litellm/proxy/auth/test_organization_budget_enforcement.py b/tests/test_litellm/proxy/auth/test_organization_budget_enforcement.pyindex 45e24832274..3c8a793e957 100644--- a/tests/test_litellm/proxy/auth/test_organization_budget_enforcement.py+++ b/tests/test_litellm/proxy/auth/test_organization_budget_enforcement.py@@ -10,14 +10,11 @@ organization's budget limit."""import asyncio-import os-import sysfrom typing import Optionalfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../"))import litellmfrom litellm.proxy._types import (diff --git a/tests/test_litellm/proxy/auth/test_route_checks.py b/tests/test_litellm/proxy/auth/test_route_checks.pyindex b3b73723726..2eab03c2947 100644--- a/tests/test_litellm/proxy/auth/test_route_checks.py+++ b/tests/test_litellm/proxy/auth/test_route_checks.py@@ -1,11 +1,7 @@import os-import sysfrom datetime import datetimefrom unittest.mock import MagicMock, patch-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport pytestfrom fastapi import HTTPException, Requestdiff --git a/tests/test_litellm/proxy/auth/test_user_api_key_auth.py b/tests/test_litellm/proxy/auth/test_user_api_key_auth.pyindex 043bbb5b76a..c1e235b77f6 100644--- a/tests/test_litellm/proxy/auth/test_user_api_key_auth.py+++ b/tests/test_litellm/proxy/auth/test_user_api_key_auth.py@@ -1,15 +1,10 @@import asyncioimport json-import os-import sysfrom contextlib import contextmanagerfrom datetime import datetime, timedeltafrom types import SimpleNamespacefrom unittest.mock import ANY, AsyncMock, MagicMock, patch-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport pytestfrom fastapi import statusdiff --git a/tests/test_litellm/proxy/batches_endpoints/test_endpoints.py b/tests/test_litellm/proxy/batches_endpoints/test_endpoints.pyindex 863d9204cff..b548b0b3135 100644--- a/tests/test_litellm/proxy/batches_endpoints/test_endpoints.py+++ b/tests/test_litellm/proxy/batches_endpoints/test_endpoints.py@@ -29,8 +29,6 @@ added to this layer raises instead of silently passing - the inventory of seamscannot drift without a test failure."""-import os-import sysfrom contextlib import ExitStackfrom dataclasses import dataclassfrom typing import Any, Dict, Optional@@ -38,7 +36,6 @@ from unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmimport litellm.proxy.batches_endpoints.endpoints as endpointsdiff --git a/tests/test_litellm/proxy/client/cli/test_agents.py b/tests/test_litellm/proxy/client/cli/test_agents.pyindex e504dd6e8a0..32dfb8d521d 100644--- a/tests/test_litellm/proxy/client/cli/test_agents.py+++ b/tests/test_litellm/proxy/client/cli/test_agents.py@@ -8,9 +8,6 @@ import pytestimport requestsfrom click.testing import CliRunner-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.client.cli.commands.agents import (diff --git a/tests/test_litellm/proxy/client/cli/test_auth_commands.py b/tests/test_litellm/proxy/client/cli/test_auth_commands.pyindex be29269fe25..85a4d90abf9 100644--- a/tests/test_litellm/proxy/client/cli/test_auth_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_auth_commands.py@@ -1,12 +1,10 @@import jsonimport osimport stat-import sysimport timefrom pathlib import Pathfrom unittest.mock import Mock, patch-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathimport pytestdiff --git a/tests/test_litellm/proxy/client/cli/test_config_commands.py b/tests/test_litellm/proxy/client/cli/test_config_commands.pyindex 6f3f4e4b268..611307635e0 100644--- a/tests/test_litellm/proxy/client/cli/test_config_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_config_commands.py@@ -1,14 +1,11 @@import json-import osimport stat-import sysfrom pathlib import Pathfrom unittest.mock import patchimport pytestfrom click.testing import CliRunner-sys.path.insert(0, os.path.abspath("../../.."))from litellm.proxy.client.cli import clidiff --git a/tests/test_litellm/proxy/client/cli/test_credentials_commands.py b/tests/test_litellm/proxy/client/cli/test_credentials_commands.pyindex c751bb675ce..fb9d749dd02 100644--- a/tests/test_litellm/proxy/client/cli/test_credentials_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_credentials_commands.py@@ -1,15 +1,10 @@import json-import os-import sysfrom unittest.mock import MagicMockimport pytestimport requestsfrom click.testing import CliRunner-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.client.cli.main import clidiff --git a/tests/test_litellm/proxy/client/cli/test_global_options.py b/tests/test_litellm/proxy/client/cli/test_global_options.pyindex 9c6fc15b242..0dd388919a5 100644--- a/tests/test_litellm/proxy/client/cli/test_global_options.py+++ b/tests/test_litellm/proxy/client/cli/test_global_options.py@@ -1,14 +1,12 @@# stdlib importsimport jsonimport os-import sysfrom pathlib import Pathfrom unittest.mock import Mock, patchimport pytestfrom click.testing import CliRunner-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathimport litellm.proxy.client.clidiff --git a/tests/test_litellm/proxy/client/cli/test_keys_commands.py b/tests/test_litellm/proxy/client/cli/test_keys_commands.pyindex 5d88b031eac..5cc0fb70881 100644--- a/tests/test_litellm/proxy/client/cli/test_keys_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_keys_commands.py@@ -1,13 +1,9 @@import jsonimport os-import sysfrom unittest.mock import patchimport requests-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport pytestdiff --git a/tests/test_litellm/proxy/client/cli/test_models_commands.py b/tests/test_litellm/proxy/client/cli/test_models_commands.pyindex 7f47d14656a..80353955e7f 100644--- a/tests/test_litellm/proxy/client/cli/test_models_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_models_commands.py@@ -1,7 +1,6 @@# stdlib importsimport jsonimport os-import sysimport timefrom unittest.mock import patch@@ -10,9 +9,6 @@ import pytest# third party importsfrom click.testing import CliRunner-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system path# local importsdiff --git a/tests/test_litellm/proxy/client/cli/test_users_commands.py b/tests/test_litellm/proxy/client/cli/test_users_commands.pyindex f18ceb30c22..72539173318 100644--- a/tests/test_litellm/proxy/client/cli/test_users_commands.py+++ b/tests/test_litellm/proxy/client/cli/test_users_commands.py@@ -1,13 +1,8 @@-import os-import sysfrom unittest.mock import patchimport pytestfrom click.testing import CliRunner-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.client.cli import clidiff --git a/tests/test_litellm/proxy/client/test_client.py b/tests/test_litellm/proxy/client/test_client.pyindex b0e458da89e..fe3e2c52ce5 100644--- a/tests/test_litellm/proxy/client/test_client.py+++ b/tests/test_litellm/proxy/client/test_client.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.client import ChatClient, Client, ModelsManagementClientfrom litellm.proxy.client.http_client import HTTPClientdiff --git a/tests/test_litellm/proxy/client/test_credentials.py b/tests/test_litellm/proxy/client/test_credentials.pyindex 72c643467b2..41886e3b292 100644--- a/tests/test_litellm/proxy/client/test_credentials.py+++ b/tests/test_litellm/proxy/client/test_credentials.py@@ -1,12 +1,7 @@-import os-import sysimport pytestimport requests-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport responsesdiff --git a/tests/test_litellm/proxy/client/test_http_client.py b/tests/test_litellm/proxy/client/test_http_client.pyindex 3d8fe44438a..c0f66b0f98e 100644--- a/tests/test_litellm/proxy/client/test_http_client.py+++ b/tests/test_litellm/proxy/client/test_http_client.py@@ -1,15 +1,10 @@"""Tests for the HTTP client."""import json-import os-import sysimport pytestimport requests-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport responsesdiff --git a/tests/test_litellm/proxy/client/test_http_commands.py b/tests/test_litellm/proxy/client/test_http_commands.pyindex 16579cfffbc..04894248ff2 100644--- a/tests/test_litellm/proxy/client/test_http_commands.py+++ b/tests/test_litellm/proxy/client/test_http_commands.py@@ -1,15 +1,10 @@"""Tests for the HTTP command group."""import json-import os-import sysimport pytestfrom click.testing import CliRunner-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport responsesdiff --git a/tests/test_litellm/proxy/client/test_keys.py b/tests/test_litellm/proxy/client/test_keys.pyindex 620daefb39e..282b97b1c09 100644--- a/tests/test_litellm/proxy/client/test_keys.py+++ b/tests/test_litellm/proxy/client/test_keys.py@@ -1,13 +1,8 @@-import os-import sysimport tracebackimport pytestimport requests-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport responsesdiff --git a/tests/test_litellm/proxy/client/test_model_groups.py b/tests/test_litellm/proxy/client/test_model_groups.pyindex 1c87672e723..9ea8e94ff95 100644--- a/tests/test_litellm/proxy/client/test_model_groups.py+++ b/tests/test_litellm/proxy/client/test_model_groups.py@@ -1,12 +1,7 @@-import os-import sysimport pytestimport requests-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport responsesdiff --git a/tests/test_litellm/proxy/client/test_models.py b/tests/test_litellm/proxy/client/test_models.pyindex 33f963b74af..fe053ffd683 100644--- a/tests/test_litellm/proxy/client/test_models.py+++ b/tests/test_litellm/proxy/client/test_models.py@@ -1,12 +1,7 @@-import os-import sysimport pytestimport requests-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport responsesdiff --git a/tests/test_litellm/proxy/client/test_users.py b/tests/test_litellm/proxy/client/test_users.pyindex a48cf8f791b..87b8392e402 100644--- a/tests/test_litellm/proxy/client/test_users.py+++ b/tests/test_litellm/proxy/client/test_users.py@@ -1,12 +1,7 @@-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.client.users import (diff --git a/tests/test_litellm/proxy/common_utils/html_forms/test_native_client_consent.py b/tests/test_litellm/proxy/common_utils/html_forms/test_native_client_consent.pyindex 600e421c176..6464dd7899a 100644--- a/tests/test_litellm/proxy/common_utils/html_forms/test_native_client_consent.py+++ b/tests/test_litellm/proxy/common_utils/html_forms/test_native_client_consent.py@@ -1,7 +1,4 @@-import os-import sys-sys.path.insert(0, os.path.abspath("../../../"))from litellm.constants import CLI_JWT_EXPIRATION_HOURSfrom litellm.proxy.common_utils.html_forms.native_client_consent import render_native_client_consent_pagediff --git a/tests/test_litellm/proxy/common_utils/html_forms/test_ui_login.py b/tests/test_litellm/proxy/common_utils/html_forms/test_ui_login.pyindex 436564d24a0..1d4261d278c 100644--- a/tests/test_litellm/proxy/common_utils/html_forms/test_ui_login.py+++ b/tests/test_litellm/proxy/common_utils/html_forms/test_ui_login.py@@ -1,7 +1,4 @@-import os-import sys-sys.path.insert(0, os.path.abspath("../../../"))from litellm.proxy.common_utils.html_forms.ui_login import build_ui_login_formdiff --git a/tests/test_litellm/proxy/common_utils/test_callback_utils.py b/tests/test_litellm/proxy/common_utils/test_callback_utils.pyindex 77ada4c11a9..66f77db6da9 100644--- a/tests/test_litellm/proxy/common_utils/test_callback_utils.py+++ b/tests/test_litellm/proxy/common_utils/test_callback_utils.py@@ -1,13 +1,9 @@import copyimport sys-import osfrom types import ModuleType, SimpleNamespaceimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.common_utils.callback_utils import (add_guardrail_scan_id,diff --git a/tests/test_litellm/proxy/common_utils/test_expired_ui_session_key_cleanup_manager.py b/tests/test_litellm/proxy/common_utils/test_expired_ui_session_key_cleanup_manager.pyindex 3efeeee9a27..8623d93c0a3 100644--- a/tests/test_litellm/proxy/common_utils/test_expired_ui_session_key_cleanup_manager.py+++ b/tests/test_litellm/proxy/common_utils/test_expired_ui_session_key_cleanup_manager.py@@ -2,15 +2,12 @@Test expired UI session key cleanup manager functionality."""-import os-import sysfrom datetime import datetime, timedelta, timezonefrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi import HTTPException, status-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.constants import (EXPIRED_UI_SESSION_KEY_CLEANUP_JOB_NAME,diff --git a/tests/test_litellm/proxy/common_utils/test_http_parsing_utils.py b/tests/test_litellm/proxy/common_utils/test_http_parsing_utils.pyindex 869d228d5a4..375c0d2640c 100644--- a/tests/test_litellm/proxy/common_utils/test_http_parsing_utils.py+++ b/tests/test_litellm/proxy/common_utils/test_http_parsing_utils.py@@ -1,6 +1,4 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport orjson@@ -8,9 +6,6 @@ import pytestfrom fastapi import Requestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/test_litellm/proxy/common_utils/test_key_rotation_e2e.py b/tests/test_litellm/proxy/common_utils/test_key_rotation_e2e.pyindex d6e1d22fdde..dd6c1637cad 100644--- a/tests/test_litellm/proxy/common_utils/test_key_rotation_e2e.py+++ b/tests/test_litellm/proxy/common_utils/test_key_rotation_e2e.py@@ -11,7 +11,6 @@ Covers the critical gaps:"""import os-import sysfrom datetime import datetime, timedelta, timezonefrom typing import castfrom unittest.mock import AsyncMock, MagicMock, patch@@ -19,7 +18,6 @@ from uuid import uuid4import pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import (GenerateKeyResponse,diff --git a/tests/test_litellm/proxy/common_utils/test_key_rotation_integration.py b/tests/test_litellm/proxy/common_utils/test_key_rotation_integration.pyindex 3bc62d549b0..6103a40d6c7 100644--- a/tests/test_litellm/proxy/common_utils/test_key_rotation_integration.py+++ b/tests/test_litellm/proxy/common_utils/test_key_rotation_integration.py@@ -9,13 +9,10 @@ Bug Fixed: Key alias was not passed during auto-rotation, causingsecrets to be created at a new location instead of updating in-place."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import (GenerateKeyResponse,diff --git a/tests/test_litellm/proxy/common_utils/test_key_rotation_lock.py b/tests/test_litellm/proxy/common_utils/test_key_rotation_lock.pyindex c0b3611b2b4..27dc6ae6a5e 100644--- a/tests/test_litellm/proxy/common_utils/test_key_rotation_lock.py+++ b/tests/test_litellm/proxy/common_utils/test_key_rotation_lock.py@@ -5,13 +5,10 @@ Verifies that PodLockManager is correctly used to prevent concurrentkey rotation across multiple pods in a distributed deployment."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import LiteLLM_VerificationTokenfrom litellm.proxy.common_utils.key_rotation_manager import KeyRotationManagerdiff --git a/tests/test_litellm/proxy/common_utils/test_key_rotation_manager.py b/tests/test_litellm/proxy/common_utils/test_key_rotation_manager.pyindex 18432d106af..40a186a9059 100644--- a/tests/test_litellm/proxy/common_utils/test_key_rotation_manager.py+++ b/tests/test_litellm/proxy/common_utils/test_key_rotation_manager.py@@ -2,14 +2,11 @@Test key rotation manager functionality"""-import os-import sysfrom datetime import datetime, timedelta, timezonefrom unittest.mock import AsyncMockimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import (GenerateKeyResponse,diff --git a/tests/test_litellm/proxy/common_utils/test_model_deprecation.py b/tests/test_litellm/proxy/common_utils/test_model_deprecation.pyindex 051ddd2e78c..91055dbac9f 100644--- a/tests/test_litellm/proxy/common_utils/test_model_deprecation.py+++ b/tests/test_litellm/proxy/common_utils/test_model_deprecation.py@@ -4,13 +4,10 @@ These tests focus on the helper itself — not on the proxy endpoint orSlack integration — so they can run without the full proxy stack."""-import os-import sysfrom datetime import date, datetime, timezonefrom unittest.mock import MagicMock-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.proxy.common_utils.model_deprecation import (diff --git a/tests/test_litellm/proxy/common_utils/test_reset_budget_job.py b/tests/test_litellm/proxy/common_utils/test_reset_budget_job.pyindex 8233b0d3864..25c177a308d 100644--- a/tests/test_litellm/proxy/common_utils/test_reset_budget_job.py+++ b/tests/test_litellm/proxy/common_utils/test_reset_budget_job.py@@ -1,6 +1,5 @@import asyncioimport json-import osimport sysimport typesfrom datetime import datetime, timedelta, timezone@@ -12,7 +11,6 @@ import httpximport prismaimport pytest-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathfrom litellm.proxy._types import LiteLLM_VerificationTokenfrom litellm.proxy.common_utils import reset_budget_job as reset_budget_job_modulediff --git a/tests/test_litellm/proxy/common_utils/test_static_asset_utils.py b/tests/test_litellm/proxy/common_utils/test_static_asset_utils.pyindex 93f7ccc92c2..593158515a5 100644--- a/tests/test_litellm/proxy/common_utils/test_static_asset_utils.py+++ b/tests/test_litellm/proxy/common_utils/test_static_asset_utils.py@@ -7,11 +7,9 @@ arbitrary local image paths working while refusing non-image files like"""import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy.common_utils.static_asset_utils import (detect_local_image_media_type,diff --git a/tests/test_litellm/proxy/common_utils/test_timezone_utils.py b/tests/test_litellm/proxy/common_utils/test_timezone_utils.pyindex dc3917cb48e..0ae74ab6f59 100644--- a/tests/test_litellm/proxy/common_utils/test_timezone_utils.py+++ b/tests/test_litellm/proxy/common_utils/test_timezone_utils.py@@ -1,13 +1,8 @@-import os-import sysfrom datetime import datetime, time, timezonefrom zoneinfo import ZoneInfoimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy.common_utils.timezone_utils import (diff --git a/tests/test_litellm/proxy/credential_endpoints/test_endpoints.py b/tests/test_litellm/proxy/credential_endpoints/test_endpoints.pyindex e2fa1de6962..dcd8e6881bd 100644--- a/tests/test_litellm/proxy/credential_endpoints/test_endpoints.py+++ b/tests/test_litellm/proxy/credential_endpoints/test_endpoints.py@@ -1,13 +1,10 @@"""Tests for the credential management endpoints."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import UserAPIKeyAuthfrom litellm.proxy.auth.user_api_key_auth import user_api_key_authdiff --git a/tests/test_litellm/proxy/db/db_transaction_queue/test_base_update_queue.py b/tests/test_litellm/proxy/db/db_transaction_queue/test_base_update_queue.pyindex f357d7fbea8..abb79458318 100644--- a/tests/test_litellm/proxy/db/db_transaction_queue/test_base_update_queue.py+++ b/tests/test_litellm/proxy/db/db_transaction_queue/test_base_update_queue.py@@ -1,15 +1,10 @@import asyncioimport json-import os-import sysfrom unittest.mock import patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.constants import MAX_IN_MEMORY_QUEUE_FLUSH_COUNTfrom litellm.proxy.db.db_transaction_queue.base_update_queue import BaseUpdateQueuediff --git a/tests/test_litellm/proxy/db/db_transaction_queue/test_daily_spend_update_queue.py b/tests/test_litellm/proxy/db/db_transaction_queue/test_daily_spend_update_queue.pyindex a55d4f0dcfd..a00815345aa 100644--- a/tests/test_litellm/proxy/db/db_transaction_queue/test_daily_spend_update_queue.py+++ b/tests/test_litellm/proxy/db/db_transaction_queue/test_daily_spend_update_queue.py@@ -1,14 +1,9 @@import asyncioimport json-import os-import sysimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.constants import MAX_SIZE_IN_MEMORY_QUEUEfrom litellm.proxy._types import (diff --git a/tests/test_litellm/proxy/db/db_transaction_queue/test_pod_lock_manager.py b/tests/test_litellm/proxy/db/db_transaction_queue/test_pod_lock_manager.pyindex 7a1ab60c547..ecd5c5f50c0 100644--- a/tests/test_litellm/proxy/db/db_transaction_queue/test_pod_lock_manager.py+++ b/tests/test_litellm/proxy/db/db_transaction_queue/test_pod_lock_manager.py@@ -1,13 +1,10 @@import json-import os-import sysfrom datetime import datetime, timedelta, timezonefrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathfrom litellm.constants import DEFAULT_CRON_JOB_LOCK_TTL_SECONDSfrom litellm.proxy.db.db_transaction_queue.pod_lock_manager import PodLockManagerdiff --git a/tests/test_litellm/proxy/db/db_transaction_queue/test_redis_update_buffer.py b/tests/test_litellm/proxy/db/db_transaction_queue/test_redis_update_buffer.pyindex 3325893c5f6..fb0c994a476 100644--- a/tests/test_litellm/proxy/db/db_transaction_queue/test_redis_update_buffer.py+++ b/tests/test_litellm/proxy/db/db_transaction_queue/test_redis_update_buffer.py@@ -1,13 +1,8 @@import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.db.db_transaction_queue.redis_update_buffer import RedisUpdateBufferfrom litellm.proxy.proxy_server import ProxyStartupEventdiff --git a/tests/test_litellm/proxy/db/db_transaction_queue/test_spend_update_queue.py b/tests/test_litellm/proxy/db/db_transaction_queue/test_spend_update_queue.pyindex 0ed5940dd75..43f1a820885 100644--- a/tests/test_litellm/proxy/db/db_transaction_queue/test_spend_update_queue.py+++ b/tests/test_litellm/proxy/db/db_transaction_queue/test_spend_update_queue.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysimport pytestfrom fastapi.testclient import TestClient@@ -10,9 +8,6 @@ from litellm.constants import MAX_SIZE_IN_MEMORY_QUEUEfrom litellm.proxy._types import Litellm_EntityType, SpendUpdateQueueItemfrom litellm.proxy.db.db_transaction_queue.spend_update_queue import SpendUpdateQueue-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system path@pytest.fixturediff --git a/tests/test_litellm/proxy/db/db_transaction_queue/test_tool_discovery_queue.py b/tests/test_litellm/proxy/db/db_transaction_queue/test_tool_discovery_queue.pyindex defdb3834d8..e400ad16e84 100644--- a/tests/test_litellm/proxy/db/db_transaction_queue/test_tool_discovery_queue.py+++ b/tests/test_litellm/proxy/db/db_transaction_queue/test_tool_discovery_queue.py@@ -2,12 +2,9 @@Unit tests for ToolDiscoveryQueue."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.proxy.db.db_transaction_queue.tool_discovery_queue import (ToolDiscoveryQueue,diff --git a/tests/test_litellm/proxy/db/mcp_server/test_db.py b/tests/test_litellm/proxy/db/mcp_server/test_db.pyindex 481d1a864c0..aa40ec0d76c 100644--- a/tests/test_litellm/proxy/db/mcp_server/test_db.py+++ b/tests/test_litellm/proxy/db/mcp_server/test_db.py@@ -1,13 +1,8 @@-import os-import sysfrom types import SimpleNamespacefrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._experimental.mcp_server.db import get_mcp_servers_by_teamdiff --git a/tests/test_litellm/proxy/db/test_check_migration.py b/tests/test_litellm/proxy/db/test_check_migration.pyindex 5b182f03c4b..9e2f6a1089c 100644--- a/tests/test_litellm/proxy/db/test_check_migration.py+++ b/tests/test_litellm/proxy/db/test_check_migration.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathdef test_check_migration_out_of_sync(mocker):diff --git a/tests/test_litellm/proxy/db/test_db_spend_update_writer.py b/tests/test_litellm/proxy/db/test_db_spend_update_writer.pyindex 4113d708196..76a80ac2651 100644--- a/tests/test_litellm/proxy/db/test_db_spend_update_writer.py+++ b/tests/test_litellm/proxy/db/test_db_spend_update_writer.py@@ -1,13 +1,8 @@import asyncioimport copyimport json-import osimport re-import sys-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom collections.abc import Callablediff --git a/tests/test_litellm/proxy/db/test_exception_handler.py b/tests/test_litellm/proxy/db/test_exception_handler.pyindex 4c6315024dd..d80e3acb4b8 100644--- a/tests/test_litellm/proxy/db/test_exception_handler.py+++ b/tests/test_litellm/proxy/db/test_exception_handler.py@@ -1,6 +1,5 @@import asyncioimport json-import osimport sysfrom unittest.mock import MagicMock, patch@@ -21,9 +20,6 @@ from prisma.errors import (UniqueViolationError,)-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm._logging import verbose_proxy_logger@@ -335,7 +331,6 @@ def test_is_database_service_unavailable_error_asyncpg(monkeypatch):"""asyncpg connection/interface errors map to service-unavailable. asyncpgis not a hard dependency, so inject a stand-in module to exercise thebranch deterministically regardless of the install environment."""- import sysimport typesfake_asyncpg = types.ModuleType("asyncpg")diff --git a/tests/test_litellm/proxy/db/test_exception_handler_reconnect_retry.py b/tests/test_litellm/proxy/db/test_exception_handler_reconnect_retry.pyindex 0a25ed55e90..4286da23242 100644--- a/tests/test_litellm/proxy/db/test_exception_handler_reconnect_retry.py+++ b/tests/test_litellm/proxy/db/test_exception_handler_reconnect_retry.py@@ -8,15 +8,12 @@ LiteLLM 1.83.x and started emitting `db_exceptions` alerts on transient`httpx.ReadError` flaps that used to self-heal in 1.82.6."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport httpximport pytestfrom prisma.errors import ClientNotConnectedError, UniqueViolationError-sys.path.insert(0, os.path.abspath("../../.."))from litellm.proxy.db.exception_handler import call_with_db_reconnect_retrydiff --git a/tests/test_litellm/proxy/db/test_prisma_client.py b/tests/test_litellm/proxy/db/test_prisma_client.pyindex 395f17e85ef..b1ecbfeff8e 100644--- a/tests/test_litellm/proxy/db/test_prisma_client.py+++ b/tests/test_litellm/proxy/db/test_prisma_client.py@@ -8,9 +8,6 @@ from unittest.mock import AsyncMock, MagicMock, Mock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.db.prisma_client import PrismaWrapper, should_update_prisma_schemadiff --git a/tests/test_litellm/proxy/db/test_prisma_planned_engine_restart.py b/tests/test_litellm/proxy/db/test_prisma_planned_engine_restart.pyindex 95e794012ec..f3f742b2023 100644--- a/tests/test_litellm/proxy/db/test_prisma_planned_engine_restart.py+++ b/tests/test_litellm/proxy/db/test_prisma_planned_engine_restart.py@@ -40,9 +40,6 @@ import pytestfrom prisma import Prisma as GeneratedPrismafrom prisma.engine.errors import EngineConnectionError-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.db.prisma_client import PrismaWrapperfrom litellm.proxy.utils import PrismaClientdiff --git a/tests/test_litellm/proxy/db/test_prisma_self_heal.py b/tests/test_litellm/proxy/db/test_prisma_self_heal.pyindex cc47cf4a7e4..10a48941693 100644--- a/tests/test_litellm/proxy/db/test_prisma_self_heal.py+++ b/tests/test_litellm/proxy/db/test_prisma_self_heal.py@@ -8,9 +8,6 @@ from unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy.utils import PrismaClient, ProxyLoggingdiff --git a/tests/test_litellm/proxy/db/test_routing_prisma_wrapper.py b/tests/test_litellm/proxy/db/test_routing_prisma_wrapper.pyindex 11ed63cf8f0..dcc0036ff04 100644--- a/tests/test_litellm/proxy/db/test_routing_prisma_wrapper.py+++ b/tests/test_litellm/proxy/db/test_routing_prisma_wrapper.py@@ -7,7 +7,6 @@ from unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))# NOTE: do NOT patch sys.modules["prisma"] file-wide via an autouse fixture.diff --git a/tests/test_litellm/proxy/db/test_tool_registry_writer.py b/tests/test_litellm/proxy/db/test_tool_registry_writer.pyindex 7bf1ffda4fe..6318e4422cf 100644--- a/tests/test_litellm/proxy/db/test_tool_registry_writer.py+++ b/tests/test_litellm/proxy/db/test_tool_registry_writer.py@@ -3,14 +3,11 @@ Unit tests for tool_registry_writer.py — uses a mock prisma clientthat exposes litellm_tooltable.upsert / find_many / find_unique."""-import os-import sysfrom datetime import datetime, timezonefrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.proxy.db.tool_registry_writer import (ToolPolicyRegistry,diff --git a/tests/test_litellm/proxy/discovery_endpoints/test_ui_discovery_endpoints.py b/tests/test_litellm/proxy/discovery_endpoints/test_ui_discovery_endpoints.pyindex 37f5e6046ca..f4da8c941a4 100644--- a/tests/test_litellm/proxy/discovery_endpoints/test_ui_discovery_endpoints.py+++ b/tests/test_litellm/proxy/discovery_endpoints/test_ui_discovery_endpoints.py@@ -1,12 +1,10 @@import os-import sysfrom unittest.mock import MagicMock, patchimport pytestfrom fastapi import FastAPIfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../.."))from litellm.proxy.discovery_endpoints.ui_discovery_endpoints import routerfrom litellm.types.proxy.control_plane_endpoints import WorkerRegistryEntrydiff --git a/tests/test_litellm/proxy/experimental/mcp_server/test_tool_registry.py b/tests/test_litellm/proxy/experimental/mcp_server/test_tool_registry.pyindex d5ba9744c7d..9fc2e8744c1 100644--- a/tests/test_litellm/proxy/experimental/mcp_server/test_tool_registry.py+++ b/tests/test_litellm/proxy/experimental/mcp_server/test_tool_registry.py@@ -1,12 +1,7 @@import json-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._experimental.mcp_server.tool_registry import MCPToolRegistrydiff --git a/tests/test_litellm/proxy/fine_tuning_endpoints/test_endpoints.py b/tests/test_litellm/proxy/fine_tuning_endpoints/test_endpoints.pyindex b54787bf428..7ed1a436cb6 100644--- a/tests/test_litellm/proxy/fine_tuning_endpoints/test_endpoints.py+++ b/tests/test_litellm/proxy/fine_tuning_endpoints/test_endpoints.py@@ -11,15 +11,12 @@ seam stayed untouched, so a guard that raises after the provider call would stil"""import base64-import os-import sysfrom contextlib import ExitStackfrom dataclasses import dataclassfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from fastapi import Responsediff --git a/tests/test_litellm/proxy/google_endpoints/test_endpoints.py b/tests/test_litellm/proxy/google_endpoints/test_endpoints.pyindex f3518999f72..92001118e2c 100644--- a/tests/test_litellm/proxy/google_endpoints/test_endpoints.py+++ b/tests/test_litellm/proxy/google_endpoints/test_endpoints.py@@ -13,7 +13,6 @@ from starlette.requests import Requestload_dotenv()-sys.path.insert(0, os.path.abspath("../../../.."))@pytest.mark.asynciodiff --git a/tests/test_litellm/proxy/google_endpoints/test_google_api_endpoints.py b/tests/test_litellm/proxy/google_endpoints/test_google_api_endpoints.pyindex 99f587e87a3..e4cd7d9dfa8 100644--- a/tests/test_litellm/proxy/google_endpoints/test_google_api_endpoints.py+++ b/tests/test_litellm/proxy/google_endpoints/test_google_api_endpoints.py@@ -3,15 +3,10 @@Test to verify the Google GenAI proxy API endpoints"""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathdef _build_test_client():diff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/_cisco_ai_defense_test_utils.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/_cisco_ai_defense_test_utils.pyindex 4f29d83d4a5..f09135dd56d 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/_cisco_ai_defense_test_utils.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/_cisco_ai_defense_test_utils.py@@ -1,6 +1,5 @@import jsonimport os-import sysfrom contextlib import contextmanagerfrom datetime import datetimefrom types import SimpleNamespace@@ -39,7 +38,6 @@ def _make_model_response_with_content(content: str) -> ModelResponse:)-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import DualCachefrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_content_filter.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_content_filter.pyindex 62d25f1b9c0..be55ac47bde 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_content_filter.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_content_filter.py@@ -4,14 +4,10 @@ Tests for the Content Filter Guardrailimport jsonimport os-import sysfrom unittest.mock import MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../../")-) # Adds the parent directory to the system pathfrom fastapi import HTTPExceptiondiff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_gdpr_policy_e2e.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_gdpr_policy_e2e.pyindex 238331b32c8..4af9bd99ed1 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_gdpr_policy_e2e.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_gdpr_policy_e2e.py@@ -3,12 +3,9 @@ End-to-end tests for GDPR Art. 32 EU PII Protection policy templateTests the complete policy with various EU PII patterns"""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../"))from litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.content_filter import (ContentFilterGuardrail,diff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_patterns.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_patterns.pyindex c942e5fe820..d702b9e0116 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_patterns.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_patterns.py@@ -4,11 +4,9 @@ Tests for content filter pattern loading from JSONimport jsonimport os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../"))from litellm.proxy.guardrails.guardrail_hooks.litellm_content_filter.patterns import (PATTERN_CATEGORIES,diff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/openai/test_moderations.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/openai/test_moderations.pyindex 729dcb54309..112bc5e6e49 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/openai/test_moderations.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/openai/test_moderations.py@@ -4,9 +4,7 @@ Test OpenAI Moderation Guardrail"""import os-import sys-sys.path.insert(0, os.path.abspath("../../../../../.."))from unittest.mock import MagicMock, patchdiff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_guardrails.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_guardrails.pyindex 5d971bf1212..dd339d4e51f 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_guardrails.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_guardrails.py@@ -3,7 +3,6 @@ Unit tests for Bedrock Guardrails"""import json-import osimport sysfrom unittest.mock import AsyncMock, MagicMock, patch@@ -11,7 +10,6 @@ import httpximport pytestfrom fastapi import HTTPException-sys.path.insert(0, os.path.abspath("../../../../../.."))import litellmfrom litellm.caching.caching import DualCachediff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_invoke_guardrail_checks.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_invoke_guardrail_checks.pyindex ceb59571389..d842a1ee5f9 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_invoke_guardrail_checks.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_bedrock_invoke_guardrail_checks.py@@ -6,14 +6,11 @@ All Bedrock HTTP calls are mocked; no real AWS calls are made.import jsonimport logging-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi import HTTPException-sys.path.insert(0, os.path.abspath("../../../../../.."))from litellm.exceptions import ModifyResponseExceptionfrom litellm.proxy.guardrails.guardrail_hooks.bedrock_guardrails import (diff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_cato_networks.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_cato_networks.pyindex caed64ef417..d319d619ff7 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_cato_networks.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_cato_networks.py@@ -1,8 +1,6 @@import asyncioimport json-import osimport ssl-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest@@ -18,9 +16,6 @@ from litellm.proxy.guardrails.guardrail_hooks.cato_networks.cato_networks importfrom litellm.proxy.proxy_server import UserAPIKeyAuthfrom litellm.types.utils import ModelResponse, ResponsesAPIResponse-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy.guardrails.init_guardrails import init_guardrails_v2diff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_lasso.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_lasso.pyindex dcb004e5422..870c5e6d4a0 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_lasso.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_lasso.py@@ -1,12 +1,10 @@import os-import sysimport pytestimport uuidfrom unittest.mock import patch, MagicMockfrom httpx import Response, Requestfrom fastapi import HTTPException-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import DualCachediff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_mcp_end_user_permission.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_mcp_end_user_permission.pyindex 713f089e158..596c11908cb 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_mcp_end_user_permission.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_mcp_end_user_permission.py@@ -2,15 +2,10 @@Tests for MCP End User Permission Guardrail Hook"""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.exceptions import GuardrailRaisedExceptionfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.pyindex 613cbbce8b4..da66c36328e 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.py@@ -2,13 +2,10 @@ import asyncioimport base64import ioimport json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, Mock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))import httpxfrom fastapi import HTTPExceptiondiff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_presidio.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_presidio.pyindex c779150ad3e..60be3be5e8b 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_presidio.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_presidio.py@@ -4,14 +4,11 @@ Tests PII detection and masking for different message formats"""import asyncio-import os-import sysfrom contextlib import asynccontextmanagerfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../../../.."))import litellmfrom litellm.caching.caching import DualCachediff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_tool_permission.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_tool_permission.pyindex 0c5addbc143..0dbd4591ac9 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_tool_permission.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_tool_permission.py@@ -3,16 +3,13 @@ Unit tests for Tool Permission Guardrail (OpenAI tool_calls semantics)"""import json-import osimport re-import sysfrom unittest.mock import patchimport pytestfrom litellm.caching.dual_cache import DualCache-sys.path.insert(0, os.path.abspath("../../../../../.."))from fastapi import HTTPExceptiondiff --git a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_tool_policy_guardrail.py b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_tool_policy_guardrail.pyindex 8b9b6820e8c..9113ac5015f 100644--- a/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_tool_policy_guardrail.py+++ b/tests/test_litellm/proxy/guardrails/guardrail_hooks/test_tool_policy_guardrail.py@@ -2,15 +2,12 @@Unit tests for ToolPolicyGuardrail."""-import os-import sysfrom typing import Anyfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi import HTTPException-sys.path.insert(0, os.path.abspath("../../../../../.."))from litellm.proxy.guardrails.guardrail_hooks.tool_policy.tool_policy_guardrail import (ToolPolicyGuardrail,diff --git a/tests/test_litellm/proxy/guardrails/test_deferred_guardrail_logging.py b/tests/test_litellm/proxy/guardrails/test_deferred_guardrail_logging.pyindex 291ce732fc6..e70fc61de30 100644--- a/tests/test_litellm/proxy/guardrails/test_deferred_guardrail_logging.py+++ b/tests/test_litellm/proxy/guardrails/test_deferred_guardrail_logging.py@@ -15,14 +15,11 @@ Streaming: CSW.__anext__ stores args on logging_obj at stream end."""import asyncio-import os-import sysfrom typing import Anyfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.caching.caching import DualCachediff --git a/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py b/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.pyindex 71ff9111b60..45f5afef1bc 100644--- a/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py+++ b/tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py@@ -1,15 +1,10 @@import json-import os-import sysfrom datetime import datetimefrom typing import Dict, List, Optionalfrom unittest.mock import AsyncMockimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom fastapi import HTTPExceptiondiff --git a/tests/test_litellm/proxy/guardrails/test_init_guardrails.py b/tests/test_litellm/proxy/guardrails/test_init_guardrails.pyindex 8edb56ce25e..82363302d2e 100644--- a/tests/test_litellm/proxy/guardrails/test_init_guardrails.py+++ b/tests/test_litellm/proxy/guardrails/test_init_guardrails.py@@ -1,11 +1,8 @@import json-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathfrom litellm.proxy.guardrails.guardrail_registry import InMemoryGuardrailHandlerfrom litellm.types.guardrails import SupportedGuardrailIntegrationsdiff --git a/tests/test_litellm/proxy/guardrails/test_pillar_guardrails.py b/tests/test_litellm/proxy/guardrails/test_pillar_guardrails.pyindex 02123bc8c76..c6be433399a 100644--- a/tests/test_litellm/proxy/guardrails/test_pillar_guardrails.py+++ b/tests/test_litellm/proxy/guardrails/test_pillar_guardrails.py@@ -7,13 +7,10 @@ and following LiteLLM testing patterns and best practices.# Standard library importsimport importlib-import os-import sysfrom typing import Any, Dictfrom unittest.mock import Mock, patch# Add parent directory to path for imports-sys.path.insert(0, os.path.abspath("../../.."))# Third-party importsimport jsondiff --git a/tests/test_litellm/proxy/guardrails/test_usage_endpoints.py b/tests/test_litellm/proxy/guardrails/test_usage_endpoints.pyindex ff143bd055f..1665fa03639 100644--- a/tests/test_litellm/proxy/guardrails/test_usage_endpoints.py+++ b/tests/test_litellm/proxy/guardrails/test_usage_endpoints.py@@ -8,15 +8,12 @@ detail 404'd, overview omitted them (or rendered them as Custom/Guardrailorphans), and logs missed their logical-name alias."""-import os-import sysfrom datetime import datetimefrom typing import Any, Optionalfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from fastapi import HTTPExceptionfrom prisma.errors import TableNotFoundErrordiff --git a/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py b/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.pyindex e576ba87e88..62919200d47 100644--- a/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py+++ b/tests/test_litellm/proxy/health_endpoints/test_health_endpoints.py@@ -1,13 +1,8 @@-import os-import sysimport timefrom datetime import datetime, timedeltafrom types import SimpleNamespacefrom unittest.mock import AsyncMock, MagicMock, patch-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport httpximport pytestdiff --git a/tests/test_litellm/proxy/hooks/test_async_post_call_streaming_iterator_hook.py b/tests/test_litellm/proxy/hooks/test_async_post_call_streaming_iterator_hook.pyindex 9a097230c19..9c785d59830 100644--- a/tests/test_litellm/proxy/hooks/test_async_post_call_streaming_iterator_hook.py+++ b/tests/test_litellm/proxy/hooks/test_async_post_call_streaming_iterator_hook.py@@ -7,16 +7,11 @@ Verifies that the hook:3. Actually yields chunks from async generators"""-import os-import sysfrom typing import AsyncGenerator, Anyfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.integrations.custom_logger import CustomLoggerdiff --git a/tests/test_litellm/proxy/hooks/test_dynamic_rate_limiter_v3.py b/tests/test_litellm/proxy/hooks/test_dynamic_rate_limiter_v3.pyindex 13997fc4cd1..0ff8b67b1a7 100644--- a/tests/test_litellm/proxy/hooks/test_dynamic_rate_limiter_v3.py+++ b/tests/test_litellm/proxy/hooks/test_dynamic_rate_limiter_v3.py@@ -6,14 +6,12 @@ Core tests to validate that priority weights are respected (0.9/0.1) instead ofimport asyncioimport os-import sysimport timefrom datetime import datetime, timedeltafrom unittest.mock import AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm import DualCache, Routerdiff --git a/tests/test_litellm/proxy/hooks/test_image_generation_guardrails.py b/tests/test_litellm/proxy/hooks/test_image_generation_guardrails.pyindex 04fdc00e114..fd8299b07ec 100644--- a/tests/test_litellm/proxy/hooks/test_image_generation_guardrails.py+++ b/tests/test_litellm/proxy/hooks/test_image_generation_guardrails.py@@ -9,14 +9,11 @@ These tests verify:3. A guardrail that raises blocks the response (exception propagates)."""-import os-import sysfrom typing import Any, Optionalfrom unittest.mock import patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.caching.caching import DualCachediff --git a/tests/test_litellm/proxy/hooks/test_key_management_event_hooks.py b/tests/test_litellm/proxy/hooks/test_key_management_event_hooks.pyindex fa7320b2bc6..860fb762450 100644--- a/tests/test_litellm/proxy/hooks/test_key_management_event_hooks.py+++ b/tests/test_litellm/proxy/hooks/test_key_management_event_hooks.py@@ -5,13 +5,10 @@ Validates that email and secret manager operations are independent and non-block"""import asyncio-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy.hooks.key_management_event_hooks import KeyManagementEventHooksdiff --git a/tests/test_litellm/proxy/hooks/test_post_call_failure_hook_integration.py b/tests/test_litellm/proxy/hooks/test_post_call_failure_hook_integration.pyindex f9cb586d405..55e058d86a1 100644--- a/tests/test_litellm/proxy/hooks/test_post_call_failure_hook_integration.py+++ b/tests/test_litellm/proxy/hooks/test_post_call_failure_hook_integration.py@@ -5,13 +5,10 @@ Tests verify that the failure hook can transform error responses sent to clientssimilar to how async_post_call_success_hook can transform successful responses."""-import os-import sysimport pytestfrom typing import Optionalfrom unittest.mock import patch-sys.path.insert(0, os.path.abspath("../../../.."))from fastapi import HTTPExceptionfrom litellm.integrations.custom_logger import CustomLoggerdiff --git a/tests/test_litellm/proxy/hooks/test_post_call_response_headers_hook.py b/tests/test_litellm/proxy/hooks/test_post_call_response_headers_hook.pyindex 660b0b0162a..a896ab62bef 100644--- a/tests/test_litellm/proxy/hooks/test_post_call_response_headers_hook.py+++ b/tests/test_litellm/proxy/hooks/test_post_call_response_headers_hook.py@@ -5,13 +5,10 @@ Tests verify that CustomLogger callbacks can inject custom HTTP response headersinto success (streaming and non-streaming) and failure responses."""-import os-import sysimport pytestfrom typing import Any, Dict, Optionalfrom unittest.mock import patch-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.integrations.custom_logger import CustomLoggerfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/test_litellm/proxy/hooks/test_post_call_streaming_hook_integration.py b/tests/test_litellm/proxy/hooks/test_post_call_streaming_hook_integration.pyindex 22349ec9821..e539bd3a0b2 100644--- a/tests/test_litellm/proxy/hooks/test_post_call_streaming_hook_integration.py+++ b/tests/test_litellm/proxy/hooks/test_post_call_streaming_hook_integration.py@@ -4,13 +4,10 @@ Integration tests for async_post_call_streaming_hook.Tests verify that the streaming hook can transform streaming responses sent to clients."""-import os-import sysimport pytestfrom typing import Anyfrom unittest.mock import patch, MagicMock-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.integrations.custom_logger import CustomLoggerdiff --git a/tests/test_litellm/proxy/hooks/test_post_call_success_hook_integration.py b/tests/test_litellm/proxy/hooks/test_post_call_success_hook_integration.pyindex 219f436f985..50208cc278e 100644--- a/tests/test_litellm/proxy/hooks/test_post_call_success_hook_integration.py+++ b/tests/test_litellm/proxy/hooks/test_post_call_success_hook_integration.py@@ -5,13 +5,10 @@ Tests verify that the success hook can transform responses sent to clients.This mirrors the behavior of CustomGuardrail hooks and streaming iterator hooks."""-import os-import sysimport pytestfrom typing import Anyfrom unittest.mock import patch, MagicMock-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.integrations.custom_logger import CustomLoggerdiff --git a/tests/test_litellm/proxy/hooks/test_proxy_track_cost_callback.py b/tests/test_litellm/proxy/hooks/test_proxy_track_cost_callback.pyindex 50c93ed5275..871f4b4bcd1 100644--- a/tests/test_litellm/proxy/hooks/test_proxy_track_cost_callback.py+++ b/tests/test_litellm/proxy/hooks/test_proxy_track_cost_callback.py@@ -1,11 +1,6 @@-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom datetime import datetimefrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/proxy/hooks/test_rate_limiter_toctou.py b/tests/test_litellm/proxy/hooks/test_rate_limiter_toctou.pyindex 97a986d1ade..23c717b0e3a 100644--- a/tests/test_litellm/proxy/hooks/test_rate_limiter_toctou.py+++ b/tests/test_litellm/proxy/hooks/test_rate_limiter_toctou.py@@ -18,12 +18,10 @@ check-and-increment becomes atomic.import asyncioimport os-import sysfrom typing import Listimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm import DualCache, Routerdiff --git a/tests/test_litellm/proxy/image_endpoints/test_azure_routes.py b/tests/test_litellm/proxy/image_endpoints/test_azure_routes.pyindex f5410ef0d70..91fff717d25 100644--- a/tests/test_litellm/proxy/image_endpoints/test_azure_routes.py+++ b/tests/test_litellm/proxy/image_endpoints/test_azure_routes.py@@ -1,13 +1,11 @@import asyncioimport os-import sysfrom pathlib import Pathfrom unittest import mockimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.proxy.proxy_server import app, initializediff --git a/tests/test_litellm/proxy/management_endpoints/scim/test_scim_transformations.py b/tests/test_litellm/proxy/management_endpoints/scim/test_scim_transformations.pyindex 6970e34f759..9853ce7e1cf 100644--- a/tests/test_litellm/proxy/management_endpoints/scim/test_scim_transformations.py+++ b/tests/test_litellm/proxy/management_endpoints/scim/test_scim_transformations.py@@ -1,12 +1,7 @@-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../")-) # Adds the parent directory to the system pathfrom litellm.proxy._types import LiteLLM_TeamTable, LiteLLM_UserTable, Memberfrom litellm.proxy.management_endpoints.scim.scim_transformations import (diff --git a/tests/test_litellm/proxy/management_endpoints/search_endpoints/test_search_tool_management.py b/tests/test_litellm/proxy/management_endpoints/search_endpoints/test_search_tool_management.pyindex a64397d9818..7b895cd7fdb 100644--- a/tests/test_litellm/proxy/management_endpoints/search_endpoints/test_search_tool_management.py+++ b/tests/test_litellm/proxy/management_endpoints/search_endpoints/test_search_tool_management.py@@ -1,6 +1,4 @@import contextlib-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, MagicMock, patch@@ -8,9 +6,6 @@ import pytestfrom fastapi import HTTPExceptionfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._types import (LiteLLM_ObjectPermissionTable,diff --git a/tests/test_litellm/proxy/management_endpoints/test_access_group_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_access_group_endpoints.pyindex 016e10859b6..e8f768c14ef 100644--- a/tests/test_litellm/proxy/management_endpoints/test_access_group_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_access_group_endpoints.py@@ -2,8 +2,6 @@Tests for access group management endpoints."""-import os-import sysimport typesfrom contextlib import asynccontextmanagerfrom datetime import datetime@@ -21,7 +19,6 @@ from litellm.proxy._types import (UserAPIKeyAuth,)-sys.path.insert(0, os.path.abspath("../../../"))def _make_access_group_record(diff --git a/tests/test_litellm/proxy/management_endpoints/test_access_group_management.py b/tests/test_litellm/proxy/management_endpoints/test_access_group_management.pyindex c973c6a8346..db0557cfbf0 100644--- a/tests/test_litellm/proxy/management_endpoints/test_access_group_management.py+++ b/tests/test_litellm/proxy/management_endpoints/test_access_group_management.py@@ -2,15 +2,10 @@Test access group management endpoints"""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm import Routerfrom litellm.proxy.management_endpoints.model_management_endpoints import (diff --git a/tests/test_litellm/proxy/management_endpoints/test_auto_router_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_auto_router_endpoints.pyindex 5c61f8c557c..805168c84ac 100644--- a/tests/test_litellm/proxy/management_endpoints/test_auto_router_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_auto_router_endpoints.py@@ -2,8 +2,6 @@Unit tests for auto router management endpoints"""-import os-import sysfrom pathlib import Pathfrom typing import Final@@ -11,7 +9,6 @@ import pytestfrom fastapi import HTTPExceptionfrom pydantic import ValidationError-sys.path.insert(0, os.path.abspath("../../../..")) # Adds the parent directory to the system pathfrom litellm.proxy._types import (LitellmUserRoles,diff --git a/tests/test_litellm/proxy/management_endpoints/test_budget_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_budget_endpoints.pyindex 6a9e894feb5..0bad0d24be5 100644--- a/tests/test_litellm/proxy/management_endpoints/test_budget_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_budget_endpoints.py@@ -1,7 +1,5 @@# tests/test_budget_endpoints.py-import os-import sysimport typesfrom datetime import datetime, timedelta, timezoneimport pytest@@ -12,9 +10,6 @@ import litellm.proxy.proxy_server as psfrom litellm.proxy.proxy_server import appfrom litellm.proxy._types import UserAPIKeyAuth, LitellmUserRoles, CommonProxyErrors-sys.path.insert(- 0, os.path.abspath("../../../")-) # Adds the parent directory to the system path@pytest.fixturediff --git a/tests/test_litellm/proxy/management_endpoints/test_cache_settings_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_cache_settings_endpoints.pyindex 2504b5744fc..9a2dd914866 100644--- a/tests/test_litellm/proxy/management_endpoints/test_cache_settings_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_cache_settings_endpoints.py@@ -4,13 +4,10 @@ Unit tests for cache settings management endpointsimport asyncioimport json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../..")) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy._types import LitellmTableNames, LitellmUserRolesdiff --git a/tests/test_litellm/proxy/management_endpoints/test_callback_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_callback_management_endpoints.pyindex dfc9f0361c6..b2a242bf8f2 100644--- a/tests/test_litellm/proxy/management_endpoints/test_callback_management_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_callback_management_endpoints.py@@ -1,13 +1,11 @@import jsonimport os-import sysfrom datetime import datetime, timezonefrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../..")) #from typing import castdiff --git a/tests/test_litellm/proxy/management_endpoints/test_common_daily_activity.py b/tests/test_litellm/proxy/management_endpoints/test_common_daily_activity.pyindex 1491782419f..1bcb331430e 100644--- a/tests/test_litellm/proxy/management_endpoints/test_common_daily_activity.py+++ b/tests/test_litellm/proxy/management_endpoints/test_common_daily_activity.py@@ -1,5 +1,3 @@-import os-import sysfrom datetime import datetime, timedelta, timezonefrom types import SimpleNamespacefrom typing import Final@@ -9,7 +7,6 @@ import pytestfrom litellm.proxy.spend_tracking.ptu_feature_flag import PTU_COST_ATTRIBUTION_ENV_VAR-sys.path.insert(0, os.path.abspath("../../../..")) # Adds the parent directory to the system pathfrom litellm.proxy.management_endpoints.common_daily_activity import (_adjust_dates_for_timezone,diff --git a/tests/test_litellm/proxy/management_endpoints/test_compliance_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_compliance_endpoints.pyindex 33e45ccb22c..dcbe515d5de 100644--- a/tests/test_litellm/proxy/management_endpoints/test_compliance_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_compliance_endpoints.py@@ -2,12 +2,9 @@Unit tests for compliance check endpoints (EU AI Act and GDPR)."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../..")) # Adds the parent directory to the system pathfrom litellm.proxy.compliance_checks import ComplianceCheckerfrom litellm.types.proxy.compliance_endpoints import ComplianceCheckRequestdiff --git a/tests/test_litellm/proxy/management_endpoints/test_coordination_redis_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_coordination_redis_endpoints.pyindex 2e78a4ca0e3..4481a87c9e7 100644--- a/tests/test_litellm/proxy/management_endpoints/test_coordination_redis_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_coordination_redis_endpoints.py@@ -4,14 +4,11 @@ Unit tests for coordination Redis settings management endpointsimport asyncioimport json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi import HTTPException-sys.path.insert(0, os.path.abspath("../../../..")) # Adds the parent directory to the system pathimport litellmfrom litellm.caching.caching import RedisCachediff --git a/tests/test_litellm/proxy/management_endpoints/test_cost_tracking_settings.py b/tests/test_litellm/proxy/management_endpoints/test_cost_tracking_settings.pyindex ea86731eba4..e1eb031abc2 100644--- a/tests/test_litellm/proxy/management_endpoints/test_cost_tracking_settings.py+++ b/tests/test_litellm/proxy/management_endpoints/test_cost_tracking_settings.py@@ -4,14 +4,11 @@ Tests for cost tracking settings management endpoints.Tests the GET and PATCH endpoints for managing cost discount configuration."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../.."))import litellmfrom litellm.proxy.management_endpoints.cost_tracking_settings import routerdiff --git a/tests/test_litellm/proxy/management_endpoints/test_delete_callbacks_endpoint.py b/tests/test_litellm/proxy/management_endpoints/test_delete_callbacks_endpoint.pyindex 4ba656d1286..291f3d8fe2f 100644--- a/tests/test_litellm/proxy/management_endpoints/test_delete_callbacks_endpoint.py+++ b/tests/test_litellm/proxy/management_endpoints/test_delete_callbacks_endpoint.py@@ -1,11 +1,8 @@-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import (CallbackDelete,diff --git a/tests/test_litellm/proxy/management_endpoints/test_delete_verification_tokens_failed.py b/tests/test_litellm/proxy/management_endpoints/test_delete_verification_tokens_failed.pyindex 63e584e49bc..e33945df7dc 100644--- a/tests/test_litellm/proxy/management_endpoints/test_delete_verification_tokens_failed.py+++ b/tests/test_litellm/proxy/management_endpoints/test_delete_verification_tokens_failed.py@@ -8,12 +8,9 @@ its result dict in all scenarios, populated with any token hashes that couldnot be deleted."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from unittest.mock import AsyncMock, MagicMockdiff --git a/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.pyindex da51d513b39..f86e17c61b0 100644--- a/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_internal_user_endpoints.py@@ -1,15 +1,10 @@import json-import os-import sysfrom datetime import datetime, timezonefrom types import SimpleNamespaceimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._types import (LiteLLM_UserTableFiltered,diff --git a/tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.pyindex f8db8433be5..0d639e1cb6a 100644--- a/tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_mcp_management_endpoints.py@@ -17,7 +17,6 @@ from litellm.proxy.management_endpoints import (mcp_management_endpoints as mgmt_endpoints,)-sys.path.insert(0, os.path.abspath("../../../..")) # Adds the parent directory to the system pathfrom litellm.proxy._types import (LiteLLM_MCPServerTable,@@ -6482,7 +6481,6 @@ def test_bundled_openapi_registry_parses_and_entries_are_well_formed():authorization_url would recreate the exact 400 ("authorization url is not set") the catalogexists to prevent for spec-only servers, which never run OAuth endpoint discovery."""import json- import osregistry_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),diff --git a/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.pyindex 42e96ad8659..097230108d4 100644--- a/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_model_management_endpoints.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysfrom typing import Dict, Optionalfrom unittest.mock import AsyncMock, MagicMock, patch@@ -10,9 +8,6 @@ from fastapi.testclient import TestClientfrom litellm._uuid import uuid-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._types import (LiteLLM_ModelTable,LiteLLM_ProxyModelTable,diff --git a/tests/test_litellm/proxy/management_endpoints/test_org_admin_team_access.py b/tests/test_litellm/proxy/management_endpoints/test_org_admin_team_access.pyindex 9828d104a8b..d5c958f9f84 100644--- a/tests/test_litellm/proxy/management_endpoints/test_org_admin_team_access.py+++ b/tests/test_litellm/proxy/management_endpoints/test_org_admin_team_access.py@@ -7,14 +7,11 @@ Covers:- _user_is_org_admin route-level check (no privilege escalation)"""-import os-import sysfrom datetime import datetime, timezonefrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../"))from litellm.proxy._types import (LiteLLM_OrganizationMembershipTable,diff --git a/tests/test_litellm/proxy/management_endpoints/test_organization_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_organization_endpoints.pyindex 3061da336f6..a62c98e56a7 100644--- a/tests/test_litellm/proxy/management_endpoints/test_organization_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_organization_endpoints.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysfrom litellm._uuid import uuidfrom typing import Optional, castfrom unittest.mock import AsyncMock, MagicMock, patch@@ -10,7 +8,6 @@ import pytestfrom fastapi import HTTPExceptionfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../")) # Adds the parent directory to the system path@pytest.mark.asynciodiff --git a/tests/test_litellm/proxy/management_endpoints/test_router_settings_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_router_settings_endpoints.pyindex b62f077a62e..308f4d88f02 100644--- a/tests/test_litellm/proxy/management_endpoints/test_router_settings_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_router_settings_endpoints.py@@ -4,14 +4,11 @@ Tests for router settings management endpoints.Tests the GET endpoints for router settings and router fields."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy import proxy_serverfrom litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuthdiff --git a/tests/test_litellm/proxy/management_endpoints/test_tag_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_tag_management_endpoints.pyindex 018979aa19b..71c67837515 100644--- a/tests/test_litellm/proxy/management_endpoints/test_tag_management_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_tag_management_endpoints.py@@ -1,7 +1,5 @@import inspectimport json-import os-import sysfrom collections.abc import Sequencefrom typing import Optional@@ -10,9 +8,6 @@ from fastapi import HTTPExceptionfrom fastapi.testclient import TestClientfrom prisma.actions import LiteLLM_VerificationTokenActions-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom contextlib import contextmanagerfrom unittest.mock import AsyncMock, Mock, patchdiff --git a/tests/test_litellm/proxy/management_endpoints/test_team_default_params.py b/tests/test_litellm/proxy/management_endpoints/test_team_default_params.pyindex a485d95db06..265437f97e9 100644--- a/tests/test_litellm/proxy/management_endpoints/test_team_default_params.py+++ b/tests/test_litellm/proxy/management_endpoints/test_team_default_params.py@@ -3,14 +3,11 @@ Tests for applying default team params during team creationand loading default_team_params from DB on startup."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi import HTTPException-sys.path.insert(0, os.path.abspath("../../../")) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy._types import (diff --git a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.pyindex a4c2b7c06bf..34b12aecfed 100644--- a/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_team_endpoints.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysfrom contextlib import asynccontextmanagerfrom datetime import datetime, timezonefrom types import SimpleNamespace@@ -14,9 +12,6 @@ from fastapi.testclient import TestClientfrom litellm._uuid import uuid-sys.path.insert(- 0, os.path.abspath("../../../")-) # Adds the parent directory to the system pathfrom litellm.proxy._types import UserAPIKeyAuth # Import UserAPIKeyAuthfrom litellm.proxy._types import (LiteLLM_BudgetTableFull,diff --git a/tests/test_litellm/proxy/management_endpoints/test_team_model_alias_merge.py b/tests/test_litellm/proxy/management_endpoints/test_team_model_alias_merge.pyindex 45405ba78d6..7cdf60f043e 100644--- a/tests/test_litellm/proxy/management_endpoints/test_team_model_alias_merge.py+++ b/tests/test_litellm/proxy/management_endpoints/test_team_model_alias_merge.py@@ -6,13 +6,10 @@ Concurrent BYOK model creates must not overwrite each other's entriesin team.models."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import (LitellmUserRoles,diff --git a/tests/test_litellm/proxy/management_endpoints/test_tool_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_tool_management_endpoints.pyindex 18ea5c3f27d..09d14cfe5df 100644--- a/tests/test_litellm/proxy/management_endpoints/test_tool_management_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_tool_management_endpoints.py@@ -8,8 +8,6 @@ imports these inside function bodies to avoid circular imports."""import inspect-import os-import sysfrom collections.abc import Sequencefrom datetime import datetime, timedelta, timezonefrom typing import Optional@@ -20,7 +18,6 @@ from fastapi import FastAPIfrom fastapi.testclient import TestClientfrom prisma.actions import LiteLLM_TeamTableActions-sys.path.insert(0, os.path.abspath("../../.."))from litellm.proxy.management_endpoints.tool_management_endpoints import routerfrom litellm.types.tool_management import LiteLLM_ToolTableRowdiff --git a/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py b/tests/test_litellm/proxy/management_endpoints/test_ui_sso.pyindex 66cb07ef2c0..3facbf07889 100644--- a/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py+++ b/tests/test_litellm/proxy/management_endpoints/test_ui_sso.py@@ -1,7 +1,6 @@import asyncioimport jsonimport os-import sysfrom contextlib import asynccontextmanagerfrom types import SimpleNamespacefrom unittest.mock import AsyncMock, MagicMock, patch@@ -11,9 +10,6 @@ from fastapi import HTTPException, Requestfrom litellm._uuid import uuid-sys.path.insert(- 0, os.path.abspath("../../../")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy._types import LiteLLM_UserTable, NewUserResponsediff --git a/tests/test_litellm/proxy/management_endpoints/test_workflow_management_endpoints.py b/tests/test_litellm/proxy/management_endpoints/test_workflow_management_endpoints.pyindex 27adb3e0892..0c3d5107cb6 100644--- a/tests/test_litellm/proxy/management_endpoints/test_workflow_management_endpoints.py+++ b/tests/test_litellm/proxy/management_endpoints/test_workflow_management_endpoints.py@@ -4,8 +4,6 @@ Uses FastAPI TestClient with a mocked prisma_client."""import asyncio-import os-import sysfrom datetime import datetime, timezonefrom typing import Anyfrom unittest.mock import AsyncMock, MagicMock, patch@@ -15,7 +13,6 @@ from fastapi import FastAPI, HTTPExceptionfrom fastapi.testclient import TestClientfrom prisma.errors import UniqueViolationError-sys.path.insert(0, os.path.abspath("../../.."))from litellm.proxy.management_endpoints.workflow_management_endpoints import (_read_scope_caller,diff --git a/tests/test_litellm/proxy/management_helpers/test_access_group_team_sync.py b/tests/test_litellm/proxy/management_helpers/test_access_group_team_sync.pyindex eb11292cf42..f99b576019a 100644--- a/tests/test_litellm/proxy/management_helpers/test_access_group_team_sync.py+++ b/tests/test_litellm/proxy/management_helpers/test_access_group_team_sync.py@@ -1,9 +1,6 @@-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy.management_helpers.access_group_team_sync import (invalidate_access_group_caches,diff --git a/tests/test_litellm/proxy/management_helpers/test_management_helpers_utils.py b/tests/test_litellm/proxy/management_helpers/test_management_helpers_utils.pyindex 504414ea635..bdc2f9065b9 100644--- a/tests/test_litellm/proxy/management_helpers/test_management_helpers_utils.py+++ b/tests/test_litellm/proxy/management_helpers/test_management_helpers_utils.py@@ -1,15 +1,10 @@import json-import os-import sysfrom datetime import datetime, timezonefrom litellm._uuid import uuidfrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._types import (LiteLLM_TeamMembership,diff --git a/tests/test_litellm/proxy/management_helpers/test_object_permission_utils.py b/tests/test_litellm/proxy/management_helpers/test_object_permission_utils.pyindex d797a27aa67..b129ad0f659 100644--- a/tests/test_litellm/proxy/management_helpers/test_object_permission_utils.py+++ b/tests/test_litellm/proxy/management_helpers/test_object_permission_utils.py@@ -1,11 +1,8 @@import json-import os-import sysimport pytestfrom fastapi import HTTPException-sys.path.insert(0, os.path.abspath("../../../.."))from unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/proxy/management_helpers/test_team_member_permission_checks.py b/tests/test_litellm/proxy/management_helpers/test_team_member_permission_checks.pyindex 71999e29f96..36c61eddbb2 100644--- a/tests/test_litellm/proxy/management_helpers/test_team_member_permission_checks.py+++ b/tests/test_litellm/proxy/management_helpers/test_team_member_permission_checks.py@@ -1,12 +1,7 @@-import os-import sysfrom unittest.mock import MagicMockimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._types import KeyManagementRoutes, Member, ProxyExceptionfrom litellm.proxy.management_helpers.team_member_permission_checks import (diff --git a/tests/test_litellm/proxy/management_helpers/test_team_metadata_validation.py b/tests/test_litellm/proxy/management_helpers/test_team_metadata_validation.pyindex 1acb8e7e016..dfb834dc31f 100644--- a/tests/test_litellm/proxy/management_helpers/test_team_metadata_validation.py+++ b/tests/test_litellm/proxy/management_helpers/test_team_metadata_validation.py@@ -1,12 +1,9 @@import asyncio-import os-import sysfrom unittest.mock import patchimport pytestfrom fastapi import HTTPException-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import CommonProxyErrors, LitellmUserRoles, UserAPIKeyAuthfrom litellm.proxy.management_helpers.team_metadata_validation import (diff --git a/tests/test_litellm/proxy/memory/test_memory_endpoints.py b/tests/test_litellm/proxy/memory/test_memory_endpoints.pyindex ec81ef2ff7a..3d99a600a73 100644--- a/tests/test_litellm/proxy/memory/test_memory_endpoints.py+++ b/tests/test_litellm/proxy/memory/test_memory_endpoints.py@@ -7,8 +7,6 @@ We patch the endpoint module's `_require_prisma` helper so we never need thereal proxy_server import chain (which pulls heavy optional deps)."""-import os-import sysfrom datetime import datetime, timezonefrom typing import Any, Dict, List, Optionalfrom unittest.mock import MagicMock, patch@@ -16,7 +14,6 @@ from unittest.mock import MagicMock, patchfrom fastapi import FastAPIfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../.."))from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuthfrom litellm.proxy.memory.memory_endpoints import _visibility_filter, routerdiff --git a/tests/test_litellm/proxy/openai_files_endpoint/test_files_common_utils.py b/tests/test_litellm/proxy/openai_files_endpoint/test_files_common_utils.pyindex 6ffb7daaa2d..2161e345b40 100644--- a/tests/test_litellm/proxy/openai_files_endpoint/test_files_common_utils.py+++ b/tests/test_litellm/proxy/openai_files_endpoint/test_files_common_utils.py@@ -1,11 +1,8 @@-import os-import sysfrom types import MappingProxyTypefrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy.openai_files_endpoints.common_utils import (apply_unified_file_ids,diff --git a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.pyindex bf9323cdc6a..237a3092035 100644--- a/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py+++ b/tests/test_litellm/proxy/openai_files_endpoint/test_files_endpoint.py@@ -1,6 +1,4 @@import json-import os-import sysfrom typing import Listfrom unittest.mock import ANY, AsyncMock@@ -10,9 +8,6 @@ import httpxfrom fastapi.testclient import TestClientfrom pytest_mock import MockerFixture-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm import Routerdiff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.pyindex 7985faa9e4b..8163d009fef 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py@@ -1,16 +1,11 @@import asyncioimport json-import os-import sysfrom datetime import datetimefrom typing import Any, Dict, Listfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjfrom litellm.proxy.pass_through_endpoints.llm_provider_handlers.anthropic_passthrough_logging_handler import (diff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cohere_passthrough_logging_handler.py b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cohere_passthrough_logging_handler.pyindex 6d7011fe10c..814c1a14f3d 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cohere_passthrough_logging_handler.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cohere_passthrough_logging_handler.py@@ -1,13 +1,10 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjfrom litellm.proxy.pass_through_endpoints.llm_provider_handlers.cohere_passthrough_logging_handler import (diff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_comprehend_medical_passthrough_logging_handler.py b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_comprehend_medical_passthrough_logging_handler.pyindex 1804877e688..20ec78cc8de 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_comprehend_medical_passthrough_logging_handler.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_comprehend_medical_passthrough_logging_handler.py@@ -1,12 +1,9 @@-import os-import sysfrom datetime import datetimefrom unittest.mock import MagicMockimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.proxy.pass_through_endpoints.llm_provider_handlers.comprehend_medical_passthrough_logging_handler import (ComprehendMedicalPassthroughLoggingHandler,diff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cursor_passthrough_logging_handler.py b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cursor_passthrough_logging_handler.pyindex 2d025a871b7..af2bb1c816e 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cursor_passthrough_logging_handler.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_cursor_passthrough_logging_handler.py@@ -1,12 +1,9 @@-import os-import sysfrom datetime import datetimefrom unittest.mock import MagicMockimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../../.."))from litellm.proxy.pass_through_endpoints.llm_provider_handlers.cursor_passthrough_logging_handler import (CursorPassthroughLoggingHandler,diff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.py b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.pyindex fae6b6122f5..61d1caacb91 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_gemini_passthrough_logging_handler.py@@ -1,15 +1,10 @@import json-import os-import sysfrom datetime import datetimefrom unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjfrom litellm.proxy.pass_through_endpoints.llm_provider_handlers.gemini_passthrough_logging_handler import (diff --git a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_openai_passthrough_logging_handler.py b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_openai_passthrough_logging_handler.pyindex 69819318800..f0b2feeb377 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_openai_passthrough_logging_handler.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_openai_passthrough_logging_handler.py@@ -1,6 +1,4 @@import json-import os-import sysfrom datetime import datetimefrom typing import Any, Dict, Listfrom unittest.mock import AsyncMock, MagicMock, patch@@ -8,7 +6,6 @@ from unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathfrom litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjfrom litellm.proxy.pass_through_endpoints.llm_provider_handlers.openai_passthrough_logging_handler import (diff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py b/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.pyindex 6568f6aeacf..ac140abe31f 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py@@ -1,7 +1,6 @@import contextlibimport jsonimport os-import sysimport tracebackfrom collections.abc import Mappingfrom types import MappingProxyType, SimpleNamespace@@ -14,9 +13,6 @@ import pytestfrom fastapi import HTTPException, Request, Responsefrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (diff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_pass_through_endpoints.py b/tests/test_litellm/proxy/pass_through_endpoints/test_pass_through_endpoints.pyindex 4c6ba23c88c..25d176e48bb 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/test_pass_through_endpoints.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_pass_through_endpoints.py@@ -2,7 +2,6 @@ import asyncioimport jsonimport loggingimport os-import sysfrom contextlib import ExitStack, contextmanagerfrom io import BytesIOfrom types import SimpleNamespace@@ -15,7 +14,6 @@ from fastapi import Request, UploadFilefrom starlette.datastructures import FormData, Headers, QueryParamsfrom starlette.datastructures import UploadFile as StarletteUploadFile-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathfrom litellm.proxy.pass_through_endpoints.pass_through_endpoints import (DEFAULT_PASS_THROUGH_REQUEST_TIMEOUT_SECONDS,diff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_auth_default.py b/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_auth_default.pyindex 4cac1cb4d3b..44a75c362e5 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_auth_default.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_auth_default.py@@ -19,14 +19,11 @@ defaults to ``True`` so a config dict (raw, not Pydantic) without an``auth`` key still requires authentication."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport pytestfrom fastapi import FastAPI-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import PassThroughGenericEndpointfrom litellm.proxy.auth.user_api_key_auth import (diff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_endpoints_common_utils.py b/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_endpoints_common_utils.pyindex 797b22784ae..37d2141e460 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_endpoints_common_utils.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_endpoints_common_utils.py@@ -1,6 +1,4 @@import json-import os-import sysimport tracebackfrom unittest import mockfrom unittest.mock import MagicMock, patch@@ -12,9 +10,6 @@ from fastapi.testclient import TestClientfrom litellm.passthrough.utils import CommonUtils-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import Mockdiff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_guardrails_field_targeting.py b/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_guardrails_field_targeting.pyindex 84856fcb0b1..23f258f0362 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_guardrails_field_targeting.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_passthrough_guardrails_field_targeting.py@@ -6,13 +6,10 @@ and send only specified fields to the guardrail."""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.proxy._types import PassThroughGuardrailSettingsfrom litellm.proxy.pass_through_endpoints.passthrough_guardrails import (diff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_upstream_usage_headers.py b/tests/test_litellm/proxy/pass_through_endpoints/test_upstream_usage_headers.pyindex 34c345b620f..701c583a4ab 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/test_upstream_usage_headers.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_upstream_usage_headers.py@@ -1,10 +1,7 @@-import os-import sysimport httpximport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.litellm_core_utils.litellm_logging import Logging as LiteLLMLoggingObjfrom litellm.proxy.pass_through_endpoints.upstream_usage_headers import (diff --git a/tests/test_litellm/proxy/pass_through_endpoints/test_watsonx_proxy_route.py b/tests/test_litellm/proxy/pass_through_endpoints/test_watsonx_proxy_route.pyindex 19a2f7a0506..5500bb0aad9 100644--- a/tests/test_litellm/proxy/pass_through_endpoints/test_watsonx_proxy_route.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_watsonx_proxy_route.py@@ -6,16 +6,11 @@ and version parameter injection."""import json-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, Mock, patchimport pytestfrom fastapi import HTTPException, Request, Response-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/test_litellm/proxy/public_endpoints/test_public_endpoints.py b/tests/test_litellm/proxy/public_endpoints/test_public_endpoints.pyindex 72e7b1c18d6..31430da71e8 100644--- a/tests/test_litellm/proxy/public_endpoints/test_public_endpoints.py+++ b/tests/test_litellm/proxy/public_endpoints/test_public_endpoints.py@@ -1,11 +1,8 @@-import os-import sysfrom datetime import datetime, timezonefrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from fastapi import FastAPIfrom fastapi.testclient import TestClientdiff --git a/tests/test_litellm/proxy/rag_endpoints/test_rag_endpoints.py b/tests/test_litellm/proxy/rag_endpoints/test_rag_endpoints.pyindex 15a117bd6fc..b08de04e801 100644--- a/tests/test_litellm/proxy/rag_endpoints/test_rag_endpoints.py+++ b/tests/test_litellm/proxy/rag_endpoints/test_rag_endpoints.py@@ -6,16 +6,11 @@ Covers:"""import io-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuthfrom litellm.proxy.auth.user_api_key_auth import user_api_key_authdiff --git a/tests/test_litellm/proxy/realtime_endpoints/test_realtime_webrtc_endpoints.py b/tests/test_litellm/proxy/realtime_endpoints/test_realtime_webrtc_endpoints.pyindex 9840de8bcb1..66eeb3cef34 100644--- a/tests/test_litellm/proxy/realtime_endpoints/test_realtime_webrtc_endpoints.py+++ b/tests/test_litellm/proxy/realtime_endpoints/test_realtime_webrtc_endpoints.py@@ -5,8 +5,6 @@ Tests for LiteLLM proxy realtime WebRTC HTTP endpoints:"""import json-import os-import sysimport timefrom unittest.mock import AsyncMock, MagicMock, patch@@ -14,7 +12,6 @@ import httpximport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy._types import UserAPIKeyAuthfrom litellm.proxy.auth.user_api_key_auth import user_api_key_authdiff --git a/tests/test_litellm/proxy/spend_tracking/test_cloudzero_endpoints.py b/tests/test_litellm/proxy/spend_tracking/test_cloudzero_endpoints.pyindex dbab627d76f..45aa065380d 100644--- a/tests/test_litellm/proxy/spend_tracking/test_cloudzero_endpoints.py+++ b/tests/test_litellm/proxy/spend_tracking/test_cloudzero_endpoints.py@@ -1,11 +1,8 @@-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../../.."))import litellm.proxy.proxy_server as psfrom litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuthdiff --git a/tests/test_litellm/proxy/spend_tracking/test_savings.py b/tests/test_litellm/proxy/spend_tracking/test_savings.pyindex 227c824afd7..bb8345a9142 100644--- a/tests/test_litellm/proxy/spend_tracking/test_savings.py+++ b/tests/test_litellm/proxy/spend_tracking/test_savings.py@@ -1,7 +1,4 @@-import os-import sys-sys.path.insert(0, os.path.abspath("../../../.."))import pytestdiff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_management_endpoints.py b/tests/test_litellm/proxy/spend_tracking/test_spend_management_endpoints.pyindex 24e209a2537..2b062d9020d 100644--- a/tests/test_litellm/proxy/spend_tracking/test_spend_management_endpoints.py+++ b/tests/test_litellm/proxy/spend_tracking/test_spend_management_endpoints.py@@ -2,18 +2,13 @@ import asyncioimport collectionsimport datetimeimport json-import osimport re-import sysfrom datetime import timezoneimport pytestfrom fastapi import HTTPExceptionfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_query_optimization.py b/tests/test_litellm/proxy/spend_tracking/test_spend_query_optimization.pyindex 19083486974..ef68d9ce178 100644--- a/tests/test_litellm/proxy/spend_tracking/test_spend_query_optimization.py+++ b/tests/test_litellm/proxy/spend_tracking/test_spend_query_optimization.py@@ -6,14 +6,11 @@ GitHub Issue: #17487"""import datetime-import os-import sysfrom datetime import timezonefrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy.spend_tracking.spend_tracking_utils import (get_spend_by_team,diff --git a/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py b/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.pyindex e2c1a835750..6c8e641642b 100644--- a/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py+++ b/tests/test_litellm/proxy/spend_tracking/test_spend_tracking_utils.py@@ -1,16 +1,11 @@import asyncioimport datetimeimport json-import os-import sysfrom datetime import timezonefrom typing import Any, Final, castimport pytest-sys.path.insert(- 0, os.path.abspath("../../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import AsyncMock, MagicMock, patchdiff --git a/tests/test_litellm/proxy/test_batch_expiry.py b/tests/test_litellm/proxy/test_batch_expiry.pyindex 38c4a71608d..f7b8fbde0fb 100644--- a/tests/test_litellm/proxy/test_batch_expiry.py+++ b/tests/test_litellm/proxy/test_batch_expiry.py@@ -2,15 +2,10 @@Tests for batch output_expires_after passthrough and team-level expiry enforcement."""-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.caching.caching import DualCachediff --git a/tests/test_litellm/proxy/test_batch_metadata_none_fix.py b/tests/test_litellm/proxy/test_batch_metadata_none_fix.pyindex dbc2a402032..aba9b190b66 100644--- a/tests/test_litellm/proxy/test_batch_metadata_none_fix.py+++ b/tests/test_litellm/proxy/test_batch_metadata_none_fix.py@@ -5,8 +5,6 @@ This test verifies that the fix for handling None metadata in batch requests wor"""import asyncio-import os-import sysfrom unittest.mock import patch, MagicMock, AsyncMockimport pytest@@ -16,9 +14,6 @@ import litellmfrom litellm.proxy.litellm_pre_call_utils import LiteLLMProxyRequestSetupfrom litellm.proxy._types import UserAPIKeyAuth-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathdef test_add_key_level_controls_with_none_metadata():diff --git a/tests/test_litellm/proxy/test_batch_retrieve_bedrock.py b/tests/test_litellm/proxy/test_batch_retrieve_bedrock.pyindex 13945750092..50d531d22d8 100644--- a/tests/test_litellm/proxy/test_batch_retrieve_bedrock.py+++ b/tests/test_litellm/proxy/test_batch_retrieve_bedrock.py@@ -14,14 +14,11 @@ must round-trip through `client.files.content(...)` back to bedrock with AWScredentials and the raw S3 URI intact."""-import os-import sysimport httpximport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.caching.caching import DualCachediff --git a/tests/test_litellm/proxy/test_caching_routes.py b/tests/test_litellm/proxy/test_caching_routes.pyindex 840ba054cc9..707d4a3f2c9 100644--- a/tests/test_litellm/proxy/test_caching_routes.py+++ b/tests/test_litellm/proxy/test_caching_routes.py@@ -1,13 +1,8 @@import json-import os-import sysimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/test_litellm/proxy/test_custom_proxy.py b/tests/test_litellm/proxy/test_custom_proxy.pyindex 3663183d211..b646a4e80e7 100644--- a/tests/test_litellm/proxy/test_custom_proxy.py+++ b/tests/test_litellm/proxy/test_custom_proxy.py@@ -1,5 +1,4 @@import os-import sysimport uvicornfrom dotenv import load_dotenv@@ -8,9 +7,6 @@ from fastapi.middleware.cors import CORSMiddlewarefrom fastapi.responses import JSONResponseload_dotenv()-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system path# Set the SERVER_ROOT_PATH environment variable to match the custom mount pathos.environ["SERVER_ROOT_PATH"] = "/my-custom-path"diff --git a/tests/test_litellm/proxy/test_empty_model_list.py b/tests/test_litellm/proxy/test_empty_model_list.pyindex dde2f06126a..dd4643fcf90 100644--- a/tests/test_litellm/proxy/test_empty_model_list.py+++ b/tests/test_litellm/proxy/test_empty_model_list.py@@ -5,16 +5,11 @@ These tests verify that /v2/model/info and /model_group/info endpointsreturn empty data arrays instead of 500 errors when no models are configured."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system-pathfrom litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuthfrom litellm.proxy.proxy_server import appdiff --git a/tests/test_litellm/proxy/test_fastapi_offline_routes.py b/tests/test_litellm/proxy/test_fastapi_offline_routes.pyindex f3fc3d3ea28..e06e87ed344 100644--- a/tests/test_litellm/proxy/test_fastapi_offline_routes.py+++ b/tests/test_litellm/proxy/test_fastapi_offline_routes.py@@ -5,12 +5,7 @@ This test verifies that the /routes endpoint works correctly when the proxyserver is initialized using FastAPIOffline instead of regular FastAPI."""-import os-import sys-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport pytestfrom fastapi.testclient import TestClientdiff --git a/tests/test_litellm/proxy/test_filter_models_by_team_access_group.py b/tests/test_litellm/proxy/test_filter_models_by_team_access_group.pyindex 2d8a9f30c1b..1a514ed2c57 100644--- a/tests/test_litellm/proxy/test_filter_models_by_team_access_group.py+++ b/tests/test_litellm/proxy/test_filter_models_by_team_access_group.py@@ -7,13 +7,10 @@ looking up deployments — matching the behavior of the auth path inauth_checks.py:model_in_access_group()."""-import os-import sysfrom unittest.mock import AsyncMock, MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.proxy.proxy_server import _filter_models_by_team_iddiff --git a/tests/test_litellm/proxy/test_health_check_functions.py b/tests/test_litellm/proxy/test_health_check_functions.pyindex f223241baf4..f2d95131e5e 100644--- a/tests/test_litellm/proxy/test_health_check_functions.py+++ b/tests/test_litellm/proxy/test_health_check_functions.py@@ -1,13 +1,10 @@import asyncio-import os-import sysimport timefrom datetime import datetime, timedelta, timezonefrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.proxy.health_endpoints._health_endpoints import (_aggregate_health_check_results,diff --git a/tests/test_litellm/proxy/test_litellm_pre_call_utils.py b/tests/test_litellm/proxy/test_litellm_pre_call_utils.pyindex 931c7301041..111f11f85ba 100644--- a/tests/test_litellm/proxy/test_litellm_pre_call_utils.py+++ b/tests/test_litellm/proxy/test_litellm_pre_call_utils.py@@ -2,7 +2,6 @@ import asyncioimport copyimport jsonimport os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest@@ -40,9 +39,6 @@ from litellm.litellm_core_utils.initialize_dynamic_callback_params import (from litellm.llms.bedrock.base_aws_llm import BaseAWSLLMfrom litellm.types.utils import CredentialItem-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathdef test_check_if_token_is_service_account():diff --git a/tests/test_litellm/proxy/test_model_deprecations_endpoint.py b/tests/test_litellm/proxy/test_model_deprecations_endpoint.pyindex c942408bd14..6495cf408e1 100644--- a/tests/test_litellm/proxy/test_model_deprecations_endpoint.py+++ b/tests/test_litellm/proxy/test_model_deprecations_endpoint.py@@ -1,11 +1,8 @@-import os-import sysfrom unittest.mock import MagicMockimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.proxy import proxy_serverdiff --git a/tests/test_litellm/proxy/test_pricing_field_strip.py b/tests/test_litellm/proxy/test_pricing_field_strip.pyindex bbdddd1cd8c..1707f5bbc05 100644--- a/tests/test_litellm/proxy/test_pricing_field_strip.py+++ b/tests/test_litellm/proxy/test_pricing_field_strip.py@@ -10,8 +10,6 @@ strips them at the boundary; an opt-in key/team flag preserves the overridefor operators who actually want it."""-import os-import sysfrom unittest.mock import MagicMockimport pytest@@ -27,7 +25,6 @@ from litellm.proxy.litellm_pre_call_utils import ()from litellm.types.utils import CustomPricingLiteLLMParams-sys.path.insert(0, os.path.abspath("../../.."))def _make_request_mock() -> Request:diff --git a/tests/test_litellm/proxy/test_provider_url_destination_guard.py b/tests/test_litellm/proxy/test_provider_url_destination_guard.pyindex cd993a076e8..24c4e991adf 100644--- a/tests/test_litellm/proxy/test_provider_url_destination_guard.py+++ b/tests/test_litellm/proxy/test_provider_url_destination_guard.py@@ -6,8 +6,6 @@ an SSRF primitive — guarded centrally in ``litellm_pre_call_utils`` so SDKusers keep working but proxy users default-deny."""-import os-import sysfrom unittest.mock import MagicMockimport pytest@@ -20,7 +18,6 @@ from litellm.proxy.litellm_pre_call_utils import (add_litellm_data_to_request,)-sys.path.insert(0, os.path.abspath("../../.."))class TestRejectUrlValuedDestinations:diff --git a/tests/test_litellm/proxy/test_proxy_cli.py b/tests/test_litellm/proxy/test_proxy_cli.pyindex 48c56a41ad5..6ea6f208bb5 100644--- a/tests/test_litellm/proxy/test_proxy_cli.py+++ b/tests/test_litellm/proxy/test_proxy_cli.py@@ -1,6 +1,5 @@import inspectimport os-import sysfrom pathlib import Pathfrom types import SimpleNamespacefrom unittest.mock import AsyncMock, MagicMock, patch@@ -9,9 +8,6 @@ import clickimport fastapiimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system-pathimport builtinsimport typesdiff --git a/tests/test_litellm/proxy/test_proxy_server.py b/tests/test_litellm/proxy/test_proxy_server.pyindex a0ca33da737..31d2a6cef98 100644--- a/tests/test_litellm/proxy/test_proxy_server.py+++ b/tests/test_litellm/proxy/test_proxy_server.py@@ -5,7 +5,6 @@ import osimport reimport socketimport subprocess-import sysimport typesfrom datetime import datetime, timedelta, timezonefrom pathlib import Path@@ -20,7 +19,6 @@ from fastapi import FastAPIfrom fastapi.staticfiles import StaticFilesfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system-pathimport litellmimport litellm.proxy.proxy_server as proxy_server_modulediff --git a/tests/test_litellm/proxy/test_proxy_types.py b/tests/test_litellm/proxy/test_proxy_types.pyindex 77083af48c0..634b90e445a 100644--- a/tests/test_litellm/proxy/test_proxy_types.py+++ b/tests/test_litellm/proxy/test_proxy_types.py@@ -1,10 +1,8 @@import asyncioimport importlibimport json-import osimport socketimport subprocess-import sysfrom unittest import mockfrom unittest.mock import AsyncMock, MagicMock, mock_open, patch@@ -15,9 +13,6 @@ import yamlfrom fastapi import FastAPIfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system-pathdef test_audit_log_masking():diff --git a/tests/test_litellm/proxy/test_proxy_utils.py b/tests/test_litellm/proxy/test_proxy_utils.pyindex deb49ff9f54..fb01216982f 100644--- a/tests/test_litellm/proxy/test_proxy_utils.py+++ b/tests/test_litellm/proxy/test_proxy_utils.py@@ -1,7 +1,5 @@import datetime as real_datetime-import osimport smtplib-import sysimport pytestfrom fastapi import HTTPException@@ -12,9 +10,6 @@ from litellm.proxy._types import ProxyErrorTypesfrom litellm.proxy.utils import ProxyLoggingfrom litellm.types.guardrails import GuardrailEventHooks-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom unittest.mock import MagicMock, patchdiff --git a/tests/test_litellm/proxy/test_response_model_sanitization.py b/tests/test_litellm/proxy/test_response_model_sanitization.pyindex 621291b8331..c20b1208e8f 100644--- a/tests/test_litellm/proxy/test_response_model_sanitization.py+++ b/tests/test_litellm/proxy/test_response_model_sanitization.py@@ -1,7 +1,5 @@import asyncioimport json-import os-import sysfrom typing import AsyncGeneratorfrom unittest.mock import AsyncMock, MagicMock@@ -9,7 +7,6 @@ import pytestimport yamlfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../../.."))import litellmdiff --git a/tests/test_litellm/proxy/test_route_a2a_models.py b/tests/test_litellm/proxy/test_route_a2a_models.pyindex 0523e796543..35308474949 100644--- a/tests/test_litellm/proxy/test_route_a2a_models.py+++ b/tests/test_litellm/proxy/test_route_a2a_models.py@@ -4,10 +4,7 @@ Test A2A model routing in proxy.Maps to: litellm/proxy/agent_endpoints/a2a_routing.py"""-import os-import sys-sys.path.insert(0, os.path.abspath("../../.."))from unittest.mock import AsyncMock, Mock, patchdiff --git a/tests/test_litellm/proxy/test_route_llm_request.py b/tests/test_litellm/proxy/test_route_llm_request.pyindex 23e0bbfb3ee..41ba57c4615 100644--- a/tests/test_litellm/proxy/test_route_llm_request.py+++ b/tests/test_litellm/proxy/test_route_llm_request.py@@ -1,9 +1,6 @@-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathfrom unittest.mock import MagicMockdiff --git a/tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.py b/tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.pyindex a1a02ec427b..b85c70cae12 100644--- a/tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.py+++ b/tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.py@@ -1,13 +1,9 @@import jsonimport os-import sysimport pytestfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.proxy._types import DefaultInternalUserParams, LitellmUserRolesfrom litellm.proxy.proxy_server import appdiff --git a/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py b/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.pyindex 20b2f68bb0c..905928428b7 100644--- a/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py+++ b/tests/test_litellm/proxy/vector_store_endpoints/test_vector_store_endpoints.py@@ -1,14 +1,9 @@-import os-import sysfrom datetime import datetime, timezonefrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom fastapi import Request-sys.path.insert(- 0, os.path.abspath("../../../../..")-) # Adds the parent directory to the system pathfrom fastapi import HTTPExceptiondiff --git a/tests/test_litellm/proxy/vector_store_files_endpoints/test_endpoints.py b/tests/test_litellm/proxy/vector_store_files_endpoints/test_endpoints.pyindex da5dd1934e4..4cb3a3d4c7f 100644--- a/tests/test_litellm/proxy/vector_store_files_endpoints/test_endpoints.py+++ b/tests/test_litellm/proxy/vector_store_files_endpoints/test_endpoints.py@@ -10,15 +10,12 @@ is attached to a vector store or read back under shared provider credentials."""import base64-import os-import sysfrom dataclasses import dataclassfrom typing import Literalfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from fastapi import HTTPExceptiondiff --git a/tests/test_litellm/proxy/video_endpoints/test_endpoints.py b/tests/test_litellm/proxy/video_endpoints/test_endpoints.pyindex 40a26fad3c3..a959326817c 100644--- a/tests/test_litellm/proxy/video_endpoints/test_endpoints.py+++ b/tests/test_litellm/proxy/video_endpoints/test_endpoints.py@@ -26,8 +26,6 @@ patched with autospec so the real __init__ still stores self.data (captured viamock's call args), and a brand-new kwarg added to this layer surfaces as a failure."""-import os-import sysfrom contextlib import ExitStackfrom dataclasses import dataclassfrom typing import Any, Dict, Optional@@ -36,7 +34,6 @@ from unittest.mock import AsyncMock, MagicMock, patchimport orjsonimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))import litellm.proxy.proxy_server as proxy_serverimport litellm.proxy.video_endpoints.endpoints as endpointsdiff --git a/tests/test_litellm/proxy/video_endpoints/test_utils.py b/tests/test_litellm/proxy/video_endpoints/test_utils.pyindex ae22ae233b5..efbaaff5f4b 100644--- a/tests/test_litellm/proxy/video_endpoints/test_utils.py+++ b/tests/test_litellm/proxy/video_endpoints/test_utils.py@@ -12,12 +12,9 @@ is encode_character_id_with_provider, which runs for real; encoding assertionsare checked by the genuine decode round-trip."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.proxy.video_endpoints.utils import (encode_character_id_in_response,diff --git a/tests/test_litellm/realtime_api/test_main.py b/tests/test_litellm/realtime_api/test_main.pyindex 9f48d4d427b..a0c0d849e3e 100644--- a/tests/test_litellm/realtime_api/test_main.py+++ b/tests/test_litellm/realtime_api/test_main.py@@ -1,10 +1,7 @@import asyncio-import os-import sysimport timefrom unittest.mock import MagicMock-sys.path.insert(0, os.path.abspath("../../.."))import pytestdiff --git a/tests/test_litellm/rerank_api/test_main.py b/tests/test_litellm/rerank_api/test_main.pyindex 46d1461da50..85777afe81c 100644--- a/tests/test_litellm/rerank_api/test_main.py+++ b/tests/test_litellm/rerank_api/test_main.py@@ -1,9 +1,6 @@import logging-import os-import sysfrom unittest.mock import MagicMock, patch-sys.path.insert(0, os.path.abspath("../../.."))import litellmdiff --git a/tests/test_litellm/responses/litellm_completion_transformation/test_handler.py b/tests/test_litellm/responses/litellm_completion_transformation/test_handler.pyindex 04db7192364..2cfec6a1844 100644--- a/tests/test_litellm/responses/litellm_completion_transformation/test_handler.py+++ b/tests/test_litellm/responses/litellm_completion_transformation/test_handler.py@@ -12,13 +12,10 @@ capture the forwarded kwargs; if the flag-setting line is removed the capturedkwargs lack the flag and these tests fail."""-import os-import sysfrom unittest.mock import patchimport pytest-sys.path.insert(0, os.path.abspath("../../../.."))from litellm.responses.litellm_completion_transformation.handler import (LiteLLMCompletionTransformationHandler,diff --git a/tests/test_litellm/responses/litellm_completion_transformation/test_litellm_completion_responses.py b/tests/test_litellm/responses/litellm_completion_transformation/test_litellm_completion_responses.pyindex aae053c2e8e..5efabed4b8d 100644--- a/tests/test_litellm/responses/litellm_completion_transformation/test_litellm_completion_responses.py+++ b/tests/test_litellm/responses/litellm_completion_transformation/test_litellm_completion_responses.py@@ -1,12 +1,7 @@import json-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.responses.litellm_completion_transformation.transformation import (TOOL_CALLS_CACHE,diff --git a/tests/test_litellm/responses/litellm_completion_transformation/test_session_handler.py b/tests/test_litellm/responses/litellm_completion_transformation/test_session_handler.pyindex 9c354101e22..19f240fa3d4 100644--- a/tests/test_litellm/responses/litellm_completion_transformation/test_session_handler.py+++ b/tests/test_litellm/responses/litellm_completion_transformation/test_session_handler.py@@ -1,15 +1,10 @@import json-import os-import sysfrom unittest.mock import AsyncMock, patchimport pytestfrom fastapi import HTTPExceptionfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.responses.litellm_completion_transformation import session_handlerfrom litellm.responses.litellm_completion_transformation.session_handler import (diff --git a/tests/test_litellm/responses/test_metadata_codex_callback.py b/tests/test_litellm/responses/test_metadata_codex_callback.pyindex f7d97b164da..f151f36be63 100644--- a/tests/test_litellm/responses/test_metadata_codex_callback.py+++ b/tests/test_litellm/responses/test_metadata_codex_callback.py@@ -10,12 +10,9 @@ verifies metadata is preserved for custom callbacks via kwargs['litellm_params']"""import asyncio-import os-import sysfrom typing import Optionalfrom unittest.mock import AsyncMock, patch-sys.path.insert(0, os.path.abspath("../../.."))import pytestdiff --git a/tests/test_litellm/responses/test_no_duplicate_spend_logs.py b/tests/test_litellm/responses/test_no_duplicate_spend_logs.pyindex 3ef5935933a..c98b519ae67 100644--- a/tests/test_litellm/responses/test_no_duplicate_spend_logs.py+++ b/tests/test_litellm/responses/test_no_duplicate_spend_logs.py@@ -7,14 +7,9 @@ causing duplicate spend log entries for non-OpenAI providers."""import asyncio-import os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.integrations.custom_logger import CustomLoggerdiff --git a/tests/test_litellm/responses/test_responses_api_bridge_flag.py b/tests/test_litellm/responses/test_responses_api_bridge_flag.pyindex f94c31831bf..d76fa59a888 100644--- a/tests/test_litellm/responses/test_responses_api_bridge_flag.py+++ b/tests/test_litellm/responses/test_responses_api_bridge_flag.py@@ -6,13 +6,8 @@ Includes file_search emulation: the flag must be forwarded on inner aresponsescalls so routed requests do not hit a custom api_base /v1/responses endpoint."""-import os-import sysfrom unittest.mock import MagicMock, patch-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.types.llms.openai import ResponseAPIUsage, ResponsesAPIResponsediff --git a/tests/test_litellm/responses/test_responses_router_cooldown.py b/tests/test_litellm/responses/test_responses_router_cooldown.pyindex 48e2d2455e7..e173c174521 100644--- a/tests/test_litellm/responses/test_responses_router_cooldown.py+++ b/tests/test_litellm/responses/test_responses_router_cooldown.py@@ -6,14 +6,11 @@ the "No model_info found" branch and the failing deployment was never addedto the cooldown set."""-import os-import sysfrom unittest.mock import AsyncMock, patchimport httpximport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.router_utils.cooldown_handlers import _async_get_cooldown_deploymentsdiff --git a/tests/test_litellm/responses/test_responses_utils.py b/tests/test_litellm/responses/test_responses_utils.pyindex 2f4a699d307..dddb851acf9 100644--- a/tests/test_litellm/responses/test_responses_utils.py+++ b/tests/test_litellm/responses/test_responses_utils.py@@ -1,11 +1,8 @@import base64-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.openai.responses.transformation import OpenAIResponsesAPIConfigdiff --git a/tests/test_litellm/responses/test_streaming_iterator_error_events.py b/tests/test_litellm/responses/test_streaming_iterator_error_events.pyindex 321abe4cc6d..9c344fc6894 100644--- a/tests/test_litellm/responses/test_streaming_iterator_error_events.py+++ b/tests/test_litellm/responses/test_streaming_iterator_error_events.py@@ -15,13 +15,10 @@ Pydantic ValidationError (previously typed as Optional[str])."""import json-import os-import sysfrom unittest.mock import Mock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.exceptions import MidStreamFallbackErrordiff --git a/tests/test_litellm/responses/test_text_format_conversion.py b/tests/test_litellm/responses/test_text_format_conversion.pyindex 339b73c2729..cca7748fd3a 100644--- a/tests/test_litellm/responses/test_text_format_conversion.py+++ b/tests/test_litellm/responses/test_text_format_conversion.py@@ -1,13 +1,8 @@import json-import os-import sysimport pytestfrom pydantic import BaseModel-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.types.llms.openai import (diff --git a/tests/test_litellm/router_strategy/test_auto_router.py b/tests/test_litellm/router_strategy/test_auto_router.pyindex c71a6b0e27f..36199b45847 100644--- a/tests/test_litellm/router_strategy/test_auto_router.py+++ b/tests/test_litellm/router_strategy/test_auto_router.py@@ -1,15 +1,10 @@import asyncioimport json-import os-import sysfrom typing import Any, Dict, Final, List, Optionalfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathfrom litellm.router_strategy.auto_router.auto_router import AutoRouterdiff --git a/tests/test_litellm/router_strategy/test_base_routing_strategy.py b/tests/test_litellm/router_strategy/test_base_routing_strategy.pyindex 70259605b2f..154042692d0 100644--- a/tests/test_litellm/router_strategy/test_base_routing_strategy.py+++ b/tests/test_litellm/router_strategy/test_base_routing_strategy.py@@ -1,13 +1,8 @@import json-import os-import sysfrom typing import Any, Dict, List, Optional, Set, Unionimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport asynciofrom unittest.mock import MagicMock, patchdiff --git a/tests/test_litellm/router_strategy/test_complexity_router.py b/tests/test_litellm/router_strategy/test_complexity_router.pyindex 64b60c75f87..e65d79a83f4 100644--- a/tests/test_litellm/router_strategy/test_complexity_router.py+++ b/tests/test_litellm/router_strategy/test_complexity_router.py@@ -6,15 +6,12 @@ Tests the rule-based complexity scoring and tier assignment logic.import asyncioimport logging-import os-import sysfrom typing import Dict, Listfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom pydantic import ValidationError-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathimport litellmfrom litellm import Routerdiff --git a/tests/test_litellm/router_strategy/test_litellm_encoder.py b/tests/test_litellm/router_strategy/test_litellm_encoder.pyindex 6c934e57832..ebd6efe309c 100644--- a/tests/test_litellm/router_strategy/test_litellm_encoder.py+++ b/tests/test_litellm/router_strategy/test_litellm_encoder.py@@ -1,12 +1,9 @@"""Tests for litellm/router_strategy/auto_router/litellm_encoder.py"""-import os-import sysfrom typing import Any, Finalimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.constants import DEFAULT_AUTO_ROUTER_MAX_INPUT_CHARSdiff --git a/tests/test_litellm/router_strategy/test_lowest_latency.py b/tests/test_litellm/router_strategy/test_lowest_latency.pyindex 4edc1e21d6b..6701f4a7aa2 100644--- a/tests/test_litellm/router_strategy/test_lowest_latency.py+++ b/tests/test_litellm/router_strategy/test_lowest_latency.py@@ -5,15 +5,10 @@# latency list and break the Redis cache sync). Issue #33169.import json-import os-import sysfrom datetime import datetime, timedeltaimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.caching.caching import DualCachediff --git a/tests/test_litellm/router_strategy/test_quality_router.py b/tests/test_litellm/router_strategy/test_quality_router.pyindex a54e95ff7a1..4e87652f8b3 100644--- a/tests/test_litellm/router_strategy/test_quality_router.py+++ b/tests/test_litellm/router_strategy/test_quality_router.py@@ -9,14 +9,11 @@ Covers:- Decision metadata stash + Router.set_response_headers lift."""-import os-import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMockimport pytest-sys.path.insert(0, os.path.abspath("../../.."))from litellm.router_strategy.quality_router.config import (DEFAULT_COMPLEXITY_TO_QUALITY,diff --git a/tests/test_litellm/router_strategy/test_router_routing_groups.py b/tests/test_litellm/router_strategy/test_router_routing_groups.pyindex 7d1ed796996..5599c5aad63 100644--- a/tests/test_litellm/router_strategy/test_router_routing_groups.py+++ b/tests/test_litellm/router_strategy/test_router_routing_groups.py@@ -5,13 +5,10 @@ the implicit `"default"` group driven by the router's top-level`routing_strategy` / `routing_strategy_args`."""-import os-import sysfrom unittest.mock import patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm import Routerdiff --git a/tests/test_litellm/router_strategy/test_router_tag_regex_routing.py b/tests/test_litellm/router_strategy/test_router_tag_regex_routing.pyindex 6591478a4e7..212c2627d88 100644--- a/tests/test_litellm/router_strategy/test_router_tag_regex_routing.py+++ b/tests/test_litellm/router_strategy/test_router_tag_regex_routing.py@@ -6,12 +6,9 @@ patterns, verifying that regex-based header matching works correctly alongsideexisting tag-based routing."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))from unittest.mock import MagicMockdiff --git a/tests/test_litellm/router_strategy/test_router_tag_routing.py b/tests/test_litellm/router_strategy/test_router_tag_routing.pyindex 752136f2b66..72bb6756d24 100644--- a/tests/test_litellm/router_strategy/test_router_tag_routing.py+++ b/tests/test_litellm/router_strategy/test_router_tag_routing.py@@ -1,14 +1,10 @@#### What this tests ##### This tests litellm router-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system pathimport logging-import osimport litellmdiff --git a/tests/test_litellm/router_utils/pre_call_checks/test_deployment_affinity_check.py b/tests/test_litellm/router_utils/pre_call_checks/test_deployment_affinity_check.pyindex 428eb0ceafd..b3a2bdda53c 100644--- a/tests/test_litellm/router_utils/pre_call_checks/test_deployment_affinity_check.py+++ b/tests/test_litellm/router_utils/pre_call_checks/test_deployment_affinity_check.py@@ -1,11 +1,8 @@import asyncio-import os-import sysfrom unittest.mock import AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import jsondiff --git a/tests/test_litellm/router_utils/pre_call_checks/test_encrypted_content_affinity_check.py b/tests/test_litellm/router_utils/pre_call_checks/test_encrypted_content_affinity_check.pyindex 510dcf77afd..dac991a41c4 100644--- a/tests/test_litellm/router_utils/pre_call_checks/test_encrypted_content_affinity_check.py+++ b/tests/test_litellm/router_utils/pre_call_checks/test_encrypted_content_affinity_check.py@@ -15,15 +15,12 @@ The mechanism works without any cache and supports two encoding strategies:encrypted_content back to their original forms before sending to the upstream provider."""-import os-import sysimport timefrom typing import List, Optionalfrom unittest.mock import AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.responses.utils import ResponsesAPIRequestUtilsdiff --git a/tests/test_litellm/router_utils/pre_call_checks/test_prompt_caching_deployment_check.py b/tests/test_litellm/router_utils/pre_call_checks/test_prompt_caching_deployment_check.pyindex d0fff0201e3..f54a1cfa284 100644--- a/tests/test_litellm/router_utils/pre_call_checks/test_prompt_caching_deployment_check.py+++ b/tests/test_litellm/router_utils/pre_call_checks/test_prompt_caching_deployment_check.py@@ -1,12 +1,9 @@import asyncioimport copy-import os-import sysfrom typing import List, castimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.caching.dual_cache import DualCachediff --git a/tests/test_litellm/router_utils/pre_call_checks/test_responses_api_deployment_check.py b/tests/test_litellm/router_utils/pre_call_checks/test_responses_api_deployment_check.pyindex 3c6a05e7786..ee7fab7d19f 100644--- a/tests/test_litellm/router_utils/pre_call_checks/test_responses_api_deployment_check.py+++ b/tests/test_litellm/router_utils/pre_call_checks/test_responses_api_deployment_check.py@@ -1,12 +1,9 @@import asyncio-import os-import sysfrom typing import Optionalfrom unittest.mock import AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import jsonimport litellmdiff --git a/tests/test_litellm/router_utils/pre_call_checks/test_session_id_affinity.py b/tests/test_litellm/router_utils/pre_call_checks/test_session_id_affinity.pyindex 4053e6d118b..a3772a276fa 100644--- a/tests/test_litellm/router_utils/pre_call_checks/test_session_id_affinity.py+++ b/tests/test_litellm/router_utils/pre_call_checks/test_session_id_affinity.py@@ -1,10 +1,7 @@-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import jsondiff --git a/tests/test_litellm/router_utils/test_cooldown_cache.py b/tests/test_litellm/router_utils/test_cooldown_cache.pyindex a48402684b4..68e9aeaa4fc 100644--- a/tests/test_litellm/router_utils/test_cooldown_cache.py+++ b/tests/test_litellm/router_utils/test_cooldown_cache.py@@ -2,15 +2,12 @@Unit tests for CooldownCache exception masking functionality"""-import os-import sysimport timefrom unittest.mock import MagicMockimport pytest# Add the parent directory to the system path-sys.path.insert(0, os.path.abspath("../../.."))from litellm.caching.dual_cache import DualCachefrom litellm.caching.in_memory_cache import InMemoryCachediff --git a/tests/test_litellm/secret_managers/test_base_secret_manager.py b/tests/test_litellm/secret_managers/test_base_secret_manager.pyindex e1ccb91c381..a9c6695eb82 100644--- a/tests/test_litellm/secret_managers/test_base_secret_manager.py+++ b/tests/test_litellm/secret_managers/test_base_secret_manager.py@@ -3,12 +3,9 @@ Test raise_if_unsafe_secret_name, the shared guard applied before secret_namereaches a secret manager backend."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../..")) # Adds the parent directory to the system pathfrom litellm.secret_managers.base_secret_manager import raise_if_unsafe_secret_namediff --git a/tests/test_litellm/secret_managers/test_custom_secret_manager.py b/tests/test_litellm/secret_managers/test_custom_secret_manager.pyindex 0426c5973cc..e22af4f9a18 100644--- a/tests/test_litellm/secret_managers/test_custom_secret_manager.py+++ b/tests/test_litellm/secret_managers/test_custom_secret_manager.py@@ -2,16 +2,11 @@Test custom secret manager implementation"""-import os-import sysfrom typing import Optional, Unionimport httpximport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.integrations.custom_secret_manager import CustomSecretManagerdiff --git a/tests/test_litellm/secret_managers/test_get_azure_ad_token_provider.py b/tests/test_litellm/secret_managers/test_get_azure_ad_token_provider.pyindex cee0da79802..c9ec22ab0df 100644--- a/tests/test_litellm/secret_managers/test_get_azure_ad_token_provider.py+++ b/tests/test_litellm/secret_managers/test_get_azure_ad_token_provider.py@@ -1,11 +1,9 @@import jsonimport os-import sysfrom typing import Optionalfrom unittest.mock import MagicMock, patch# Adds the grandparent directory to sys.path to allow importing project modules-sys.path.insert(0, os.path.abspath("../.."))import pytestdiff --git a/tests/test_litellm/test_a2a_registry_lookup.py b/tests/test_litellm/test_a2a_registry_lookup.pyindex dd745bfe15b..54393e3ae5e 100644--- a/tests/test_litellm/test_a2a_registry_lookup.py+++ b/tests/test_litellm/test_a2a_registry_lookup.py@@ -4,10 +4,7 @@ Test A2A provider registry lookup functionality.Maps to: litellm/llms/a2a/chat/transformation.py"""-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import pytestdiff --git a/tests/test_litellm/test_acompletion_session_reuse_e2e.py b/tests/test_litellm/test_acompletion_session_reuse_e2e.pyindex 79b947bb146..2c0bc32f84b 100644--- a/tests/test_litellm/test_acompletion_session_reuse_e2e.py+++ b/tests/test_litellm/test_acompletion_session_reuse_e2e.py@@ -12,13 +12,10 @@ wasting ~100-500ms per request. With reuse, connections are pooled andsubsequent requests are 40-60% faster."""-import os-import sysimport inspectimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmdiff --git a/tests/test_litellm/test_add_deployment_no_master_key.py b/tests/test_litellm/test_add_deployment_no_master_key.pyindex f7a0e90dad0..2973f1a8f69 100644--- a/tests/test_litellm/test_add_deployment_no_master_key.py+++ b/tests/test_litellm/test_add_deployment_no_master_key.py@@ -6,12 +6,10 @@ failed when master_key was None. [https://github.com/BerriAI/litellm/issues/1642"""import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy.proxy_server import ProxyConfigdiff --git a/tests/test_litellm/test_aembedding_session_reuse_e2e.py b/tests/test_litellm/test_aembedding_session_reuse_e2e.pyindex b24aab72fdb..15662d4d35c 100644--- a/tests/test_litellm/test_aembedding_session_reuse_e2e.py+++ b/tests/test_litellm/test_aembedding_session_reuse_e2e.py@@ -5,11 +5,8 @@ Ensures shared_session is in all_litellm_params to prevent"Object of type ClientSession is not JSON serializable" errors."""-import os-import sysimport inspect-sys.path.insert(0, os.path.abspath("../../.."))from litellm.types.utils import all_litellm_paramsdiff --git a/tests/test_litellm/test_command_r7b_pricing.py b/tests/test_litellm/test_command_r7b_pricing.pyindex b952c365910..498fc0ef55a 100644--- a/tests/test_litellm/test_command_r7b_pricing.py+++ b/tests/test_litellm/test_command_r7b_pricing.py@@ -11,11 +11,7 @@ swap cannot silently regress.import jsonimport os-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/test_litellm/test_constants.py b/tests/test_litellm/test_constants.pyindex b3c13c6e26e..12e473f68a4 100644--- a/tests/test_litellm/test_constants.py+++ b/tests/test_litellm/test_constants.py@@ -1,8 +1,6 @@import astimport inspectimport json-import os-import sysfrom unittest import mockimport httpx@@ -10,7 +8,6 @@ import pytestimport respxfrom fastapi.testclient import TestClient-sys.path.insert(0, os.path.abspath("../..")) #import importlibdiff --git a/tests/test_litellm/test_cost_calculation_log_level.py b/tests/test_litellm/test_cost_calculation_log_level.pyindex f5c03771cd7..f8d3557c572 100644--- a/tests/test_litellm/test_cost_calculation_log_level.py+++ b/tests/test_litellm/test_cost_calculation_log_level.py@@ -1,10 +1,7 @@"""Test that cost calculation uses appropriate log levels"""import logging-import os-import sys-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm import completion_costdiff --git a/tests/test_litellm/test_count_tokens_public_api.py b/tests/test_litellm/test_count_tokens_public_api.pyindex ebd9c0c9edb..86c33c3e8f7 100644--- a/tests/test_litellm/test_count_tokens_public_api.py+++ b/tests/test_litellm/test_count_tokens_public_api.py@@ -4,10 +4,8 @@ Tests for litellm.acount_tokens() public API.import asyncioimport os-import sysfrom unittest.mock import AsyncMock, patch-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.types.utils import TokenCountResponsediff --git a/tests/test_litellm/test_deepseek_model_metadata.py b/tests/test_litellm/test_deepseek_model_metadata.pyindex 4900af5d97d..b9eb33f0972 100644--- a/tests/test_litellm/test_deepseek_model_metadata.py+++ b/tests/test_litellm/test_deepseek_model_metadata.py@@ -11,11 +11,7 @@ field set to ``True``.import jsonimport os-import sys-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.utils import (diff --git a/tests/test_litellm/test_gpt_image_cost_calculator.py b/tests/test_litellm/test_gpt_image_cost_calculator.pyindex c371f7442be..d3ec0673fe3 100644--- a/tests/test_litellm/test_gpt_image_cost_calculator.py+++ b/tests/test_litellm/test_gpt_image_cost_calculator.py@@ -10,10 +10,7 @@ gpt-image-1 uses token-based pricing:- Image Output: $40.00/1M tokens"""-import os-import sys-sys.path.insert(0, os.path.abspath("../.."))import pytestdiff --git a/tests/test_litellm/test_lazy_imports.py b/tests/test_litellm/test_lazy_imports.pyindex f7c9cfa3074..2b16a812611 100644--- a/tests/test_litellm/test_lazy_imports.py+++ b/tests/test_litellm/test_lazy_imports.py@@ -1,11 +1,9 @@"""Simple tests for lazy import functionality."""-import osimport sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm._lazy_imports import (diff --git a/tests/test_litellm/test_logging.py b/tests/test_litellm/test_logging.pyindex 8551085cbd6..db8dfaa3ad6 100644--- a/tests/test_litellm/test_logging.py+++ b/tests/test_litellm/test_logging.py@@ -1,7 +1,6 @@import astimport asyncioimport json-import osimport reimport sysfrom pathlib import Path@@ -9,9 +8,7 @@ from typing import Listimport pytest-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system-pathimport logging-import sysimport litellmfrom litellm._logging import (diff --git a/tests/test_litellm/test_lowest_latency_zero_tokens.py b/tests/test_litellm/test_lowest_latency_zero_tokens.pyindex b9fc9b00cc7..ff60744e9ee 100644--- a/tests/test_litellm/test_lowest_latency_zero_tokens.py+++ b/tests/test_litellm/test_lowest_latency_zero_tokens.py@@ -1,14 +1,9 @@#### What this tests ##### This tests the router's handling of zero completion tokens in lowest latency routing-import os-import sysimport timeimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.caching.caching import DualCachediff --git a/tests/test_litellm/test_main.py b/tests/test_litellm/test_main.pyindex 95f3e35d51c..c05f25430c2 100644--- a/tests/test_litellm/test_main.py+++ b/tests/test_litellm/test_main.py@@ -2,16 +2,12 @@ import contextlibimport copyimport jsonimport os-import sysimport httpximport pytestimport respxfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport urllib.parsefrom unittest.mock import MagicMock, patchdiff --git a/tests/test_litellm/test_project_alias_tracking.py b/tests/test_litellm/test_project_alias_tracking.pyindex d18989d543f..476dfba0a27 100644--- a/tests/test_litellm/test_project_alias_tracking.py+++ b/tests/test_litellm/test_project_alias_tracking.py@@ -5,12 +5,9 @@ Verifies that project_alias flows from UserAPIKeyAuth through the metadata pipelto StandardLoggingMetadata, mirroring how team_alias already works."""-import os-import sysimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.litellm_core_utils.litellm_logging import StandardLoggingPayloadSetupfrom litellm.proxy._types import LiteLLM_VerificationTokenView, UserAPIKeyAuthdiff --git a/tests/test_litellm/test_redact_string_in_error_paths.py b/tests/test_litellm/test_redact_string_in_error_paths.pyindex 1c4d91397d1..6404db91acf 100644--- a/tests/test_litellm/test_redact_string_in_error_paths.py+++ b/tests/test_litellm/test_redact_string_in_error_paths.py@@ -9,14 +9,11 @@ Covers actual execution of redaction in:"""import logging-import os-import sysimport tracebackfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm._logging import _ENABLE_SECRET_REDACTION, _redact_stringdiff --git a/tests/test_litellm/test_register_model_custom_pricing.py b/tests/test_litellm/test_register_model_custom_pricing.pyindex dd19334724d..e3f6a1a0f40 100644--- a/tests/test_litellm/test_register_model_custom_pricing.py+++ b/tests/test_litellm/test_register_model_custom_pricing.py@@ -11,13 +11,9 @@ calculations for DB-sourced models with prompt caching pricing.import copyimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.main import _build_custom_pricing_entrydiff --git a/tests/test_litellm/test_responses_api_bridge_non_stream.py b/tests/test_litellm/test_responses_api_bridge_non_stream.pyindex 08d55ee8290..617b2cfc031 100644--- a/tests/test_litellm/test_responses_api_bridge_non_stream.py+++ b/tests/test_litellm/test_responses_api_bridge_non_stream.py@@ -1,11 +1,8 @@-import os-import sysfrom typing import Final, Optionalfrom unittest.mock import Mockimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.completion_extras.litellm_responses_transformation.handler import (ResponsesToCompletionBridgeHandler,diff --git a/tests/test_litellm/test_retrieve_batch_bedrock_dispatch.py b/tests/test_litellm/test_retrieve_batch_bedrock_dispatch.pyindex aa057b7bc73..9d0daa52645 100644--- a/tests/test_litellm/test_retrieve_batch_bedrock_dispatch.py+++ b/tests/test_litellm/test_retrieve_batch_bedrock_dispatch.py@@ -14,13 +14,10 @@ here is purely the dispatch logic that lives in ``main.py``.from __future__ import annotations-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellm # noqa: E402import openaidiff --git a/tests/test_litellm/test_router.py b/tests/test_litellm/test_router.pyindex 58a500def8e..56e00ecdad6 100644--- a/tests/test_litellm/test_router.py+++ b/tests/test_litellm/test_router.py@@ -3,15 +3,11 @@ import copyimport jsonimport loggingimport os-import sysimport threadingfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmdiff --git a/tests/test_litellm/test_router_google_genai.py b/tests/test_litellm/test_router_google_genai.pyindex 81dd7bbdc40..8a90173bb7f 100644--- a/tests/test_litellm/test_router_google_genai.py+++ b/tests/test_litellm/test_router_google_genai.py@@ -3,15 +3,10 @@Test to verify the new Google GenAI router methods"""import asyncio-import os-import sysfrom unittest.mock import AsyncMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.types.utils import ModelResponsediff --git a/tests/test_litellm/test_router_model_cost_isolation.py b/tests/test_litellm/test_router_model_cost_isolation.pyindex eb454bedbd8..b580b03574e 100644--- a/tests/test_litellm/test_router_model_cost_isolation.py+++ b/tests/test_litellm/test_router_model_cost_isolation.py@@ -11,12 +11,10 @@ import copyimport loggingimport osimport re-import sysfrom unittest.mock import patchimport pytest-sys.path.insert(0, os.path.abspath("../../..")) # Adds the parent directory to the system pathimport litellmfrom litellm import Routerdiff --git a/tests/test_litellm/test_router_retry_policy_update.py b/tests/test_litellm/test_router_retry_policy_update.pyindex 3fc6bc71b84..1b98b8c1ae8 100644--- a/tests/test_litellm/test_router_retry_policy_update.py+++ b/tests/test_litellm/test_router_retry_policy_update.py@@ -20,15 +20,12 @@ This file pins both halves of the fix."""import json-import os-import sysfrom dataclasses import dataclassfrom unittest.mock import AsyncMock, MagicMockimport pytestfrom pydantic import ValidationError-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.types.router import RetryPolicy, UpdateRouterConfigdiff --git a/tests/test_litellm/test_shared_session_integration.py b/tests/test_litellm/test_shared_session_integration.pyindex 4ce704f88cb..fab356db3b6 100644--- a/tests/test_litellm/test_shared_session_integration.py+++ b/tests/test_litellm/test_shared_session_integration.py@@ -2,14 +2,11 @@Integration tests for shared session functionality in main.py"""-import os-import sysfrom unittest.mock import MagicMock, patchimport pytest# Add the litellm directory to the path-sys.path.insert(0, os.path.abspath("../../.."))import litellmdiff --git a/tests/test_litellm/test_streaming_connection_cleanup.py b/tests/test_litellm/test_streaming_connection_cleanup.pyindex 5a81a3ffb17..39fcee8d44d 100644--- a/tests/test_litellm/test_streaming_connection_cleanup.py+++ b/tests/test_litellm/test_streaming_connection_cleanup.py@@ -3,15 +3,12 @@ Regression tests for streaming connection pool leak fix."""import asyncio-import os-import sysfrom unittest.mock import MagicMock, patchimport anyioimport httpximport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.litellm_core_utils.streaming_handler import CustomStreamWrapperfrom litellm.llms.custom_httpx.aiohttp_transport import (diff --git a/tests/test_litellm/test_utils.py b/tests/test_litellm/test_utils.pyindex cd8dad39ad5..d655eb96a02 100644--- a/tests/test_litellm/test_utils.py+++ b/tests/test_litellm/test_utils.py@@ -1,16 +1,12 @@import jsonimport loggingimport os-import sysfrom typing import Finalfrom unittest.mock import AsyncMock, MagicMock, patchimport pytestfrom jsonschema import validate-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm._logging import (diff --git a/tests/test_litellm/test_video_generation.py b/tests/test_litellm/test_video_generation.pyindex 117ca72c34f..fb167a8624e 100644--- a/tests/test_litellm/test_video_generation.py+++ b/tests/test_litellm/test_video_generation.py@@ -2,14 +2,10 @@ import asyncioimport ioimport jsonimport os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.cost_calculator import default_video_cost_calculator@@ -242,7 +238,6 @@ class TestVideoGeneration:def test_video_generation_cost_calculation(self):"""Test video generation cost calculation."""import json- import os# Try to load the local model cost map, skip if not foundcost_map_path = "model_prices_and_context_window.json"diff --git a/tests/test_litellm/test_xai_responses_auto_routing.py b/tests/test_litellm/test_xai_responses_auto_routing.pyindex a4d72bb97d9..5b1944dcb8b 100644--- a/tests/test_litellm/test_xai_responses_auto_routing.py+++ b/tests/test_litellm/test_xai_responses_auto_routing.py@@ -2,11 +2,8 @@Test automatic routing to xAI Responses API when tools are present"""-import os-import sysfrom unittest.mock import MagicMock, patch-sys.path.insert(0, os.path.abspath("../.."))import pytestimport litellmdiff --git a/tests/test_litellm/types/llms/test_types_llms_openai.py b/tests/test_litellm/types/llms/test_types_llms_openai.pyindex 569743269a5..e5e5c0183a0 100644--- a/tests/test_litellm/types/llms/test_types_llms_openai.py+++ b/tests/test_litellm/types/llms/test_types_llms_openai.py@@ -1,12 +1,9 @@import asyncio-import os-import sysfrom typing import Optionalfrom unittest.mock import AsyncMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import jsonimport litellmdiff --git a/tests/test_litellm/types/test_types_utils.py b/tests/test_litellm/types/test_types_utils.pyindex 672aa84cc73..c081b9e8e0d 100644--- a/tests/test_litellm/types/test_types_utils.py+++ b/tests/test_litellm/types/test_types_utils.py@@ -1,10 +1,7 @@-import os-import sysfrom typing import Finalimport pytest-sys.path.insert(0, os.path.abspath("../.."))from litellm.types.utils import HiddenParams, all_litellm_paramsdiff --git a/tests/test_litellm/vector_stores/test_vector_store_create_provider_logic.py b/tests/test_litellm/vector_stores/test_vector_store_create_provider_logic.pyindex bfb084e7dd2..4044e3dcc0e 100644--- a/tests/test_litellm/vector_stores/test_vector_store_create_provider_logic.py+++ b/tests/test_litellm/vector_stores/test_vector_store_create_provider_logic.py@@ -1,12 +1,7 @@-import os-import sysfrom unittest.mock import Mock, patchimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.llms.openai.vector_stores.transformation import OpenAIVectorStoreConfigdiff --git a/tests/test_litellm/vector_stores/test_vector_store_registry.py b/tests/test_litellm/vector_stores/test_vector_store_registry.pyindex 85ff8a1bcae..f19c3706845 100644--- a/tests/test_litellm/vector_stores/test_vector_store_registry.py+++ b/tests/test_litellm/vector_stores/test_vector_store_registry.py@@ -1,6 +1,4 @@import json-import os-import sysfrom unittest.mock import patchimport httpx@@ -8,9 +6,6 @@ import pytestimport respxfrom fastapi.testclient import TestClient-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathfrom datetime import datetime, timezonefrom unittest.mock import MagicMockdiff --git a/tests/test_litellm/videos/test_main.py b/tests/test_litellm/videos/test_main.pyindex 38667e93eee..22e1e5c05eb 100644--- a/tests/test_litellm/videos/test_main.py+++ b/tests/test_litellm/videos/test_main.py@@ -30,8 +30,6 @@ helper runs for real against genuinely-encoded ids, so the provider assertionsreflect production."""-import os-import sysfrom contextlib import ExitStackfrom dataclasses import dataclassfrom typing import Any, Dict@@ -39,7 +37,6 @@ from unittest.mock import MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.llms.custom_httpx.llm_http_handler import BaseLLMHTTPHandlerdiff --git a/tests/test_litellm/videos/test_utils.py b/tests/test_litellm/videos/test_utils.pyindex 09975829531..57fb549c23d 100644--- a/tests/test_litellm/videos/test_utils.py+++ b/tests/test_litellm/videos/test_utils.py@@ -9,12 +9,9 @@ runs for real, so the "litellm-internal params get stripped" assertions reflectproduction. Every test asserts the exact resulting dict, never "ran without error"."""-import os-import sysfrom unittest.mock import MagicMock-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.videos.utils import VideoGenerationRequestUtilsdiff --git a/tests/test_new_vector_store_endpoints.py b/tests/test_new_vector_store_endpoints.pyindex 4748d8e9947..c44723937ac 100644--- a/tests/test_new_vector_store_endpoints.py+++ b/tests/test_new_vector_store_endpoints.py@@ -4,13 +4,10 @@ Tests both basic functionality and complex scenarios including target_model_name"""import asyncio-import os-import sysfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom litellm.proxy._types import UserAPIKeyAuthdiff --git a/tests/test_ratelimit.py b/tests/test_ratelimit.pyindex 121dfbd99b7..7959f182a3a 100644--- a/tests/test_ratelimit.py+++ b/tests/test_ratelimit.py@@ -4,14 +4,10 @@ import osimport pytestimport randomfrom typing import Any-import sysfrom dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../")-) # Adds the parent directory to the system pathimport litellmfrom pydantic import BaseModeldiff --git a/tests/unified_google_tests/base_google_test.py b/tests/unified_google_tests/base_google_test.pyindex c4d8bb0d5aa..b7134962a0c 100644--- a/tests/unified_google_tests/base_google_test.py+++ b/tests/unified_google_tests/base_google_test.py@@ -1,14 +1,10 @@import asyncioimport json-import sysimport osimport tempfilefrom typing import Any, AsyncIterator, Dict, List, Optional, Unionimport pytest-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.google_genai import (diff --git a/tests/unified_google_tests/conftest.py b/tests/unified_google_tests/conftest.pyindex d2c6830c273..a4df8d03605 100644--- a/tests/unified_google_tests/conftest.py+++ b/tests/unified_google_tests/conftest.py@@ -4,7 +4,6 @@ import asyncioimport importlibimport osimport socket-import sysimport threadingimport timefrom pathlib import Path@@ -16,9 +15,6 @@ from dotenv import load_dotenvload_dotenv()-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm # noqa: E402,F401from tests._vcr_conftest_common import ( # noqa: E402,F401@@ -146,9 +142,6 @@ def setup_and_teardown(request):"""This fixture reloads litellm before every function. To speed up testing by removing callbacks being chained."""- sys.path.insert(- 0, os.path.abspath("../..")- ) # Adds the project directory to the system pathif "google_genai_proxy_url" not in request.fixturenames:diff --git a/tests/unified_google_tests/test_google_ai_studio.py b/tests/unified_google_tests/test_google_ai_studio.pyindex 3e40fa41089..6d4c3725080 100644--- a/tests/unified_google_tests/test_google_ai_studio.py+++ b/tests/unified_google_tests/test_google_ai_studio.py@@ -1,11 +1,6 @@from base_google_genai_proxy_sdk_test import BaseGoogleGenAIProxySDKTestfrom base_google_test import BaseGoogleGenAITest-import sys-import os-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport pytestimport litellmimport unittest.mockdiff --git a/tests/unified_google_tests/test_vertex_anthropic.py b/tests/unified_google_tests/test_vertex_anthropic.pyindex 71dad3a5cf9..f11ee28aacb 100644--- a/tests/unified_google_tests/test_vertex_anthropic.py+++ b/tests/unified_google_tests/test_vertex_anthropic.py@@ -1,15 +1,10 @@import asyncioimport json-import sys-import osfrom typing import Any, AsyncIterator, Dict, List, Optional, Unionimport pytestfrom unittest.mock import MagicMock, AsyncMock, patchimport httpx-sys.path.insert(- 0, os.path.abspath("../../..")-) # Adds the parent directory to the system pathimport litellmfrom litellm.google_genai import agenerate_content, agenerate_content_streamdiff --git a/tests/vector_store_tests/base_vector_store_test.py b/tests/vector_store_tests/base_vector_store_test.pyindex 4093ea7b43b..926fe98b6ec 100644--- a/tests/vector_store_tests/base_vector_store_test.py+++ b/tests/vector_store_tests/base_vector_store_test.py@@ -1,17 +1,12 @@import httpximport jsonimport pytest-import sysfrom typing import Any, Dict, Listfrom unittest.mock import MagicMock, Mock, patch-import osfrom litellm._uuid import uuidimport timeimport base64-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellmfrom abc import ABC, abstractmethodfrom litellm.integrations.custom_logger import CustomLoggerdiff --git a/tests/vector_store_tests/conftest.py b/tests/vector_store_tests/conftest.pyindex 48a82ea60a6..8c1e70b14bc 100644--- a/tests/vector_store_tests/conftest.py+++ b/tests/vector_store_tests/conftest.py@@ -2,13 +2,9 @@import importlibimport os-import sysimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathimport litellm@@ -18,9 +14,6 @@ def setup_and_teardown():This fixture reloads litellm before every function. To speed up testing by removing callbacks being chained."""curr_dir = os.getcwd() # Get the current working directory- sys.path.insert(- 0, os.path.abspath("../..")- ) # Adds the project directory to the system pathfrom litellm import Routerdiff --git a/tests/vector_store_tests/rag/base_rag_tests.py b/tests/vector_store_tests/rag/base_rag_tests.pyindex 2c5a2540a7e..caeb7651085 100644--- a/tests/vector_store_tests/rag/base_rag_tests.py+++ b/tests/vector_store_tests/rag/base_rag_tests.py@@ -4,15 +4,12 @@ Base RAG test class that enforces common tests across all providers.Providers should inherit from BaseRAGTest and implement the abstract methods."""-import os-import sysimport uuidfrom abc import ABC, abstractmethodfrom typing import Any, Dict, Optionalimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.types.rag import (diff --git a/tests/vector_store_tests/rag/test_rag_bedrock.py b/tests/vector_store_tests/rag/test_rag_bedrock.pyindex 7e788ed32f1..90cf4a3a44e 100644--- a/tests/vector_store_tests/rag/test_rag_bedrock.py+++ b/tests/vector_store_tests/rag/test_rag_bedrock.py@@ -11,12 +11,10 @@ Optional (for using existing KB instead of auto-creating):"""import os-import sysfrom typing import Any, Dict, Optionalimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.types.rag import RAGIngestOptions, BedrockVectorStoreOptionsdiff --git a/tests/vector_store_tests/rag/test_rag_openai.py b/tests/vector_store_tests/rag/test_rag_openai.pyindex d948e86fcf4..368e4e471b1 100644--- a/tests/vector_store_tests/rag/test_rag_openai.py+++ b/tests/vector_store_tests/rag/test_rag_openai.py@@ -2,13 +2,10 @@OpenAI RAG ingestion tests."""-import os-import sysfrom typing import Any, Dict, Optionalimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.types.rag import RAGIngestOptions, OpenAIVectorStoreOptionsdiff --git a/tests/vector_store_tests/rag/test_rag_s3_vectors.py b/tests/vector_store_tests/rag/test_rag_s3_vectors.pyindex cd8a362a7bf..d950bc0f644 100644--- a/tests/vector_store_tests/rag/test_rag_s3_vectors.py+++ b/tests/vector_store_tests/rag/test_rag_s3_vectors.py@@ -11,12 +11,10 @@ Optional:"""import os-import sysfrom typing import Any, Dict, Optionalimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.types.rag import RAGIngestOptionsdiff --git a/tests/vector_store_tests/rag/test_rag_vertex_ai.py b/tests/vector_store_tests/rag/test_rag_vertex_ai.pyindex c99840bb0fe..ae5891ed3ff 100644--- a/tests/vector_store_tests/rag/test_rag_vertex_ai.py+++ b/tests/vector_store_tests/rag/test_rag_vertex_ai.py@@ -17,12 +17,10 @@ Environment variables:"""import os-import sysfrom typing import Any, Dict, Optionalimport pytest-sys.path.insert(0, os.path.abspath("../../.."))import litellmfrom litellm.types.rag import RAGIngestOptionsdiff --git a/tests/vector_store_tests/test_gemini_vector_store.py b/tests/vector_store_tests/test_gemini_vector_store.pyindex 8e30c94de51..2aa2c1741a8 100644--- a/tests/vector_store_tests/test_gemini_vector_store.py+++ b/tests/vector_store_tests/test_gemini_vector_store.py@@ -3,9 +3,7 @@ Minimal Gemini File Search vector store tests."""import os-import sys-sys.path.insert(0, os.path.abspath("../.."))from base_vector_store_test import BaseVectorStoreTestdiff --git a/tests/vector_store_tests/test_ragflow_vector_store.py b/tests/vector_store_tests/test_ragflow_vector_store.pyindex 46751b64cce..0af821da98a 100644--- a/tests/vector_store_tests/test_ragflow_vector_store.py+++ b/tests/vector_store_tests/test_ragflow_vector_store.py@@ -3,13 +3,11 @@ Test RAGFlow Vector Store helper functions and transformation."""import os-import sysimport jsonimport pytestfrom unittest.mock import Mock, patch, MagicMockimport httpx-sys.path.insert(0, os.path.abspath("../.."))import litellmfrom tests.vector_store_tests.base_vector_store_test import BaseVectorStoreTestdiff --git a/tests/windows_tests/test_litellm_on_windows.py b/tests/windows_tests/test_litellm_on_windows.pyindex 8810cc78929..0a6058d6784 100644--- a/tests/windows_tests/test_litellm_on_windows.py+++ b/tests/windows_tests/test_litellm_on_windows.py@@ -1,16 +1,11 @@import asyncio-import osimport subprocess-import sysimport timeimport tracebackimport platformimport pytest-sys.path.insert(- 0, os.path.abspath("../..")-) # Adds the parent directory to the system pathdef test_using_litellm_on_windows():