code: def test_lightning_run_app_secrets(monkeypatch):
      """Validates that running apps only supports the `--secrets` argument if the `--cloud` argument is passed."""
      monkeypatch.setattr(
          "lightning.app.runners.cloud.logger", logging.getLogger()
      )
  
      with pytest.raises(click.exceptions.ClickException):
          _run_app(
              file=os.path.join(
                  _PROJECT_ROOT,
                  "tests/tests_app/core/scripts/app_metadata.py",
              ),
              cloud=False,
              without_server=False,
              name="",
              blocking=False,
              open_ui=False,
              no_cache=True,
              env=(),
              secret=("FOO=my-secret"),
              run_app_comment_commands=False,
              enable_basic_auth="",
          )
  
file_path: pytorch-lightning/tests/tests_app/cli/test_run_app.py
imports: import logging
  import os
  from pathlib import Path
  from unittest import mock
  import click
  import lightning.app.core.constants
  import pytest
  from click.testing import CliRunner
  from lightning.app import LightningApp
  from lightning.app.cli.lightning_cli import _run_app, run_app
  from lightning.app.runners.runtime_type import RuntimeType
  from lightning.app.utilities.app_helpers import convert_print_to_logger_info
  from tests_app import _PROJECT_ROOT
label_desc: Use image node_id 4 for calling a global function with example usage: test_lightning_run_app_secrets(monkeypatch) without return types