code: def test_reset_only_failed(testdir):
      """Test usage of the `reset_only_failed` flag."""
      filename = make_cached_images(testdir.tmpdir)
      filename_original = make_cached_images(
          testdir.tmpdir, name="original.png"
      )
      assert filecmp.cmp(filename, filename_original, shallow=False)
  
      testdir.makepyfile(
          """
          import pyvista as pv
          pv.OFF_SCREEN = True
          def test_imcache(verify_image_cache):
              sphere = pv.Box()
              plotter = pv.Plotter()
              plotter.add_mesh(sphere, color="blue")
              plotter.show()
          """
      )
  
      result = testdir.runpytest("--reset_only_failed")
      result.stdout.fnmatch_lines("*[Pp]assed*")
      result.stdout.fnmatch_lines(
          "*This image will be reset in the cache."
      )
      # file was overwritten
      assert not filecmp.cmp(filename, filename_original, shallow=False)
  
file_path: pytest-pyvista/tests/test_pyvista.py
imports: import filecmp
  import os
  import pyvista
label_desc: Use image node_id 14 for calling a global function with example usage: test_reset_only_failed(testdir) without return types