[py-dev] py.test features for a new unittest

holger krekel holger at merlinux.de
Sun Mar 11 22:10:59 CET 2007


Hi Collin!

thanks a lot for your mail - it is very nice that you
consider py.test and its ideas for your work.  
Currently, many of us are very busy with PyPy (and py.test :) 
until april, but i'll see to participate and feedback
a bit because i am indeed interested in the topic. 

On Sun, Mar 11, 2007 at 16:04 -0500, Collin Winter wrote:
> I'm working on a new design for Python's unittest to be shipped with
> Python 3, and I'm interested in incorporating some of py.test's
> features. (You can get a good overview of the heart of the new design
> from http://oakwinter.com/code/a-new-unittest/.) The new unittest is
> focused on ease of extensibility, while still incorporating enough
> user-facing functionality to be useful. To that end, I'm keen to
> import py.test's traceback snipping/beautification, concept of
> generative tests, print debugging and (possibly) module-level
> setup/teardown.

sure.  on a sidenote, i consider "generative tests" still somewhat 
of a hack, at least in terms of py.test's own implementation, 
but maybe also conceptually. 
 
> I plan on bring this up on the new testing-in-python list soon, but I
> thought I'd ask you privately first: is there anything (from py.test
> or otherwise) that you'd like to see go into a totally-rewritten
> unittest design? Is there anything you've tried to do in terms of
> extending unittest that the old design made unworkable or
> unnecessarily complicated?

Maybe the main conceptual issue is that unittest.py based
approaches usually mix test code and test configuration. 
For example, configuring different reporters, extra memory
checks or specifying the distribution of tests across multiple
hosts should IMO not require any changes to the test modules
but go to a separate test configuration.  Admittedly, the current
hooks provided by py.test's conftest.py leave a bit to be wished
for, but this conceptual separation is there.  I think it relates
to the question of providing a test tool or a test framework. 

In any case, i am certainly interested to discuss this further,
either here or on an appropriate list. 

best & cheers, 

holger




More information about the Pytest-dev mailing list