Re: [Pyunit-interest] How to test a condition
Brought to you by:
purcell
From: Steve P. <ste...@ya...> - 2001-09-05 06:29:49
|
Jeremy Hylton wrote: > >>>>> "SP" == Steve Purcell <ste...@ya...> writes: > SP> So the best idea is probably to favour the TestCase methods such > SP> as 'failUnless()' over the 'assert' statement. > > And I'd still like to see a version of these methods that are in > positive form. assert() is much clearer than failUnless(). Since > assert is not allowed (it's a keyword), I'd prefer something like > verify(). Actually, there has been an 'assert_()' since the first version, and the set of such 'positive form' methods in TestCase is currently: assert_() assertEqual() assertNotEqual() assertRaises() I think in terms of what might constitute a test failure, so I like to use the 'fail()' methods. YMMV. -Steve -- Steve Purcell, Pythangelist Get testing at http://pyunit.sourceforge.net/ GPG fingerprint: EB79 2AB1 D494 16F9 8C3B DAC6 5341 30CE BCCA EBEA |