[Chandler-dev] Script-recording/playback as test framework

Grant Baillie grant at osafoundation.org
Tue Dec 26 17:12:38 PST 2006


On 26 Dec, 2006, at 17:01, Mikeal Rogers wrote:

>
> First, I want to get rid of the previous pass/fail approach and  
> just use asserts. It's fairly easy to trap asserts and it has the  
> advantage of being easy to program, easy to catch in the debugger,  
> and we can give python tracebacks on each test failure.
>

Personally, I'd vote against both asserts (which don't fire if you're  
running optimized, as we'd want for the performance tests) and the  
previous pass/fail approach (which is baroque and error-prone).  
Instead, why not have tests inherit from unittest.TestCase, since:

1) That has a pretty expressive API for validating state  
(TestCase.failUnless, TestCase.failUnlessEqual, etc)
2) Tests that depend on setting up shared data can use inheritance,  
usually in conjunction with setUp() methods.
3) Less wheel reinvention, less having developers have to learn new  
APIs.

?
--Grant




More information about the chandler-dev mailing list