Re: [Pyunit-interest] Assert that an Exception is NOT raised.
Brought to you by:
purcell
From: Timothy G. <tj...@cr...> - 2002-12-11 08:40:03
|
Dang, I write my tests, then start writing code. I use the ratio of Error to Failure to know how well I'm doing in my quest to get things right. I mostly ignore the errors until I get the Failures taken care of then move on to the next Failure. In fact, I usually stub out methods and functions in my implementation with a raise NotImplementedError before I actually go back and right my code. That way I don't forget anything and I get a nice skeleton to hang my code on. On Tue, 2002-12-10 at 22:13, Fred L. Drake, Jr. wrote: >=20 > Timothy Grant writes: > > I'm pretty new to PyUnit, one of the things I think is neat is that > > there's a difference between test Failures and Errors. The problem is,= I > > want to assert that an Exception is NOT raised, but the test fails wit= h > > an Error because an Exception is raised. > >=20 > > Is there something like assertDoesNotRaise(ExceptionClass)? >=20 > I'm afraid I've never found the distinction very useful in practice. > Whether something is reported as a failure or an error, I need to fix > a bug somewhere, and that's really the issue. >=20 >=20 > -Fred >=20 > --=20 > Fred L. Drake, Jr. <fdrake at acm.org> > PythonLabs at Zope Corporation >=20 --=20 Stand Fast, tjg. Timothy Grant www.craigelachie.org |