unit testing

Roy Smith roy at panix.com
Fri Oct 5 11:48:18 EDT 2007


byte8bits at gmail.com wrote:
> Thanks to all for the opinions. Just to clarify, I have nothing
> against testing. I like doing it. I catch a lot of bugs! I dislike the
> formality of the unittest module. It's unyielding. It makes testing
> difficult unless your code is written with testing in mind from the
> start.

There is some advantage in forcing you to write code with testing in mind.  
It often works out that the same things which make code easy to test (clean 
interfaces, little cross-class dependency, etc), also make the code easy to 
maintain and modify later.

Compared to some other testing frameworks I've used, unittest is pretty 
lightweight.  That's not to say that for small projects, even the small 
amount of baggage it brings with it may feel heavy.



More information about the Python-list mailing list