code: def test_tmpconfigdir_warning(tmp_path):
      """Test that a warning is emitted if a temporary configdir must be used."""
      mode = os.stat(tmp_path).st_mode
      try:
          os.chmod(tmp_path, 0)
          proc = subprocess.run(
              [sys.executable, "-c", "import matplotlib"],
              env={**os.environ, "MPLCONFIGDIR": str(tmp_path)},
              stderr=subprocess.PIPE,
              text=True,
              check=True,
          )
          assert "set the MPLCONFIGDIR" in proc.stderr
      finally:
          os.chmod(tmp_path, mode)
  
file_path: matplotlib/lib/matplotlib/tests/test_matplotlib.py
imports: import os
  import subprocess
  import sys
  import pytest
  import matplotlib
label_desc: Use image node_id 2 for calling a global function with example usage: test_tmpconfigdir_warning(tmp_path) without return types