Skip to content

Commit 92c06fe

Browse files
xuanyang15copybara-github
authored andcommitted
fix: Mock subprocess.run in test_cli_deploy to avoid gcloud calls
Co-authored-by: Xuan Yang <xygoogle@google.com> PiperOrigin-RevId: 910796426
1 parent 9d1bb4b commit 92c06fe

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/unittests/cli/utils/test_cli_deploy.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,13 @@ def mock_handle_login():
714714
cli_deploy._onboarding, "handle_login_with_google", mock_handle_login
715715
)
716716

717+
# Mock subprocess.run to avoid calling gcloud
718+
monkeypatch.setattr(
719+
subprocess,
720+
"run",
721+
lambda *a, **k: types.SimpleNamespace(stdout="fake-project\n"),
722+
)
723+
717724
fake_vertexai = types.ModuleType("vertexai")
718725

719726
class _FakeAgentEngines:

0 commit comments

Comments
 (0)