unit testing

Kay Schluehr kay.schluehr at gmx.net
Fri Oct 5 12:09:36 CEST 2007


On 4 Okt., 22:49, Jeffrey Froman <jeff... at fro.man> wrote:
> Chris Mellon wrote:
> > Doctest is commonly given as the alternative to people who feel this
> > way. Personally, I find that anything worth testing is worth having a
> > test directory and independent unit tests for.
>
> I like keeping my tests separate as well, and doctest does allow this, using
> doctest.testfile(). That is, despite the name, doctests do not necessarily
> need to appear in docstrings :-)
>
> Jeffrey

And they are definitely no unit tests. Instread they are diffs on
lexical content of an executed session protocol of arbitrary size
( which might be customized using a mini language ). So they are
sensitive to all kinds of ambient changes being irrelevant for the
*functional unit* to be tested.

I wish all people good luck porting their doctests to Python 3.0.




More information about the Python-list mailing list