From 9b8240e7405974d0244f1355a8d0fcd3bd2cf72f Mon Sep 17 00:00:00 2001 From: Charlie Doern Date: Mon, 3 Nov 2025 11:30:20 -0500 Subject: [PATCH] remove MagicMock for argparse.Namespace no need to mock Signed-off-by: Charlie Doern --- tests/unit/cli/test_stack_config.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/unit/cli/test_stack_config.py b/tests/unit/cli/test_stack_config.py index 0251452ef..6aefac003 100644 --- a/tests/unit/cli/test_stack_config.py +++ b/tests/unit/cli/test_stack_config.py @@ -277,7 +277,7 @@ def test_providers_flag_generates_config_with_api_keys(): API keys and other credentials for remote providers like remote::openai. """ import argparse - from unittest.mock import MagicMock, patch + from unittest.mock import patch from llama_stack.cli.stack.run import StackRun @@ -286,13 +286,14 @@ def test_providers_flag_generates_config_with_api_keys(): stack_run = StackRun(subparsers) # Create args with --providers flag set - args = MagicMock() - args.providers = "inference=remote::openai" - args.config = None - args.port = 8321 - args.image_type = None - args.image_name = None - args.enable_ui = False + args = argparse.Namespace( + providers="inference=remote::openai", + config=None, + port=8321, + image_type=None, + image_name=None, + enable_ui=False, + ) # Mock _uvicorn_run to prevent starting a server with patch.object(stack_run, "_uvicorn_run"):