Re: [Pyunit-interest] comments on PyUnit
Brought to you by:
purcell
From: Jeremy H. <je...@di...> - 2001-04-11 18:40:07
|
[Apoliges if these comments come through twice in slightly different form. I seem to be having mail delivery problems.] >>>>> "GvR" == Guido van Rossum <gu...@di...> writes: >> 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_ GvR> failUnless >> assertEqual / assertEquals GvR> failUnlessEqual >> assertNotEqual / assertNotEquals GvR> failIfEqual GvR> Also, assertRaises should be changed to failUnessRaises, etc. I strongly dislike the new names. They are too long and express the intended behavior in negative form. assertRaises: "This code is correct if it raises an error." failUnlessRaises: "This code is not correct unless it raises an error." The former is a more natural way to express the meaning. I would suggest finding a different word for assert instead of finding ways to turn all the assert calls into a negative form. One possibility is verify. Another is check, although that word already has a meaning for unit testing. Jeremy |