litellm/tests
Julio Quinteros Pro 26f8e1ac0a fix(tests): resolve test isolation issue in http_handler tests
Fix isinstance() checks failing due to module reload in conftest.py.

The conftest.py fixture reloads the litellm module between test modules,
which causes class references imported at module-level to become stale.
When AsyncHTTPHandler is imported at the top of the file and then litellm
is reloaded by the fixture, the isinstance() check fails because the
returned instance is of the NEW AsyncHTTPHandler class while the test
is checking against the OLD class reference.

Solution: Import AsyncHTTPHandler locally within each test function that
uses isinstance() checks. This ensures we get the fresh class reference
after the module reload.

Fixed tests:
- test_session_reuse_integration
- test_get_async_httpx_client_with_shared_session
- test_get_async_httpx_client_without_shared_session

This resolves intermittent CI failures where parallel test execution
triggers the module reload behavior.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-17 19:01:02 -03:00
..
agent_tests [Fix] A2a Agent Gateway Fixes - A2A agents deployed with localhost/internal URLs in their agent cards (e.g., http://0.0.0.0:8001/) (#20604) 2026-02-06 15:02:34 -08:00
audio_tests
basic_proxy_startup_tests
batches_tests fix: thread deployment model_info through batch cost calculation 2026-02-15 14:53:30 -05:00
code_coverage_tests IGNORE_FUNCTIONS 2026-02-14 12:59:15 -08:00
documentation_tests fix: test_env_keys 2026-01-20 18:37:56 +05:30
enterprise removed /models and v1/models from llm api routes (#20988) 2026-02-13 18:32:41 +05:30
guardrails_tests feat: EU AI Act Article 5 policy template for prohibited practices detection (#21342) 2026-02-16 15:33:07 -08:00
image_gen_tests [Release - 02/10/2026] v1.81.10-nightly 2026-02-10 16:26:30 -08:00
litellm fix(anthropic): filter unsupported JSON schema constraints for structured outputs (#20813) 2026-02-14 09:07:40 -08:00
litellm_core_utils Fix: empty assistant message for converse API 2026-02-04 09:50:58 +05:30
litellm_utils_tests Add test case for Databricks Meta LLaMA 3.1 70B instruct model in content parsing tests 2026-02-17 15:36:00 +09:00
litellm-proxy-extras fix: resolve 'does not exist' migration errors as applied in setup_database (#19281) 2026-01-26 22:11:36 -08:00
llm_responses_api_testing fixing test_basic_openai_responses_api 2026-02-16 20:14:06 -08:00
llm_translation Add tests for openai evals 2026-02-17 19:30:58 +05:30
load_tests
local_testing test_partner_models_httpx_streaming 2026-02-14 12:41:35 -08:00
logging_callback_tests fix(logging): avoid shared callback list references (#20984) 2026-02-13 18:32:41 +05:30
mcp_tests fix: import LiteLLM_ObjectPermissionTable from _types instead of proxy_server 2026-02-13 14:46:03 -03:00
multi_instance_e2e_tests
ocr_tests
old_proxy_tests/tests
openai_endpoints_tests Fix: Managed Batches: Inconsistent State Management for list and cancel batches 2026-02-03 14:47:28 +05:30
otel_tests test fix 2026-01-31 19:08:07 -08:00
pass_through_tests
pass_through_unit_tests Fix beta header old tests 2026-02-11 18:13:36 +05:30
proxy_admin_ui_tests sorting spend logs in ui 2026-02-13 11:33:41 -08:00
proxy_e2e_anthropic_messages_tests test_anthropic_messages_with_all_beta_headers 2026-02-14 13:03:52 -08:00
proxy_security_tests
proxy_unit_tests fix: complete asyncio.iscoroutinefunction deprecation fix across codebase 2026-02-17 18:20:44 -03:00
router_unit_tests fix(test): add router.acancel_batch coverage (#20183) 2026-01-31 12:39:19 -08:00
scim_tests
search_tests skip brave tests 2026-01-22 10:50:23 -08:00
spend_tracking_tests increasing time for spend tracking 2026-01-20 16:31:25 -08:00
store_model_in_db_tests
test_litellm fix(tests): resolve test isolation issue in http_handler tests 2026-02-17 19:01:02 -03:00
unified_google_tests Revert "[Infra] Changing Google Tests to use Gemini 3 Flash Preview" 2026-01-20 17:32:10 -08:00
vector_store_tests Add support for vertex ai for rag/ingest 2026-02-13 20:11:10 +05:30
windows_tests
__init__.py
gettysburg.wav
large_text.py
openai_batch_completions.jsonl
README.MD
test_budget_management.py
test_callbacks_on_proxy.py
test_config.py
test_debug_warning.py
test_default_encoding_non_root.py fix: resolve Read-only file system error in non-root images (#19449) 2026-01-20 19:00:52 -08:00
test_end_users.py
test_entrypoint.py
test_fallbacks.py Revert "fix: prevent error when max_fallbacks exceeds available models (#20071)" 2026-02-03 15:15:30 +05:30
test_gpt5_azure_temperature_support.py
test_health.py
test_keys.py Adding retries to flaky tests 2026-01-22 15:21:44 -08:00
test_litellm_proxy_responses_config.py
test_logging.conf
test_models.py
test_openai_endpoints.py
test_organizations.py Adding retries to flaky tests 2026-01-22 15:21:44 -08:00
test_otel_thread_leak.py Fix thread leak in OpenTelemetry dynamic header path (#19946) 2026-01-28 10:35:37 -08:00
test_passthrough_endpoints.py
test_presidio_latency.py fix(presidio): reuse HTTP connections to prevent OOMs (#19964) 2026-01-28 16:08:53 -08:00
test_proxy_server_non_root.py deactivating non root tests 2026-01-23 22:55:36 -08:00
test_ratelimit.py
test_resource_cleanup.py
test_service_logger_otel.py fix(langfuse_otel): prevent empty proxy request spans from being sent to Langfuse 2026-01-28 15:35:35 +01:00
test_spend_logs.py
test_team_logging.py
test_team_members.py
test_team.py Fix: test_team_update_sc_2 2026-02-05 09:40:21 +05:30
test_users.py

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.