code: def test_malformed_docinfo(caplog, resources, outdir):
      generate_pdfa_ps(outdir / "pdfa.ps")
  
      with pikepdf.open(resources / "trivial.pdf") as pdf:
          pdf.trailer.Info = pikepdf.Stream(pdf, b"<xml></xml>")
          pdf.save(
              outdir / "layers.rendered.pdf", fix_metadata_version=False
          )
  
      _, options, _ = get_parser_options_plugins(
          args=[
              "-j",
              "1",
              "--output-type",
              "pdfa-2",
              "a.pdf",
              "b.pdf",
          ]
      )
      pdfinfo = PdfInfo(outdir / "layers.rendered.pdf")
      context = PdfContext(
          options,
          outdir,
          outdir / "layers.rendered.pdf",
          pdfinfo,
          get_plugin_manager([]),
      )
  
      convert_to_pdfa(
          str(outdir / "layers.rendered.pdf"),
          str(outdir / "pdfa.ps"),
          context,
      )
  
      print(caplog.records)
      assert any(
          "malformed DocumentInfo block" in record.message
          for record in caplog.records
      )
  
imports: from __future__ import annotations
  import datetime
  import warnings
  from datetime import timezone
  from shutil import copyfile
  import pikepdf
  import pytest
  from packaging.version import Version
  from pikepdf.models.metadata import decode_pdf_date
  from ocrmypdf._exec import ghostscript
  from ocrmypdf._jobcontext import PdfContext
  from ocrmypdf._metadata import metadata_fixup
  from ocrmypdf._pipeline import convert_to_pdfa
  from ocrmypdf._plugin_manager import get_parser_options_plugins, get_plugin_manager
  from ocrmypdf.exceptions import ExitCode
  from ocrmypdf.pdfa import file_claims_pdfa, generate_pdfa_ps
  from ocrmypdf.pdfinfo import PdfInfo
  from .conftest import check_ocrmypdf, run_ocrmypdf, run_ocrmypdf_api
label_desc: Use image node_id 13 for calling a global function with example usage: test_malformed_docinfo(caplog, resources, outdir) without return types