code: def test_should_raise_warning_if_backend_changes(*_):
      # The backend values returned by matplotlib.get_backend are different.
      # Warning should be raised to inform user of the backend switch.
      with pytest.warns(
          UserWarning, match="Backend changed to backend_2..."
      ):
          _set_mpl_backend()
  
file_path: nilearn/nilearn/plotting/tests/test_matplotlib_backend.py
imports: from unittest.mock import patch
  import warnings
  import pytest
  from nilearn.plotting import _set_mpl_backend
label_desc: Use image node_id 1 for calling a global function with example usage: test_should_raise_warning_if_backend_changes() without return types