Re: [Pyunit-interest] comments on PyUnit
Brought to you by:
purcell
From: Guido v. R. <gu...@di...> - 2001-04-11 19:14:53
|
> >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. :-) No, you would write self.verifyTrue(sess.hasFragments(self.userPages())) > 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. Sorry, I don't see any reason why we should change the language for this, despite your pitch. :-) > (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.)) It's a dead language. --Guido van Rossum (home page: http://www.python.org/~guido/) |