mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
A name bound twice keeps only the second binding. In `tests/` that is nearly always a repeated import, harmless but misleading, and the same rule is what catches the cases that are not harmless: a local that shadows an import the module still calls, and a second `def test_x` that quietly replaces the first. 311 of the 344 sites were repeated imports and came out with ruff's own fix. The remaining 33 needed a decision. Four modules imported a name they never used because a local definition below already shadowed it. Two comprehensions bound `call` over `unittest.mock.call`, which those modules import and use. One test rebound the two module handles its nested reload closure had captured. One class attribute shadowed an unused `status` import. The load-test fixtures move to a conftest, which is how pytest is meant to share them, so the test module no longer imports three fixture names it never calls. The nine `prisma_client` parameters keep a narrow `noqa`: pytest resolves that fixture by name before the body runs, so the parameter never shadows anything. |
||
|---|---|---|
| .. | ||
| messages_api_structured_output | ||
| base_anthropic_messages_prompt_caching_test.py | ||
| base_anthropic_messages_tool_search_test.py | ||
| base_anthropic_unified_messages_test.py | ||
| conftest.py | ||
| test_anthropic_messages_passthrough.py | ||
| test_anthropic_messages_prompt_caching.py | ||
| test_anthropic_messages_tool_search.py | ||
| test_assemblyai_unit_tests_passthrough.py | ||
| test_bedrock_anthropic_messages_test.py | ||
| test_bedrock_tool_use_beta_header.py | ||
| test_claude_code_marketplace.py | ||
| test_context_management_polyfill.py | ||
| test_custom_logger_passthrough.py | ||
| test_pass_through_unit_tests.py | ||
| test_passthrough_managed_ids.py | ||
| test_passthrough_registry_updates.py | ||
| test_unit_test_anthropic_pass_through.py | ||
| test_unit_test_passthrough_router.py | ||
| test_unit_test_streaming.py | ||
| test_vertex_ai_anthropic_streaming_cost_injection.py | ||
| test_vertex_ai_live_passthrough.py | ||
| test_websearch_interception_e2e.py | ||