def METHOD_NAME(
    mock_sub,
    streaming_process,
    sub_stream_kw,
    sleep_zero,
    capsys,
):
    """When stderr is redirected, it should be included in the result."""
    stderr_output = "stderr output\nline 2"
    streaming_process.stderr.read.return_value = stderr_output
    with mock_sub.tools.input.wait_bar():
        run_result = mock_sub.run(
            ["hello", "world"],
            stderr=subprocess.PIPE,
        )
    sub_stream_kw.pop("stderr")
    mock_sub._subprocess.Popen.assert_called_with(
        ["hello", "world"],
        stderr=subprocess.PIPE,
        **sub_stream_kw,
    )
    # fmt: off
    expected_output = (
        "output line 1\n"
        "\n"
        "output line 3\n"
        "\n"
    )
    # fmt: on
    assert capsys.readouterr().out == expected_output
    assert run_result.stderr == stderr_output