code: def test_open_docs():
      """Test doc launching."""
      old_tab = webbrowser.open_new_tab
      try:
          # monkey patch temporarily to prevent tabs from actually spawning
          webbrowser.open_new_tab = myfun
          open_docs()
          open_docs("tutorials", "dev")
          open_docs("examples", "stable")
          pytest.raises(ValueError, open_docs, "foo")
          pytest.raises(ValueError, open_docs, "api", "foo")
      finally:
          webbrowser.open_new_tab = old_tab
  
imports: import webbrowser
  import pytest
  from mne import grade_to_tris, open_docs
  from mne.utils import catch_logging, copy_doc, copy_function_doc_to_method_doc, deprecated, deprecated_alias, legacy, linkcode_resolve
label_desc: Use image node_id 9 for calling a global function with example usage: test_open_docs() without return types