0

With the doctest module, there exists a nice tool to turn interactive examples in documentation into tests of python modules. This is fine for library-like code, but I am working on a command line tool, reading and writing small files according to the option provided with the command.

Is there something similar to turn usage examples of such a command line tool into tests?

martineau
  • 119,623
  • 25
  • 170
  • 301
Anaphory
  • 6,045
  • 4
  • 37
  • 68
  • Feels like a duplicate: http://stackoverflow.com/questions/3088556/testing-command-line-utilities . Obviously you should treat these as _acceptance_ or _integration_ tests, they are not alternative to unit tests, but their complement. – Łukasz Rogalski Oct 07 '16 at 12:22
  • That question looks like half what I want, I may have to build the other half myself by expanding doctest, because I really want to write a tutorial, and not a tutorial and some * tests that will start deviating from each other the moment they are complete. – Anaphory Oct 07 '16 at 13:15

0 Answers0