code: def test_delete_downloads(tmpdir):
      # change the path so we don't delete the examples cache
      old_path = examples.downloads.USER_DATA_PATH
      try:
          examples.downloads.USER_DATA_PATH = str(
              tmpdir.mkdir("tmpdir")
          )
          assert os.path.isdir(examples.downloads.USER_DATA_PATH)
          tmp_file = os.path.join(
              examples.downloads.USER_DATA_PATH, "tmp.txt"
          )
          with open(tmp_file, "w") as fid:
              fid.write("test")
          examples.delete_downloads()
          assert os.path.isdir(examples.downloads.USER_DATA_PATH)
          assert not os.path.isfile(tmp_file)
      finally:
          examples.downloads.USER_DATA_PATH = old_path
  
file_path: pyvista/tests/examples/test_downloads.py
imports: import os
  from pathlib import PureWindowsPath
  import pytest
  import pyvista
  from pyvista import examples
  from pyvista.examples import downloads
label_desc: Use image node_id 1 for calling a global function with example usage: test_delete_downloads(tmpdir) without return types