From d8dbb7f5ab6158c061fb41c660aa57c8688cabe2 Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Sun, 15 Feb 2026 14:24:38 -0300 Subject: [PATCH] refactor(test): remove redundant cache flush from test_openai_env_base The manual cache flush is redundant since the autouse fixture clear_client_cache (lines 21-32) already flushes the cache before and after every test in this module. The manual flush was added in Jan 2026 before the autouse fixture existed. Now that the fixture handles it, the manual flush is unnecessary. Related: greptile review comment on PR #21255 Co-Authored-By: Claude Sonnet 4.5 --- tests/test_litellm/test_main.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/test_litellm/test_main.py b/tests/test_litellm/test_main.py index fec7fdaee94..ca936238547 100644 --- a/tests/test_litellm/test_main.py +++ b/tests/test_litellm/test_main.py @@ -497,12 +497,6 @@ async def test_openai_env_base( respx_mock: respx.MockRouter, env_base, openai_api_response, monkeypatch ): "This tests OpenAI env variables are honored, including legacy OPENAI_API_BASE" - # Clear cache to ensure no cached clients from previous tests interfere - # This prevents cache pollution where a previous test cached a client with - # aiohttp transport, which would bypass respx mocks - if hasattr(litellm, "in_memory_llm_clients_cache"): - litellm.in_memory_llm_clients_cache.flush_cache() - # Ensure aiohttp transport is disabled to use httpx which respx can mock litellm.disable_aiohttp_transport = True