code: def test_open_view_warning():
      # opening many views (without deleting the SurfaceView objects)
      # should raise a warning about memory usage
      pytest.warns(UserWarning, _open_views)
      assert_no_warnings(_open_one_view)
      html_document.set_max_img_views_before_warning(15)
      assert_no_warnings(_open_views)
      html_document.set_max_img_views_before_warning(-1)
      assert_no_warnings(_open_views)
      html_document.set_max_img_views_before_warning(None)
      assert_no_warnings(_open_views)
      html_document.set_max_img_views_before_warning(6)
      pytest.warns(UserWarning, _open_views)
  
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 7 for calling a global function with example usage: test_open_view_warning() without return types