From 80c868a0ef87cb615739fe6cbecefd9e2de24193 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 11 Jun 2026 05:03:20 +0000 Subject: [PATCH] test(proxy): stub watchfiles find_spec in reload override test Without stubbing importlib.util.find_spec, the test fails in environments that lack the watchfiles package because _configure_dev_reload now emits an extra warning before the .env override warning. --- tests/test_litellm/proxy/test_proxy_cli.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/proxy/test_proxy_cli.py b/tests/test_litellm/proxy/test_proxy_cli.py index e8ac199e5bb..dfb0a84ad29 100644 --- a/tests/test_litellm/proxy/test_proxy_cli.py +++ b/tests/test_litellm/proxy/test_proxy_cli.py @@ -204,7 +204,13 @@ class TestProxyInitializationHelpers: monkeypatch.chdir(tmp_path) uvicorn_args: dict = {} - with patch("litellm._logging.verbose_proxy_logger.warning") as mock_warning: + with ( + patch( + "litellm.proxy.proxy_cli.importlib.util.find_spec", + return_value=object(), + ), + patch("litellm._logging.verbose_proxy_logger.warning") as mock_warning, + ): ProxyInitializationHelpers._configure_dev_reload( uvicorn_args, str(config_file) )