def METHOD_NAME(mock_sub, streaming_process, sleep_zero, capsys):
    """CalledProcessError is raised with check=True and non-zero return value."""
    stderr_output = "stderr output\nline 2"
    streaming_process.stderr.read.return_value = stderr_output
    with pytest.raises(subprocess.CalledProcessError) as exc:
        with mock_sub.tools.input.wait_bar():
            mock_sub.run(
                ["hello", "world"],
                check=True,
                stderr=subprocess.PIPE,
            )
    # fmt: off
    expected_output = (
        "output line 1\n"
        "\n"
        "output line 3\n"
        "\n"
    )
    # fmt: on
    assert capsys.readouterr().out == expected_output
    assert exc.value.returncode == -3
    assert exc.value.cmd == ["hello", "world"]
    assert exc.value.stderr == stderr_output