<div dir="ltr"><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Olemis Lang</b> <span dir="ltr"><<a href="mailto:olemis@gmail.com">olemis@gmail.com</a>></span><br>
Date: Mon, Jan 6, 2014 at 6:05 PM<br>Subject: Re: [TIP] Declarative style acceptance tests (was: Using doctest for functional tests / user stories)<br>To: Barry Warsaw <<a href="mailto:barry@python.org">barry@python.org</a>><br>
<br><br><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><div class="im">On Mon, Jan 6, 2014 at 5:10 PM, Barry Warsaw <span dir="ltr"><<a href="mailto:barry@python.org" target="_blank">barry@python.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="overflow:hidden">These days I write all my documentation using doctest/reST, but I try to stick<br>
to good paths and recommended usage. Doctests don't work as well for covering<br>
all code paths, </div></blockquote><div><br></div></div><div>+1</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="overflow:hidden">
and while I occasionally document tracebacks, I think testing<br>
the bad paths in your code tend to work better in unittests.<br>
<br> </div></blockquote></div><div>[...] </div></div><br>+1 ... these are the two weaknesses I'd emphasize the most regarding doctest style. </div><div class="gmail_extra"><br></div><div class="gmail_extra">In real case scenarios with conditional statements and exceptional paths I need to track , I tend to rely on :</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"> - (dutest) __tc__.assert* methods instead . </div><div class="gmail_extra"> - Design test scenario for individual execution paths i.e. no (or a few) branches </div>
<div class="gmail_extra"><br></div><div class="gmail_extra">p.s. otoh , something I really like about unittest is assertRaises as context manager , again , also available using (dutest) __tc__ .<div class="im"><br clear="all">
<br>-- <br>
Regards,<br><br>Olemis - @olemislc<br><br>Apache™ Bloodhound contributor<br><a href="http://issues.apache.org/bloodhound" target="_blank">http://issues.apache.org/bloodhound</a><br><a href="http://blood-hound.net" target="_blank">http://blood-hound.net</a><br>
<br>Blog ES: <a href="http://simelo-es.blogspot.com/" target="_blank">http://simelo-es.blogspot.com/</a><br>Blog EN: <a href="http://simelo-en.blogspot.com/" target="_blank">http://simelo-en.blogspot.com/</a><br><br>Featured article:<br>
<br><br>
</div></div></div>
</div><br>
</div>