<div dir="ltr"><br><br><div class="gmail_quote">On Sat, Sep 27, 2008 at 2:37 PM, Michael Foord <span dir="ltr"><<a href="mailto:fuzzyman@voidspace.org.uk">fuzzyman@voidspace.org.uk</a>></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>
> "Rob Kirkpatrick" <<a href="mailto:robert.d.kirkpatrick@gmail.com">robert.d.kirkpatrick@gmail.com</a>> writes:<br>
><br>
> > Is there a way of having a doctest pass if it has EITHER output A<br>
> > or output B?<br>
><br>
> What about this approach?<br>
><br>
><br>
>>>> output = get_output()<br>
>>>> output in (output_A, output_B)<br>
>>>><br>
> True<br>
><br>
><br>
</div>In my opinion this is one of the problems with the doctest approach.<br>
Should this fail you get a 'False != True' message that doesn'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> >>> i_dont_care = get_output()<br> >>> check_resource_is_present()<br> 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>