code: def test_tesseract_not_installed(caplog):
      with patch("ocrmypdf.subprocess.run") as not_found:
          not_found.side_effect = FileNotFoundError("tesseract")
          with pytest.raises(
              MissingDependencyError, match="Could not find program"
          ):
              vd.check_options(*make_opts_pm())
              assert (
                  "'tesseract' could not be executed" in caplog.text
              ), "Error message not printed"
              assert (
                  "install" in caplog.text
              ), "Install advice not printed"
          not_found.assert_called()
  
imports: from __future__ import annotations
  import logging
  import os
  from unittest.mock import patch
  import pikepdf
  import pytest
  from ocrmypdf import _validation
  from ocrmypdf._concurrent import NullProgressBar, SerialExecutor
  from ocrmypdf._exec.tesseract import TesseractVersion
  from ocrmypdf._plugin_manager import get_plugin_manager
  from ocrmypdf.api import create_options
  from ocrmypdf.cli import get_parser
  from ocrmypdf.exceptions import BadArgsError, MissingDependencyError
  from ocrmypdf.pdfinfo import PdfInfo
  from .conftest import run_ocrmypdf_api
label_desc: Use image node_id 4 for calling a global function with example usage: test_tesseract_not_installed(caplog) without return types