def METHOD_NAME(
    self,
    cmd: Sequence[str],
    test_file: Path,
    *,
    env: EnvDict | None = None,
    cwd: str | None = None,
    timeout: int | None = None,
) -> ProcessResult:
    """Wrapper for subprocess.run that encapsulates logging.
    Parameters
    ----------
    cmd : sequence of str
        The command to run, split on whitespace into a sequence
        of strings
    test_file : Path
        User-friendly test file path to use in reported output
    env : dict[str, str] or None, optional, default: None
        Environment variables to apply when running the command
    cwd: str or None, optional, default: None
        A current working directory to pass to stdlib ``run``.
    """
    env = env or {}
    envstr = (
        " ".join(f"{k}={_quote(v)}" for k, v in env.items())
        + min(len(env), 1) * " "
    )
    invocation = envstr + " ".join(cmd)
    if self.dry_run:
        return ProcessResult(invocation, test_file, skipped=True)
    full_env = dict(os.environ)
    full_env.update(env)
    start = datetime.now()
    try:
        proc = stdlib_run(
            cmd,
            cwd=cwd,
            env=full_env,
            stdout=PIPE,
            stderr=STDOUT,
            text=True,
            timeout=timeout,
        )
    except TimeoutExpired:
        return ProcessResult(invocation, test_file, timeout=True)
    end = datetime.now()
    return ProcessResult(
        invocation,
        test_file,
        start=start,
        end=end,
        returncode=proc.returncode,
        output=proc.stdout,
    )