code: def test_failing_ffmpeg(tmpdir, monkeypatch, anim):
      """
      Test that we correctly raise a CalledProcessError when ffmpeg fails.
  
      To do so, mock ffmpeg using a simple executable shell script that
      succeeds when called with no arguments (so that it gets registered by
      `isAvailable`), but fails otherwise, and add it to the $PATH.
      """
      with tmpdir.as_cwd():
          monkeypatch.setenv("PATH", ".:" + os.environ["PATH"])
          exe_path = Path(str(tmpdir), "ffmpeg")
          exe_path.write_bytes(b"#!/bin/sh\n[[ $@ -eq 0 ]]\n")
          os.chmod(exe_path, 0o755)
          with pytest.raises(subprocess.CalledProcessError):
              anim.save("test.mpeg")
  
imports: import os
  from pathlib import Path
  import platform
  import re
  import shutil
  import subprocess
  import sys
  import weakref
  import numpy
  import pytest
  import matplotlib
  from matplotlib import pyplot
  from matplotlib import animation
  from matplotlib.testing.decorators import check_figures_equal
label_desc: Use image node_id 13 for calling a global function with example usage: test_failing_ffmpeg(tmpdir, monkeypatch, anim) without return types