def METHOD_NAME() -> None:
    def assert_env_vars(
        *,
        envs_enabled: bool = True,
        env_tgt: LocalEnvironmentTarget | RemoteEnvironmentTarget | DockerEnvironmentTarget | None,
        remote_execution: bool,
        expected_env: str,
    ) -> None:
        global_options = create_subsystem(GlobalOptions, remote_execution=remote_execution)
        name = "name"
        env_subsystem = create_subsystem(
            EnvironmentsSubsystem,
            names={name: "addr"} if envs_enabled else {},
        )
        def mock_env_process(process: Process) -> ProcessResult:
            return Mock(
                stdout=b"DOCKER=true" if "Docker" in process.description else b"REMOTE=true"
            )
        result = run_rule_with_mocks(
            complete_environment_vars,
            rule_args=[
                SessionValues(
                    {CompleteEnvironmentVars: CompleteEnvironmentVars({"LOCAL": "true"})}
                ),
                EnvironmentTarget(name, env_tgt),
                global_options,
                env_subsystem,
            ],
            mock_gets=[
                MockGet(output_type=ProcessResult, input_types=(Process,), mock=mock_env_process)
            ],
        )
        assert dict(result) == {expected_env: "true"}
    assert_env_vars(env_tgt=None, remote_execution=False, expected_env="LOCAL")
    assert_env_vars(env_tgt=None, envs_enabled=False, remote_execution=True, expected_env="REMOTE")
    assert_env_vars(env_tgt=None, envs_enabled=True, remote_execution=True, expected_env="LOCAL")
    for re in (False, True):
        assert_env_vars(
            env_tgt=LocalEnvironmentTarget({}, Address("dir")),
            remote_execution=re,
            expected_env="LOCAL",
        )
    for re in (False, True):
        assert_env_vars(
            env_tgt=DockerEnvironmentTarget({DockerImageField.alias: "my_img"}, Address("dir")),
            remote_execution=re,
            expected_env="DOCKER",
        )
    for re in (False, True):
        assert_env_vars(
            env_tgt=RemoteEnvironmentTarget({}, Address("dir")),
            remote_execution=re,
            expected_env="REMOTE",
        )