def test_manual_user_launch(environ, creates_processes_externally):
    """Test that the environment switches to manual user mode when LOCAL_RANK env variable detected."""
    with mock.patch.dict(os.environ, environ):
        env = LightningEnvironment()
        assert env.creates_processes_externally == creates_processes_externally
Test that the environment switches to manual user mode when LOCAL_RANK env variable detected.
tests/tests_fabric/plugins/environments/test_lightning.py