[TIP] Fwd: Declarative style acceptance tests (was: Using doctest for functional tests / user stories)

Olemis Lang olemis at gmail.com
Mon Jan 6 15:07:35 PST 2014


---------- Forwarded message ----------
From: Olemis Lang <olemis at gmail.com>
Date: Mon, Jan 6, 2014 at 6:05 PM
Subject: Re: [TIP] Declarative style acceptance tests (was: Using doctest
for functional tests / user stories)
To: Barry Warsaw <barry at python.org>



On Mon, Jan 6, 2014 at 5:10 PM, Barry Warsaw <barry at python.org> wrote:

> These days I write all my documentation using doctest/reST, but I try to
> stick
> to good paths and recommended usage.  Doctests don't work as well for
> covering
> all code paths,
>

+1


> and while I occasionally document tracebacks, I think testing
> the bad paths in your code tend to work better in unittests.
>
>
>
[...]

+1 ... these are the two weaknesses I'd emphasize the most regarding
doctest style.

In real case scenarios with conditional statements and exceptional paths I
need to track , I tend to rely on :

  - (dutest) __tc__.assert* methods instead .
  - Design test scenario for individual execution paths i.e. no (or a few)
branches

p.s. otoh , something I really like about unittest is assertRaises as
context manager , again , also available using (dutest) __tc__ .


-- 
Regards,

Olemis - @olemislc

Apache™ Bloodhound contributor
http://issues.apache.org/bloodhound
http://blood-hound.net

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.idyll.org/pipermail/testing-in-python/attachments/20140106/cef1a6da/attachment-0001.htm>


More information about the testing-in-python mailing list