test: drop the leftover set_verbose from eleven test files (#37845)

Twenty-three tests across eleven files opened with litellm.set_verbose = True
and never put it back, so the flag stayed on for everything that ran after them
in the same process. None of those files read the output it produces: no
caplog, no capsys, no assertion on a log line, so the flag was left over from
debugging. Deleting it beats restoring it, since restoring keeps the noise.

Ten of the eleven stop leaving the flag on. test_volcengine_embedding.py still
ends with it set, from something it exercises rather than from the test itself,
which is worth its own look.
This commit is contained in:
yuneng-jiang 2026-08-22 08:23:27 -07:00 committed by GitHub
parent b9bff0998c
commit 7dff9953cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 1 additions and 24 deletions

View file

@ -12,7 +12,7 @@
"limit": 469
},
"TQ005": {
"limit": 2459
"limit": 2436
},
"TQ006": {
"limit": 34

View file

@ -812,7 +812,6 @@ async def test_azure_client_reuse(function_name, is_async, args):
"""
Test that multiple Azure API calls reuse the same Azure OpenAI client
"""
litellm.set_verbose = True
# Determine which client class to mock based on whether the test is async
client_path = (

View file

@ -153,7 +153,6 @@ class TestBedrockAsyncInvokeEmbedding:
def test_async_invoke_twelvelabs_embedding_with_mock(self):
"""Test async invoke embedding with mocked HTTP calls."""
litellm.set_verbose = True
client = HTTPHandler()
test_api_key = "test-bearer-token-12345"
model = "bedrock/async_invoke/twelvelabs.marengo-embed-2-7-v1:0"
@ -193,7 +192,6 @@ class TestBedrockAsyncInvokeEmbedding:
@pytest.mark.asyncio
async def test_async_invoke_twelvelabs_embedding_async_with_mock(self):
"""Test async invoke embedding with async calls."""
litellm.set_verbose = True
client = AsyncHTTPHandler()
test_api_key = "test-bearer-token-12345"
model = "bedrock/async_invoke/twelvelabs.marengo-embed-2-7-v1:0"

View file

@ -18,7 +18,6 @@ mock_image_response = {"images": ["base64_encoded_image_data"], "error": None}
class TestBedrockImageGeneration:
def test_image_generation_with_api_key_bearer_token(self):
"""Test image generation with bearer token authentication"""
litellm.set_verbose = True
test_api_key = "test-bearer-token-12345"
model = "bedrock/stability.sd3-large-v1:0"
prompt = "A cute baby sea otter"
@ -53,7 +52,6 @@ class TestBedrockImageGeneration:
def test_image_generation_with_env_variable_bearer_token(self, monkeypatch):
"""Test image generation with bearer token from environment variable"""
litellm.set_verbose = True
test_api_key = "env-bearer-token-12345"
model = "bedrock/stability.sd3-large-v1:0"
prompt = "A cute baby sea otter"
@ -90,7 +88,6 @@ class TestBedrockImageGeneration:
@pytest.mark.asyncio
async def test_async_image_generation_with_bearer_token(self):
"""Test async image generation with bearer token authentication"""
litellm.set_verbose = True
test_api_key = "async-bearer-token-12345"
model = "bedrock/stability.sd3-large-v1:0"
prompt = "A cute baby sea otter"
@ -125,7 +122,6 @@ class TestBedrockImageGeneration:
def test_image_generation_with_sigv4(self):
"""Test image generation falls back to SigV4 auth when no bearer token is provided"""
litellm.set_verbose = True
model = "bedrock/stability.sd3-large-v1:0"
prompt = "A cute baby sea otter"

View file

@ -66,7 +66,6 @@ def test_bedrock_rerank_header_forwarding_sync(model):
This test verifies the fix for the issue where headers configured via
forward_client_headers_to_llm_api were not being passed to Bedrock rerank provider.
"""
litellm.set_verbose = True
client = HTTPHandler()
test_api_key = "test-bearer-token-12345"
@ -160,7 +159,6 @@ async def test_bedrock_rerank_header_forwarding_async(model):
This test verifies the fix for the issue where headers configured via
forward_client_headers_to_llm_api were not being passed to Bedrock rerank provider.
"""
litellm.set_verbose = True
client = AsyncHTTPHandler()
test_api_key = "test-bearer-token-12345"
@ -332,7 +330,6 @@ def test_bedrock_rerank_extra_headers_and_headers_merge():
This ensures that headers from kwargs (forwarded by proxy) and extra_headers
(passed explicitly) are both included in the final headers sent to the provider.
"""
litellm.set_verbose = True
client = HTTPHandler()
test_api_key = "test-bearer-token-12345"
model = "bedrock/arn:aws:bedrock:us-east-1::foundation-model/cohere.rerank-v3-5:0"

View file

@ -86,7 +86,6 @@ async def test_openai_client_reuse(function_name, is_async, args):
"""
Test that multiple API calls reuse the same OpenAI client
"""
litellm.set_verbose = True
# Determine which client class to mock based on whether the test is async
client_path = (

View file

@ -33,7 +33,6 @@ def test_completion_pydantic_obj_2():
from litellm.llms.custom_httpx.http_handler import HTTPHandler
litellm.set_verbose = True
class CalendarEvent(BaseModel):
name: str
@ -259,7 +258,6 @@ def test_vertex_tool_type_field_removal():
def test_function_calling_with_gemini():
from litellm.llms.custom_httpx.http_handler import HTTPHandler
litellm.set_verbose = True
client = HTTPHandler()
with patch.object(client, "post", new=MagicMock()) as mock_post:
try:
@ -310,7 +308,6 @@ def test_function_calling_with_gemini():
def test_multiple_function_call():
litellm.set_verbose = True
from litellm.llms.custom_httpx.http_handler import HTTPHandler
client = HTTPHandler()
@ -420,7 +417,6 @@ def test_multiple_function_call():
def test_multiple_function_call_changed_text_pos():
litellm.set_verbose = True
from litellm.llms.custom_httpx.http_handler import HTTPHandler
client = HTTPHandler()
@ -528,7 +524,6 @@ def test_multiple_function_call_changed_text_pos():
def test_function_calling_with_gemini_multiple_results():
litellm.set_verbose = True
from litellm.llms.custom_httpx.http_handler import HTTPHandler
client = HTTPHandler()
@ -1103,7 +1098,6 @@ def test_logprobs_unit_test():
def test_logprobs():
litellm.set_verbose = True
from litellm.llms.custom_httpx.http_handler import HTTPHandler
client = HTTPHandler()

View file

@ -31,7 +31,6 @@ class TestVolcEngineEmbedding(BaseLLMEmbeddingTest):
@pytest.mark.parametrize("sync_mode", [True, False])
async def test_basic_embedding(self, sync_mode):
"""Test basic embedding functionality with realistic response"""
litellm.set_verbose = True
embedding_call_args = self.get_base_embedding_call_args()
# Mock the embedding functions to avoid actual API calls

View file

@ -26,7 +26,6 @@ from litellm.proxy.guardrails.init_guardrails import init_guardrails_v2
def test_cato_guard_config():
litellm.set_verbose = True
litellm.guardrail_name_config_map = {}
init_guardrails_v2(
@ -47,7 +46,6 @@ def test_cato_guard_config():
def test_cato_guard_config_no_api_key(monkeypatch):
monkeypatch.delenv("CATO_API_KEY", raising=False)
litellm.set_verbose = True
litellm.guardrail_name_config_map = {}
with pytest.raises(CatoNetworksGuardrailMissingSecrets, match="Couldn't get Cato Networks api key"):
init_guardrails_v2(

View file

@ -44,7 +44,6 @@ from tests.test_litellm.proxy.guardrails.guardrail_hooks._cisco_ai_defense_test_
def test_cisco_ai_defense_config_via_init_v2_chat(monkeypatch):
monkeypatch.setenv("CISCO_AI_DEFENSE_API_KEY", "test-key")
litellm.set_verbose = True
litellm.guardrail_name_config_map = {}
init_guardrails_v2(

View file

@ -65,7 +65,6 @@ def setup_and_teardown():
asyncio.set_event_loop(loop)
# Set up litellm state
litellm.set_verbose = True
litellm.guardrail_name_config_map = {}
yield

View file

@ -158,7 +158,6 @@ class TestTextFormatConversion:
new=mock_handler,
):
litellm._turn_on_debug()
litellm.set_verbose = True
# Call aresponses with text_format parameter
response = await litellm.aresponses(