[pypy-dev] having broken the back of the unittest conversion problem ...
holger krekel
hpk at trillke.net
Thu Jun 17 10:32:33 CEST 2004
[Armin Rigo Thu, Jun 17, 2004 at 09:19:39AM +0100]
> Hello!
>
> On Thu, Jun 17, 2004 at 08:44:42AM +0200, holger krekel wrote:
> > > self.assertNotEquals(left, right) --> assert left != right
> > > self.failIfEqual(left, right) --> assert left != right
>
> Maybe for consistency we should really use the operator implied in the name,
> i.e.:
>
> self.assertNotEquals(left, right) --> assert left != right
> self.failIfEqual(left, right) --> assert not (left == right)
In unittest.py they all map to the same thing. IOW, you can't
expect much from unittest's name usage, anyway, so i wouldn't try to be
too clever there ...
> Just in case we really check specifically the __eq__ or __ne__ operators.
>
> > > #def fail(self, msg=None):
> >
> > doesn't exist in utest but will have to be re-added because we apparently
> > use this in a few places. Probably with 'from std.utest import fail'.
>
> raise AssertionError could be the equivalent.
good point!
btw, do you also have a solution for the 'msg' third parameter problem with respect
to the easy-parsing approach? I'd like to have a generic converter script for
unittest->utest at some point and it would be nice if it tried to do as much
as possible ... i tend to (again) think that AST is a somewhat cleaner solution.
holger
More information about the Pypy-dev
mailing list