code: def test_scraper_raise(tmpdir):
      pytest.importorskip("sphinx_gallery")
      pv.close_all()
      plotter = pv.Plotter(off_screen=True)
      scraper = Scraper()
      src_dir = str(tmpdir)
      out_dir = op.join(str(tmpdir), "_build", "html")
      img_fname = op.join(
          src_dir, "auto_examples", "images", "sg_img.png"
      )
      gallery_conf = {"src_dir": src_dir, "builder_name": "html"}
      target_file = op.join(src_dir, "auto_examples", "sg.py")
      block = None
      block_vars = dict(
          image_path_iterator=(img for img in [img_fname]),
          example_globals=dict(a=1),
          target_file=target_file,
      )
      os.makedirs(op.dirname(img_fname))
      assert not os.path.isfile(img_fname)
      os.makedirs(out_dir)
  
      with pytest.raises(
          RuntimeError, match="pyvista.BUILDING_GALLERY"
      ):
          scraper(block, block_vars, gallery_conf)
  
      plotter.close()
  
file_path: pyvista/tests/plotting/test_scraper.py
imports: import os
  import os.path
  from matplotlib.pyplot import imread
  import pytest
  import pyvista
  from pyvista.plotting.utilities.sphinx_gallery import DynamicScraper, Scraper
label_desc: Use image node_id 3 for calling a global function with example usage: test_scraper_raise(tmpdir) without return types