code: def test_open_in_browser_timeout(monkeypatch):
      opener = Get(delay=1.0)
      monkeypatch.setattr(webbrowser, "open", opener)
      monkeypatch.setattr(
          html_document, "BROWSER_TIMEOUT_SECONDS", 0.01
      )
      doc = html_document.HTMLDocument("hello")
      with pytest.raises(RuntimeError, match="Failed to open"):
          doc.open_in_browser()
  
file_path: nilearn/nilearn/plotting/tests/test_html_document.py
imports: import time
  import webbrowser
  from unittest.mock import Mock
  import pytest
  import requests
  from numpy.testing import assert_no_warnings
  from nilearn.plotting import html_document
label_desc: Use image node_id 2 for calling a global function with example usage: test_open_in_browser_timeout(monkeypatch) without return types