code: def test_open_in_browser_file(tmp_path, monkeypatch):
      opener = Mock()
      monkeypatch.setattr(webbrowser, "open", opener)
      file_path = tmp_path / "doc.html"
      doc = html_document.HTMLDocument("hello")
      doc.open_in_browser(file_name=str(file_path))
      assert file_path.read_text("utf-8") == "hello"
      opener.assert_called_once_with(f"file://{file_path}")
  
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 4 for calling a global function with example usage: test_open_in_browser_file(tmp_path, monkeypatch) without return types