litellm/tests/test_litellm/llms/vertex_ai
Julio Quinteros Pro ab6d2eefb9 fix: improve test isolation for parallel execution
Fixes test failures that occur during parallel test execution (pytest -n 4)
due to module reloading issues with conftest.py reloading litellm.

Changes:
- Add module reload fixtures to ensure fresh references after conftest reloads
- Use patch.object and string-based patches instead of direct attribute assignment
- Use class name comparison instead of isinstance for reloaded modules
- Handle case where litellm is missing from sys.modules during parallel runs
- Move stream consumption inside patch contexts to avoid real API calls
- Mock litellm.acompletion instead of low-level HTTP handlers
- Add skipif decorator for enterprise-only test classes

Affected test files:
- test_container_integration.py
- test_responses_background_cost.py
- test_huggingface_embedding_handler.py
- test_vertex_ai_rerank_integration.py
- test_volcengine_responses_transformation.py
- test_pillar_guardrails.py
- test_litellm_pre_call_utils.py
- test_proxy_server.py
- test_converse_transformation.py
- test_chat_completions_handler.py
- test_aresponses_api_with_mcp.py
- test_anthropic_experimental_pass_through_messages_handler.py

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 21:28:23 -03:00
..
context_caching 🐛 Bug Fix #19642 : bug in Vertex AI context caching (#19657) 2026-02-02 18:13:34 +05:30
files Fix: upload pdfs for file endpoint 2026-01-19 11:58:32 +05:30
gemini feat(vertex_ai): preserve usageMetadata in _hidden_params (#20559) 2026-02-12 20:44:59 -08:00
image_edit Merge branch 'main' into litellm_image_edit_vertex_cred_fix 2025-12-17 22:38:07 +05:30
image_generation refactor(image-gen): move thought_signature to provider_specific_fields 2026-02-02 18:12:41 +05:30
multimodal_embeddings [Bug fix] Vertex Multimodal embeddings - Support text + base64 image combinations (#18172) 2025-12-18 13:22:43 +05:30
rerank fix: improve test isolation for parallel execution 2026-02-17 21:28:23 -03:00
vertex_ai_partner_models fix(tests): add cache flush fixture for reliable HTTP client isolation 2026-02-17 21:02:56 -03:00
vertex_gemma_models Perf speed up pytest (#15951) 2025-10-27 19:43:40 -07:00
videos Add Vertex and Gemini Videos API with Cost Tracking + UI support (#16323) 2025-11-08 16:03:51 -08:00
__init__.py fix imports 2025-11-08 18:01:32 -08:00
test_bge_embedding.py Fix CI: Revert security scan changes and add GitGuardian ignore rules (#18358) 2025-12-22 17:03:53 -08:00
test_bge_response_transformation.py test_is_bge_model_detection 2025-12-02 21:59:02 +05:30
test_gemini_empty_properties.py fix: keep type field in Gemini schema when properties is empty (#18979) 2026-01-14 22:58:05 +05:30
test_gemini_header_forwarding.py fix passing headers for gemini (#15231) 2025-10-06 12:59:19 -07:00
test_http_status_201.py Litellm fix GitHub action testing (#11163) 2025-05-26 14:41:42 -07:00
test_vertex.py Fix:test_multiple_function_call 2026-01-22 19:34:54 +05:30
test_vertex_ai_common_utils.py fix(vertex_ai): support model names with slashes in passthrough URLs (#19944) 2026-01-28 09:33:53 -08:00
test_vertex_ai_psc_endpoint_support.py fix failing vertex tests 2025-12-06 00:04:04 +05:30
test_vertex_global_url_support.py feat(vertex-ai): add centralized get_vertex_base_url() helper for global location support 2025-12-24 13:51:58 +05:30
test_vertex_image_generation.py test: fix tests 2025-11-22 16:50:50 -08:00
test_vertex_llm_base.py Revert "Add support for Vertex AI API keys" 2026-01-10 13:39:49 -08:00