code: def test_run_check_called_process_error_mocked(
      capsys,
      mock_run,
      quiet,
      stdout="I am the messiah",
      stderr="I am not the messiah!",
  ):
      mock_run.return_value = subprocess.CompletedProcess(
          _common.INVALID_CMD,
          returncode=500,
          stdout=stdout,
          stderr=stderr,
      )
      with pytest.raises(execute.CalledProcessError, match=stderr):
          execute.run_check(
              _common.INVALID_CMD, capture_output=True, quiet=quiet
          )
  
      assert capsys.readouterr() == ("", "" if quiet else stderr)
  
file_path: graphviz/tests/backend/test_execute.py
imports: import errno
  import io
  import subprocess
  import pytest
  import graphviz
  from graphviz.backend import execute
  import _common
label_desc: Use image node_id 4 for calling a global function with example usage: test_run_check_called_process_error_mocked(capsys, mock_run, quiet, stdout, stderr) without return types