<div dir="ltr">Thanks for mentioning those two. On a brief read the differences seem to be:<div><br></div><div>- Cram runs test scripts located in separate files, and can patch them with the differences, which would make it great for testing documentation examples, and maybe a bit harder if you want to run some Python setup or mocking code around the code under test.</div>

<div><br></div><div>- ScriptTest returns the output etc from the command for the test to examine, whereas shelliketests and cram automatically diff it against expected output.</div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">
On 18 June 2013 00:36, Chris Wesseling <span dir="ltr">&lt;<a href="mailto:Chris.Wesseling@cwi.nl" target="_blank">Chris.Wesseling@cwi.nl</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="HOEnZb"><div class="h5">On 2013-06-17T11:12:58+0200, Pierre-Yves David wrote:<br>
&gt; On Mon, Jun 17, 2013 at 06:34:42AM +1000, Martin Pool wrote:<br>
&gt; &gt; I have just extracted the &#39;shell-like tests&#39; library from bzr&#39;s test<br>
&gt; &gt; library.  example:<br>
&gt; &gt;<br>
&gt; &gt;     def test_echo(self):<br>
&gt; &gt;         run_script(self, &quot;&quot;&quot;<br>
&gt; &gt;             $ echo hello world<br>
&gt; &gt;             hello world<br>
&gt; &gt;             &quot;&quot;&quot;)<br>
&gt; &gt;<br>
&gt; &gt; This library makes it easy to write integration tests for programs with a<br>
&gt; &gt; command-line interface: you just give the command and the expected output.<br>
&gt; &gt; The command can be run as an in-process Python call, to let you precisely<br>
&gt; &gt; control its environment through mocks etc. This style also makes it pretty<br>
&gt; &gt; easy for new contributors to add tests.<br>
&gt; &gt;<br>
&gt; &gt; <a href="https://github.com/sourcefrog/shellliketests" target="_blank">https://github.com/sourcefrog/shellliketests</a><br>
&gt;<br>
&gt; On similar topic, the Mercurial sell-like tests tools have been extracted as &quot;cram&quot;<br>
&gt;<br>
&gt;     <a href="https://bitheap.org/cram/" target="_blank">https://bitheap.org/cram/</a><br>
&gt;<br>
&gt; I never tested the bzr one so I have no idea how they compare to each other.<br>
<br>
</div></div>I&#39;ve been using Ian Bicking&#39;s ScriptTest library for that. And this<br>
weekend I learned that it&#39;s what the pip project is using too.<br>
<br>
It&#39;s on pypi.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Chris Wesseling<br>
Centrum Wiskunde &amp; Informatica (CWI)<br>
<a href="https://www.cwi.nl/people/ccw" target="_blank">https://www.cwi.nl/people/ccw</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Martin<br>
</div>