[TIP] Getting started writing DocTests for Web applications

Olemis Lang olemis at gmail.com
Mon Jan 19 05:41:38 PST 2009


On Mon, Jan 19, 2009 at 3:44 AM, Fran Boon <flavour at partyvibe.com> wrote:
> Olemis Lang wrote:
>> On Fri, Jan 16, 2009 at 2:49 AM, Fran Boon <flavour at partyvibe.com> wrote:
>>> I have started a project to rewrite Sahana in Python.
>>> We have ambitious plans to do quality testing:
>>> https://trac.sahanapy.org/wiki/DeveloperGuidelinesTesting
>>> I'd like to start with doc tests as these make for inline docs for
>>> developers & can build automatic API docs using epydoc.
>>> Once there are a couple of examples to copy, this will make it easier to
>>> incorporate throughout.
>> Use doctest or dutest [1]_ loaders and specify an HTML-aware output
>> checker (e.g. lxml.doctestcompare.LHTMLOutputChecker [3]_, [4]_ ...)
>> Perhaps there are different options out there ... Pls feel free to
>> send us (the list ;) feedback about your research ...
>
> Thanks for the pointer to your promising-looking program :)

:) ... however it is particularly useful to write doctests and load
them like if you were using unittest ... with some beneficial
side-effects, like storing the evaluation of a single interactive
example in a single TestResult instance, and a few more ... ;)

> - I've still had trouble getting started though ;)
>

I'll be around ... ;)

>
> Inspired by this post:
> http://agiletesting.blogspot.com/2006/04/in-process-web-app-testing-with-twill.html
>

This is great ... I'll try to write a simple test like the one
mentionned in this article, but using dutest ... I'll let you know
about the results once I run a test suite so as to tell you about the
details ... hopefully soon ;)

>
> I'll report back when I've started to make real progress...
>

:)

-- 
Regards,

Olemis.

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



More information about the testing-in-python mailing list