code: def test_error(capsys: Capture) -> None:
      from bokeh.command.subcommands.info import Info
  
      old_invoke = Info.invoke
  
      def err(x, y):
          raise RuntimeError("foo")
  
      Info.invoke = err
      with pytest.raises(SystemExit):
          main(["bokeh", "info"])
      out, err = capsys.readouterr()
      assert err == "ERROR: foo\n"
      Info.invoke = old_invoke
  
file_path: bokeh/tests/unit/bokeh/command/test_bootstrap.py
imports: from __future__ import annotations
  import pytest
  from bokeh import __version__
  from tests.support.util.types import Capture
  from bokeh.command.bootstrap import main
label_desc: Use image node_id 5 for calling a global function with example usage: test_error(capsys) without return types