[TIP] Unittest Changes

Robert Collins robertc at robertcollins.net
Mon Jul 28 16:49:16 PDT 2008

On Tue, 2008-07-29 at 01:30 +0300, Pekka Laukkanen wrote:
> - Stand-alone asserts are available for unittest but also for other
> tools (no need to re-implement the wheel every time).

I'm not sure why other tools would need to reimplement assertions;
unless they testing tools - and then why not subclass TestCase?

> - Asserts have PEP8-style names (and naming convention suggested by
> BDFL).

This is nice I guess. (While the camelCase names are a bit jarring with
the rest of python, they do fit with xUnit in nearly every other
language I've found it ported to, which is a nice form of consistency).

> - 100% backwards compatibility.

I don't think you can claim that:
 - the failure exception changed from being safe to be a racy global
 - monkey patching a base class exception like assertEqual will no
longer JustWork for everyone, because the implementation is elsewhere
and people are being encouraged to use it.

FWIW I think functions rather than methods here are a mistake; it sets
the idiom people will work with to be that of functions - longer
parameter lists, less context and so on.


GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.idyll.org/pipermail/testing-in-python/attachments/20080729/a52ec13e/attachment.pgp 

More information about the testing-in-python mailing list