code: def test_image_too_large_pdf(monkeypatch, resources, outdir):
      def dummy_run(args, *, env=None, **kwargs):
          raise subprocess.CalledProcessError(
              1, "tesseract", output=b"Image too large"
          )
  
      monkeypatch.setattr(tesseract, "run", dummy_run)
      tesseract.generate_pdf(
          input_file=resources / "crom.png",
          output_pdf=outdir / "pdf.pdf",
          output_text=outdir / "txt.txt",
          languages=["eng"],
          engine_mode=None,
          tessconfig=[],
          timeout=180.0,
          pagesegmode=None,
          thresholding=0,
          user_words=None,
          user_patterns=None,
      )
      assert Path(outdir / "txt.txt").read_text() == "[skipped page]"
      if os.name != "nt":  # different semantics
          assert Path(outdir / "pdf.pdf").stat().st_size == 0
  
file_path: OCRmyPDF/tests/test_tesseract.py
imports: from __future__ import annotations
  import logging
  import os
  import subprocess
  from os import fspath
  from pathlib import Path
  import pytest
  from ocrmypdf import pdfinfo
  from ocrmypdf._exec import tesseract
  from ocrmypdf.exceptions import MissingDependencyError
  from .conftest import check_ocrmypdf
label_desc: Use image node_id 5 for calling a global function with example usage: test_image_too_large_pdf(monkeypatch, resources, outdir) without return types