litellm/tests/test_litellm/proxy
Ishaan Jaff b281181448
fix(tests): isolate auth in spend logs and vertex passthrough tests (#21810)
* fix(tests): add app.dependency_overrides for auth in spend logs tests

test_ui_view_spend_logs_with_status, test_ui_view_spend_logs_with_model,
test_ui_view_spend_logs_with_model_id, and test_view_spend_logs_summarize_parameter
all send Bearer sk-test without mocking user_api_key_auth. When a prior test
in the same xdist worker sets master_key, the auth check fails for sk-test
and the test fails intermittently.

Fix: use app.dependency_overrides[ps.user_api_key_auth] to bypass auth,
same pattern as other tests in the same file.

* fix(tests): mock user_api_key_auth in test_vertex_passthrough_with_no_default_credentials

vertex_proxy_route calls user_api_key_auth internally. When a prior test in the
same xdist worker sets master_key, the auth check fails for the test request
and create_pass_through_route is never called, causing assert_called_once_with to fail.

Fix: patch user_api_key_auth as an AsyncMock in the with mock.patch() block.
2026-02-21 12:51:38 -08:00
..
_experimental/mcp_server Add test for base url extraction and migration 2026-02-20 13:47:44 +05:30
agent_endpoints tests 2026-02-13 22:01:28 -08:00
anthropic_endpoints
auth Merge pull request #21009 from BerriAI/litellm_docker-count-no-req 2026-02-21 20:57:28 +05:30
client
common_utils fix(proxy): fix master key rotation Prisma validation errors (#21330) 2026-02-16 15:13:05 -08:00
db fix(proxy): restore broad is_database_connection_error; add is_database_transport_error for reconnect (#21796) 2026-02-21 12:04:00 -08:00
discovery_endpoints fix(azure): preserve content_policy_violation error details from Azure OpenAI (#20883) 2026-02-10 22:47:03 -08:00
experimental/mcp_server
google_endpoints
guardrails Guardrail - competitor name blocker (#21719) 2026-02-20 18:52:40 -08:00
health_endpoints fix: resolve flaky test failures in health, spend logs, and CLI tests (#21769) 2026-02-21 10:02:24 -08:00
hooks fix(tests): isolate flaky tests - restore global state in setup/teardown (#21791) 2026-02-21 11:30:35 -08:00
image_endpoints fixing core proxy tests 2026-02-12 17:54:32 -08:00
management_endpoints feat: expose user_email in organization members response 2026-02-20 21:41:53 -08:00
management_helpers
middleware test: add backwards compatibility tests for PrometheusAuthMiddleware 2026-02-21 12:06:31 -08:00
openai_files_endpoint fix(tests): isolate flaky files endpoint tests from global proxy state (#21788) 2026-02-21 11:20:32 -08:00
pass_through_endpoints fix(tests): isolate auth in spend logs and vertex passthrough tests (#21810) 2026-02-21 12:51:38 -08:00
policy_engine [Guardrails] Add guardrail pipeline support for conditional sequential execution (#21177) 2026-02-13 19:49:12 -08:00
prompts
public_endpoints
rag_endpoints tests and route permissions (#21508) 2026-02-18 16:58:38 -08:00
response_api_endpoints
spend_tracking fix(tests): isolate auth in spend logs and vertex passthrough tests (#21810) 2026-02-21 12:51:38 -08:00
test_configs
ui_crud_endpoints fix: 2 failing CI tests in litellm_mapped_tests_proxy_part2 (#21797) 2026-02-21 12:04:58 -08:00
vector_store_endpoints
__init__.py
conftest.py
test_api_key_masking_in_errors.py fix: mask API keys in error responses for invalid/malformed keys (#20289) 2026-02-12 19:58:05 +05:30
test_batch_metadata_none_fix.py
test_caching_routes.py
test_chat_completion_metadata.py
test_common_request_processing.py use cached keys and teams for router settings 2026-02-06 15:07:29 -08:00
test_custom_proxy.py
test_empty_model_list.py
test_enforce_user_param.py
test_fallback_management_endpoints.py
test_fastapi_offline_routes.py
test_health_check_functions.py
test_litellm_pre_call_utils.py Merge pull request #20526 from ryan-crabbe/perf/add-litellm-data-to-request-optimizations 2026-02-21 12:16:05 -08:00
test_model_dump_with_preserved_fields.py fix: address PR review comments for model_dump_with_preserved_fields 2026-02-21 10:48:10 -08:00
test_model_id_header_propagation.py
test_proxy_cli.py fix: 2 failing CI tests in litellm_mapped_tests_proxy_part2 (#21797) 2026-02-21 12:04:58 -08:00
test_proxy_server.py Merge origin/main into litellm_fix_streaming_connection_pool_leak 2026-02-21 12:44:50 -08:00
test_proxy_types.py
test_proxy_utils.py
test_pyroscope.py Fix CI/CD pyroscope test failure (#21219) 2026-02-14 12:07:20 -08:00
test_response_model_sanitization.py
test_route_a2a_models.py
test_route_llm_request.py
test_shared_health_check.py
test_spend_log_cleanup.py
test_swagger_chat_completions.py fix(tests): isolate flaky tests - restore global state in setup/teardown (#21791) 2026-02-21 11:30:35 -08:00
test_team_member_update.py