litellm/tests/vector_store_tests
ryan-crabbe-berri 680bcfd8aa
test(lint): ban blind pytest.raises(Exception) with ruff B017 (#37731)
* test(lint): ban blind pytest.raises(Exception) with ruff B017

A bare pytest.raises(Exception) accepts whatever the body throws. The TypeError
a refactor introduces satisfies it exactly as well as the rejection the test was
written for, so the crash reads as a pass and the test never goes red.

All 111 existing sites are narrowed here. A runtime probe recorded the concrete
exception each one actually catches, and each site now names that type. Where
the code under test genuinely raises a bare Exception, the site pins a stable
slice of the message with match= instead.

Two sites tell on themselves. The shared responses-API cancel test raises
"custom_llm_provider is required but passed as None" rather than talking to a
provider at all, because cancel_responses takes a provider, not a model. And
test_bedrock_guardrails_with_streaming was the only test in its file still
passing without AWS credentials, because the NoCredentialsError boto3 raised
long before the guardrail ran satisfied the blind raises.

* fix(test): widen the openai batch-dispatch assertion to OpenAIError

The narrowed NotFoundError only holds where OPENAI_API_KEY is set. Without one
the SDK raises OpenAIError while building the client, long before any 404, so CI
went red. OpenAIError covers both and still rejects a TypeError from a refactor.
2026-08-20 18:09:42 -07:00
..
rag style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
base_vector_store_test.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
conftest.py [Feat] Add OpenAI Search Vector Store Operation (#12018) 2025-06-24 15:52:43 -07:00
test_azure_ai_vector_store.py test: update test apis 2026-03-28 18:57:27 -07:00
test_azure_vector_store.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_bedrock_vector_store.py Revert "chore(tests): migrate Bedrock CI to AWS account 941277531214 (#28728)" (#29326) 2026-05-30 11:26:24 -07:00
test_gemini_vector_store.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_milvus_vector_store.py fix: drop milvus dbName and partitionNames from MILVUS_OPTIONAL_PARAMS 2026-04-30 11:51:32 -07:00
test_openai_vector_store.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_ragflow_vector_store.py test(lint): ban blind pytest.raises(Exception) with ruff B017 (#37731) 2026-08-20 18:09:42 -07:00
test_s3_vectors_vector_store.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
test_vertex_ai_search_api_vector_store.py (feat) Vector Stores: support Vertex AI Search API as vector store through LiteLLM (#15781) 2025-10-22 18:56:36 -07:00
test_vertex_ai_vector_store.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00