[Edu-sig] UnitTest?

Laura Creighton lac at openend.se
Sat Feb 26 19:25:20 CET 2011


In a message of Sat, 26 Feb 2011 10:28:58 MST, David MacQuigg writes:
>In my opinion, the unittest framework is way too cumbersome for an 
>introductory course.  Doctests are simple and self-explanatory.  
>Students should get in the habit of writing a doctest for every function 
>they write, even before the function itself is written.

I think this is a reason to use py.test or nose rather than unittest,
but not a reason to use doctest.  I'm very fond of Mark Pilgrim's Unit
testing chapter in Dive into Python
http://diveintopython.org/unit_testing/index.html  (2.x)
http://diveintopython3.org/unit-testing.html       (3.x)

which is easy to adapt to a less verbose testing framework.

Laura



More information about the Edu-sig mailing list