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.
This commit is contained in:
Cursor Agent 2026-06-11 05:03:20 +00:00
parent e611e34bc0
commit 80c868a0ef
No known key found for this signature in database

View file

@ -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)
)