code: def test_check_for_missing_main_guard():
      launcher = _MultiProcessingLauncher(
          strategy=Mock(), start_method="spawn"
      )
      with mock.patch(
          "lightning.fabric.strategies.launchers.multiprocessing.mp.current_process",
          return_value=Mock(
              _inheriting=True
          ),  # pretend that main is importing itself
      ), pytest.raises(
          RuntimeError,
          match="requires that your script guards the main",
      ):
          launcher.launch(function=Mock())
  
file_path: pytorch-lightning/tests/tests_fabric/strategies/launchers/test_multiprocessing.py
imports: from unittest import mock
  from unittest.mock import ANY, Mock
  import pytest
  import torch
  from lightning.fabric.strategies.launchers.multiprocessing import _GlobalStateSnapshot, _MultiProcessingLauncher
  from tests_fabric.helpers.runif import RunIf
label_desc: Use image node_id 7 for calling a global function with example usage: test_check_for_missing_main_guard() without return types