code: def test_3d_warning(renderer_pyvistaqt, monkeypatch):
      """Test that warnings are emitted for old Mesa."""
      fig = renderer_pyvistaqt.create_3d_figure((800, 600))
      _is_mesa = renderer_pyvistaqt.backend._is_mesa
      plotter = fig.plotter
      good = "OpenGL renderer string: OpenGL 3.3 (Core Profile) Mesa 20.0.8 via llvmpipe (LLVM 10.0.0, 256 bits)\n"  # noqa
      bad = "OpenGL renderer string: OpenGL 3.3 (Core Profile) Mesa 18.3.4 via llvmpipe (LLVM 7.0, 256 bits)\n"  # noqa
      monkeypatch.setattr(
          platform, "system", lambda: "Linux"
      )  # avoid short-circuit
      monkeypatch.setattr(
          plotter.ren_win, "ReportCapabilities", lambda: good
      )
      assert _is_mesa(plotter)
      monkeypatch.setattr(
          plotter.ren_win, "ReportCapabilities", lambda: bad
      )
      with pytest.warns(RuntimeWarning, match=r"18\.3\.4 is too old"):
          assert _is_mesa(plotter)
      non = "OpenGL 4.1 Metal - 76.3 via Apple M1 Pro\n"
      monkeypatch.setattr(
          plotter.ren_win, "ReportCapabilities", lambda: non
      )
      assert not _is_mesa(plotter)
  
file_path: mne-python/mne/viz/backends/tests/test_renderer.py
imports: import os
  import platform
  import sys
  import numpy
  import pytest
  from mne.utils import run_subprocess
  from mne.viz import Figure3D, get_3d_backend, set_3d_backend
  from mne.viz.backends._utils import ALLOWED_QUIVER_MODES
  from mne.viz.backends.renderer import _get_renderer
  from mne.viz.backends.tests._utils import skips_if_not_pyvistaqt
label_desc: Use image node_id 7 for calling a global function with example usage: test_3d_warning(renderer_pyvistaqt, monkeypatch) without return types