learning unit testing in python

Alex metallourlante at gmail.com
Mon Jun 23 23:55:17 CEST 2008


On 23 Giu, 21:26, "Josip" <i... at i.i> wrote:
> > Hi all.
>
> > I'd like learn some basic unit testing with python.
> > I red some articles about different testing framework like unittest or
> > nose, but I'm a bit confused: what is the best choice? I'm not a
> > professional developer (I'm a SEO) but I belive that unit testing is a
> > good and pragmatic way to produce working software, so I'd like to
> > find something really simple ad straightforward because I don't have
> > to manage big programming projects.
>
> > Thanks in advance,
>
> > Alex
>
> Have you checked out doctest?http://docs.python.org/lib/module-doctest.html
> It's the best way to add few tests to function or class, you just add
> them to docstring.
> Unit tests are somewhat demanding as they usualy require creating another
> file just for storing them, but are ofcourse more powerful as well. For
> example,
> unittest module alows you to execute a section of code before or after each
> test
> to initialize values and clean up.
>
> Nose module has few extra features, but it can also run test writen for
> unittest,
> so it's easy to switch if you find standard library module lacking for your
> purpose.

Tanks a lot. I'll the resources you suggest..



More information about the Python-list mailing list