title: Is there a way to use doctest and sphinx to test and document command line applications?
body: <p>I have a Python module for which I'm writing a tutorial using Sphinx including doctests. </p>
  
  <p>This module comes with a few helper programs. </p>
  
  <p>I would like to include those helper programs in the documentation <strong>and</strong> have doctest check that the standard output is in sync between the current program version and the documentation. </p>
  
  <p>I suppose I can use the sh module, or popen to check the standard output of a given program but I prefer that those tricks do not show up into the docs, or else non-programmers users will be certainly lost. </p>
  
  <p>Is there a way to achieve that?</p>