unit testing

Steven Bethard steven.bethard at gmail.com
Fri Oct 5 11:13:57 EDT 2007


byte8bits at gmail.com wrote:
> On Oct 5, 5:38 am, Craig Howard <craig.how... at earthlink.net> wrote:
>> Brad:
>>
>> If the program is more than 100 lines or is a critical system, I
>> write a unit test. I hate asking myself, "Did I break something?"
>> every time I decide to refactor a small section of code. For
>> instance, I wrote an alarm system in Python for a water treatment
>> plant. If the chlorine, pH, or turbidity are out of spec, an email
>> message is sent to the plant operator's pager. Because of the nature
>> of the alarm system, extensive field testing was out of the question.
>> Unit testing was the only way to ensure it worked without disrupting
>> the plant operation.
> 
> 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's been talk in the past about trying to bring some of the features 
of py.test to the unittest module.  However, I think there hasn't been 
anyone with enough free time to start tackling this problem.

STeVe



More information about the Python-list mailing list