Re: [Pyunit-interest] comments on PyUnit
Brought to you by:
purcell
From: Steve P. <ste...@ya...> - 2001-04-12 17:10:42
|
Fred L. Drake, Jr. wrote: > I notice that it still isn't calling TestCase.fail() in all the > fail<Something>() methods -- were we still agreed on that? I can make > that change is needed. I decided against that; the extra level of traceback output is unsightly. The failure exception is now parameterised, and the framework is not written such that it would be safe and/or desirable to override fail() in subclasses. > > The complete set of fail*() methods, together with their 'assert*' > > synonyms, is now: > > > > fail() > > failIf() > > Since Guido's suggested we document both naming famillies, we should > have a second name for this -- I suggest "assertNot()". I also decided against this; fail() does not have a common-sense 'assert' counterpart, and 'assertNot' is better served by 'assert_(not expr)' for those users who prefer 'assert*' to 'fail*'. A bit of relevant background: JUnit lives quite happily with the following: fail() assert(expr) assertEquals(a,b) assertSame(a,b) If I were starting PyUnit from scratch, I would provide only: fail() assert_(expr) assertEquals(a,b) assertRaises(exception,func,*args,**kwargs) Best wishes, -Steve -- Steve Purcell, Pythangelist Get testing at http://pyunit.sourceforge.net/ Any opinions expressed herein are my own and not necessarily those of Yahoo |