code: def patch_subprocess(monkeypatch, subprocess):
      """Automatically mock subprocess module."""
      monkeypatch.setattr(
          "hailtop.hailctl.dataproc.connect.subprocess", subprocess
      )
      monkeypatch.setattr(
          "hailtop.hailctl.dataproc.connect.get_chrome_path",
          Mock(return_value="chromium"),
      )
      yield
      monkeypatch.undo()
  
file_path: hail/hail/python/test/hailtop/hailctl/dataproc/test_connect.py
imports: from unittest.mock import Mock
  from typer.testing import CliRunner
  import pytest
  from hailtop.hailctl.dataproc import cli
label_desc: Use image node_id 2 for calling a global function with example usage: patch_subprocess(monkeypatch, subprocess) without return types