code: def test_stdout(ocrmypdf_exec, resources, outpdf):
      if "COV_CORE_DATAFILE" in os.environ:
          pytest.skip("Coverage uses stdout")
  
      input_file = str(resources / "francais.pdf")
      output_file = str(outpdf)
  
      # Runs: ocrmypdf francais.pdf - > test_stdout.pdf
      with open(output_file, "wb") as output_stream:
          p_args = ocrmypdf_exec + [
              input_file,
              "-",
              "--plugin",
              "tests/plugins/tesseract_noop.py",
          ]
          run(
              p_args,
              stdout=output_stream,
              stderr=PIPE,
              stdin=DEVNULL,
              check=True,
          )
  
      assert check_pdf(output_file)
  
file_path: OCRmyPDF/tests/test_stdio.py
imports: from __future__ import annotations
  import os
  from subprocess import DEVNULL, PIPE, run
  import pytest
  from ocrmypdf.helpers import check_pdf
  from .conftest import run_ocrmypdf
label_desc: Use image node_id 2 for calling a global function with example usage: test_stdout(ocrmypdf_exec, resources, outpdf) without return types