From f7e9ed3ee24f6cd20363767d9116e06763dff00e Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 11 Jul 2026 16:32:11 +0000 Subject: [PATCH] test(cli): verify --setup forwards --detailed_debug to the wizard --- tests/test_litellm/proxy/test_proxy_cli.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_litellm/proxy/test_proxy_cli.py b/tests/test_litellm/proxy/test_proxy_cli.py index 88dbec4020f..00d8c70da02 100644 --- a/tests/test_litellm/proxy/test_proxy_cli.py +++ b/tests/test_litellm/proxy/test_proxy_cli.py @@ -1907,3 +1907,24 @@ class TestWorkerStartupHooks: assert _dummy_hook_called is True, "First hook was not called" assert _dummy_async_hook_called is True, "Second hook was not called" + + +@pytest.mark.parametrize( + "cli_args, expected_debug", + [ + (["--setup"], False), + (["--setup", "--detailed_debug"], True), + ], +) +def test_setup_flag_forwards_detailed_debug(cli_args, expected_debug): + """`litellm --setup` must run the wizard, and --detailed_debug must reach it + so the wizard can enable debug logging (previously it returned first).""" + from click.testing import CliRunner + + from litellm.proxy.proxy_cli import run_server + + with patch("litellm.setup_wizard.run_setup_wizard") as mock_wizard: + result = CliRunner().invoke(run_server, cli_args) + + assert result.exit_code == 0, f"exit_code={result.exit_code}, output={result.output}" + mock_wizard.assert_called_once_with(debug=expected_debug)