Re: [Pyunit-interest] comments on PyUnit
Brought to you by:
purcell
From: Fred L. D. Jr. <fd...@ac...> - 2001-04-11 18:22:12
|
Steve Purcell writes: > I propose the following: > > - Add 'failUnlessRaises()' to TestCase > - Add 'failIfEqual()' to TestCase > - Add 'failUnlessEqual()' to TestCase (and probably 'failIfEqual()' too) Was that second one "failIfNotEqual()"? I'd really rather only see one name for it. In particular, I'd like to see either "Unless" or "IfNot", but not both. > - Document the 'fail*' methods > - Keep the 'assert*' methods but don't mention them Agreed -- there's no reason to actually remove them, and good reason to keep them. > - Don't mention using the 'assert' statement > - Make all 'fail*' and 'assert*' methods delegate to 'fail()', as > suggested by Fred > - Keep AssertionError as the 'blessed failure exception', but > parameterise it at module level This is reasonable. An alternate approach may be to subclass it, but still only watch for AssertionError when running tests: class TestFailed(AssertionError): """Exception raised by TestCase.fail().""" > I think this can be safely done in time for this week's 2.1 release > (though that's not *my* call to make). This would need to be in almost immediately (can you get it done tonight?) so that enough people can test it from CVS before the release candidate is on Friday. > If this is acceptable, I can make appropriate changes. If you don't have time, I'll be glad to do this. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Digital Creations |