code: def patch_modules():
      
      old_call = subprocess.call
  
      def dummy_call(*args, **kwargs):
          with tempfile.TemporaryFile("wb+") as f:
              kwargs["stdout"] = f
              kwargs["stderr"] = f
              rv = subprocess.Popen(*args, **kwargs).wait()
              f.seek(0)
              click.echo(f.read().decode("utf-8", "replace").rstrip())
          return rv
  
      subprocess.call = dummy_call
  
      try:
          yield
      finally:
          subprocess.call = old_call
docs: Patch modules to work better with :meth:`ExampleRunner.invoke`.
  
      ``subprocess.call` output is redirected to ``click.echo`` so it
      shows up in the example output.