Re: [Pyunit-interest] comments on PyUnit
Brought to you by:
purcell
From: Chuck E. <ec...@mi...> - 2001-04-11 18:54:07
|
At 02:23 PM 4/11/2001 -0500, Guido van Rossum wrote: >The problem is that many test suites (e.g. the Zope tests for >PageTemplates :-) use assert statements instead of calls to fail*() / >assert*() methods. So in the future do I have to switch from: assert sess.hasFragments(self.userPages()) to: if sess.hasFragments(self.userPages()): self.fail() ? Here's a proposal that I know will get shot down. :-) How about a "test" statement? test sess.hasFragments(self.userPages()) - Works like assert - Raises a TestError - No flags to turn it off One "soft" advantage is that it makes the concept of regression testing much more prominent. People will ask, "What is this 'test' statement I see in the language?" Then they will get a big lecture on unit testing. (Aside: Glad to hear that optimizations and assertions will be separated in the future. Thanks. My favorite feature of Python over Objective-C is that Python gets better over time. (Objective-C stagnated.)) -Chuck |