[TIP] Functional Test Runner for Command Line Tools?
kumar.mcmillan at gmail.com
Tue Apr 14 21:22:21 PDT 2009
On Tue, Apr 14, 2009 at 12:27 AM, Noah Gift <noah.gift at gmail.com> wrote:
>>> > In looking at http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy
>>> > I don't see something that automates writing functional tests for
>>> > command line tools. Hopefully, I am wrong, but I am looking for
>>> > something that will fully exercise a command line tool easily. How is
>>> > everyone else testing their command line tools?
I generally just call my_command.main() or call the command with
subprocess and use TempIO() to set up an environment for script
artifacts -- http://farmdev.com/projects/fixture/using-temp-io.html
... but there is also ScriptTest -- http://pythonpaste.org/scripttest/
-- which I have used before too. It sets up everything you need to
test scripts in a subprocess. It has some conventions that it wants
you to follow but once you get used to them it's nifty.
More information about the testing-in-python