[TIP] shell-like tests
Pierre-Yves David
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.
>
> https://github.com/sourcefrog/shellliketests
On similar topic, the Mercurial sell-like tests tools have been extracted as "cram"
https://bitheap.org/cram/
I never tested the bzr one so I have no idea how they compare to each other.
--
Pierre-Yves David
http://www.logilab.fr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20130617/b81a04b6/attachment.pgp>
More information about the testing-in-python
mailing list