Re: [Pyunit-interest] comments on PyUnit
Brought to you by:
purcell
From: Guido v. R. <gu...@di...> - 2001-04-11 18:22:08
|
> Yes. I propose that the Python Library Reference only document one > name for each method. *Which* name should be decided here. > This issue exists for the following pairs of names: > > failUnless / assert_ failUnless > assertEqual / assertEquals failUnlessEqual > assertNotEqual / assertNotEquals failIfEqual Also, assertRaises should be changed to failUnessRaises, etc. > I wrote: > > - Guido suggests using a unique exception for test failures, similar > > to the use of TestFailed in the Python regression test. This > > allows the test errors to be distinguished from the traditional > > use of "assert" in Python modules. For backward compatibility it > > might be reasonable to subclass from AssertionError. > > Steve: > > That doesn't help backward compatibility, because the framework would still > > have to catch 'AssertionError' in order to detect failures. > > I'm not sure I understand why -- do you *really* want to catch failures > from assert statements, or is there some other motivation? I'd be > inclined to group AssertionError separately from some new exception > raised by test code. The problem is that many test suites (e.g. the Zope tests for PageTemplates :-) use assert statements instead of calls to fail*() / assert*() methods. --Guido van Rossum (home page: http://www.python.org/~guido/) |