[TIP] Generating tests dynamically (was Re: Meta-test methods...)

Douglas Philips dgou at mac.com
Sun Apr 26 08:21:52 PDT 2009


On or about 2009 Apr 26, at 9:18 AM, Michael Foord indited:
> C. Titus Brown wrote:
>> This may seem tangential but IMO is not: could someone document the
>> !%#!$!# out of unittest, please?

+1

> That's one of the difficulties of unittest - the extension mechanisms
> are unclear. Once you do read the source code it isn't so hard to work
> out - but there is no real guidance as to what the intended (or
> approved) extension points are and which are implementation details.

Indeed.

> I guess the situation is that it wasn't really considered, and so  
> people
> have extended unittest in just about every possible way and we now  
> have
> to assume that people are now relying on all the private APIs.

We chose not to do that. Because we're working with Python 2.4 (though  
we might move up to 2.5 soon), we decided to just copy the module and  
fix it locally. At first we had imagined all kinds of changes (kind of  
in the vein that Laura Creighton pointed out a few days ago). Then  
after using the new stuff for a few months, we trashed all that and  
made some pretty minor changes. The sad reality is that a new Python 2. 
(<6).x is not going to be released for changes such as cleaning up  
things in the stdlib. Hopefully what we can do is pull a revised  
(2.6/3.x) unittest that back into our local toolbox so we'll be ready  
to go when/if we move up.

> I'd like to write up how I've extended unittest and maybe address some
> of these issues once the current batch of changes are out of the way.

I'd like to see that.

--Doug




More information about the testing-in-python mailing list