[TIP] shell-like tests
pierre-yves.david at logilab.fr
Mon Jun 17 02:12:58 PDT 2013
On Mon, Jun 17, 2013 at 06:34:42AM +1000, Martin Pool wrote:
> I have just extracted the 'shell-like tests' library from bzr's test
> library. example:
> def test_echo(self):
> run_script(self, """
> $ echo hello world
> hello world
> This library makes it easy to write integration tests for programs with a
> command-line interface: you just give the command and the expected output.
> The command can be run as an in-process Python call, to let you precisely
> control its environment through mocks etc. This style also makes it pretty
> easy for new contributors to add tests.
On similar topic, the Mercurial sell-like tests tools have been extracted as "cram"
I never tested the bzr one so I have no idea how they compare to each other.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the testing-in-python