learning unit testing in python

2008-06-23 Thread Alex
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
--
http://mail.python.org/mailman/listinfo/python-list


Re: learning unit testing in python

2008-06-23 Thread Josh English
A good starting point is Mark Pilgrim's Dive Into Python.

http://www.diveintopython.org/unit_testing/index.html

Josh
On Jun 23, 7:55 am, Alex [EMAIL PROTECTED] 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

--
http://mail.python.org/mailman/listinfo/python-list


Re: learning unit testing in python

2008-06-23 Thread Josip
 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. 


--
http://mail.python.org/mailman/listinfo/python-list


Re: learning unit testing in python

2008-06-23 Thread Alex
On 23 Giu, 21:26, Josip [EMAIL PROTECTED] 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..
--
http://mail.python.org/mailman/listinfo/python-list


Re: learning unit testing in python

2008-06-23 Thread BJörn Lindqvist
On Mon, Jun 23, 2008 at 2:55 PM, Alex [EMAIL PROTECTED] 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

The best framework is nose at
http://www.somethingaboutorange.com/mrl/projects/nose/. If you aren't
already familiar with unit testing then http://diveintopython.org has
a good tutorial about it at
http://diveintopython.org/unit_testing/index.html.

-- 
mvh Björn
--
http://mail.python.org/mailman/listinfo/python-list