code: def patch_tesseract_run():
      with patch("ocrmypdf._exec.tesseract.run") as mock:
          mock.side_effect = bad_utf8
          yield
          mock.assert_called()
  
file_path: OCRmyPDF/tests/plugins/tesseract_badutf8.py
imports: from __future__ import annotations
  from contextlib import contextmanager
  from subprocess import CalledProcessError
  from unittest.mock import patch
  from ocrmypdf import hookimpl
  from ocrmypdf.builtin_plugins.tesseract_ocr import TesseractOcrEngine
label_desc: Use image node_id 2 for calling a global function with example usage: patch_tesseract_run() without return types