code: def test_validate_cluster_environment_user_settings(*_):
      """Test that the launcher calls into the cluster environment to validate the user settings."""
      cluster_env = Mock(
          validate_settings=Mock(side_effect=RuntimeError("test"))
      )
      cluster_env.creates_processes_externally = True
      launcher = _SubprocessScriptLauncher(
          cluster_env, num_processes=2, num_nodes=1
      )
  
      with pytest.raises(RuntimeError, match="test"):
          launcher.launch(Mock())
  
file_path: pytorch-lightning/tests/tests_pytorch/strategies/launchers/test_subprocess_script.py
imports: import subprocess
  import sys
  from unittest import mock
  from unittest.mock import Mock
  import pytest
  from lightning.pytorch.strategies.launchers.subprocess_script import _SubprocessScriptLauncher
  from lightning_utilities.core.imports import RequirementCache
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 3 for calling a global function with example usage: test_validate_cluster_environment_user_settings() without return types