code: def test_single_frame(include_gallery_comment, tmpdir):
      canvas = TestingCanvas()
      block_vars = _create_fake_block_vars(canvas)
      gallery_conf = _create_fake_gallery_conf(str(tmpdir))
      script = (
          "\n# vispy: gallery 30\n" if include_gallery_comment else ""
      )
      with tmpdir.as_cwd():
          with open("example.py", "w") as example_file:
              example_file.write(script)
          scraper = VisPyGalleryScraper()
          rst = scraper(None, block_vars, gallery_conf)
          if include_gallery_comment:
              assert "0.png" in rst
              assert os.path.isfile("0.png")
          else:
              assert "0.png" not in rst
              assert not os.path.isfile("0.png")
          assert not os.path.isfile("1.png")
  
file_path: vispy/vispy/util/tests/test_gallery_scraper.py
imports: import os
  from vispy.testing import TestingCanvas, requires_application
  import pytest
  from ..gallery_scraper import VisPyGalleryScraper
label_desc: Use image node_id 3 for calling a global function with example usage: test_single_frame(include_gallery_comment, tmpdir) without return types