<div dir="ltr"><br><br><div class="gmail_quote">On Sat, Sep 27, 2008 at 2:37 PM, Michael Foord <span dir="ltr">&lt;<a href="mailto:fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Pete Forman wrote:<br>
&gt; &quot;Rob Kirkpatrick&quot; &lt;<a href="mailto:robert.d.kirkpatrick@gmail.com">robert.d.kirkpatrick@gmail.com</a>&gt; writes:<br>
&gt;<br>
&gt; &nbsp;&gt; Is there a way of having a doctest pass if it has EITHER output A<br>
&gt; &nbsp;&gt; or output B?<br>
&gt;<br>
&gt; What about this approach?<br>
&gt;<br>
&gt;<br>
&gt;&gt;&gt;&gt; output = get_output()<br>
&gt;&gt;&gt;&gt; output in (output_A, output_B)<br>
&gt;&gt;&gt;&gt;<br>
&gt; True<br>
&gt;<br>
&gt;<br>
</div>In my opinion this is one of the problems with the doctest approach.<br>
Should this fail you get a &#39;False != True&#39; message that doesn&#39;t show you<br>
what the actual output was.</blockquote><div><br><br>But in the first place like Pete said, why the output differs ? why testing the output of the command ?<br>This is not a good test to do.<br><br>I would rather test what should be the final state of the ressource, not the output of the command <br>
that builds it. A bit like a smoke test:<br><br>&nbsp; &gt;&gt;&gt; i_dont_care = get_output()<br>&nbsp; &gt;&gt;&gt; check_resource_is_present()<br>&nbsp; True<br><br></div></div><br>-- <br>Tarek Ziadé | Association AfPy | <a href="http://www.afpy.org">www.afpy.org</a><br>
Blog FR | <a href="http://programmation-python.org">http://programmation-python.org</a><br>Blog EN | <a href="http://tarekziade.wordpress.com/">http://tarekziade.wordpress.com/</a><br>
</div>