code: def test_multi_node_warn_running_locally():
      class Work(LightningWork):
          def run(self):
              pass
  
      with pytest.warns(
          UserWarning,
          match=escape("You set MultiNode(num_nodes=2, ...)` but "),
      ):
          MultiNode(
              Work, num_nodes=2, cloud_compute=CloudCompute("gpu")
          )
  
      with no_warning_call(
          UserWarning,
          match=escape("You set MultiNode(num_nodes=1, ...)` but "),
      ):
          MultiNode(
              Work, num_nodes=1, cloud_compute=CloudCompute("gpu")
          )
  
file_path: pytorch-lightning/tests/tests_app/components/multi_node/test_base.py
imports: from re import escape
  from unittest import mock
  import pytest
  from lightning.app import CloudCompute, LightningWork
  from lightning.app.components import MultiNode
  from lightning_utilities.test.warning import no_warning_call
label_desc: Use image node_id 1 for calling a global function with example usage: test_multi_node_warn_running_locally() without return types