code: def test_failing_process():
      class TestProtocol(GeneratorMixIn, NoCapture):
          def __init__(self) -> None:
              GeneratorMixIn.__init__(self)
              NoCapture.__init__(self)
  
      try:
          for _ in run_command(
              py2cmd("exit(1)"), protocol=TestProtocol, stdin=None
          ):
              pass
          assert_equal(1, 2)
      except CommandError:
          return
      assert_equal(2, 3)
  
imports: from __future__ import annotations
  import sys
  from queue import Queue
  from typing import Any, Optional
  from datalad.runner.coreprotocols import NoCapture, StdOutErrCapture
  from datalad.runner.nonasyncrunner import _ResultGenerator, run_command
  from datalad.runner.protocol import GeneratorMixIn
  from datalad.tests.utils_pytest import assert_equal, assert_raises
  from ..exception import CommandError
  from ..runner import WitlessRunner
  from .utils import py2cmd
label_desc: Use image node_id 5 for calling a global function with example usage: test_failing_process() without return types