def METHOD_NAME(message, monkeypatch, caplog):
    monkeypatch.setattr(cloud, "V1LightningappInstanceState", MagicMock())
    monkeypatch.setattr(cloud, "CloudspaceIdRunsBody", MagicMock())
    monkeypatch.setattr(cloud, "V1Flowserver", MagicMock())
    monkeypatch.setattr(cloud, "V1LightningappInstanceSpec", MagicMock())
    monkeypatch.setattr(cloud, "LocalSourceCodeDir", MagicMock())
    monkeypatch.setattr(cloud, "_prepare_lightning_wheels_and_requirements", MagicMock())
    monkeypatch.setattr(cloud, "logger", logging.getLogger())
    runner = CliRunner()
    fake_grid_rest_client = partial(FakeLightningClientException, message=message)
    with caplog.at_level(logging.ERROR), mock.patch(
        "lightning.app.runners.backends.cloud.LightningClient", fake_grid_rest_client
    ):
        result = runner.invoke(run_app, [_FILE_PATH, "--cloud", "--open-ui=False"], catch_exceptions=False)
        assert result.exit_code == 1
    assert caplog.messages == [message]