[Distutils] RFC: Standard Declaration of tests in eggs

Phillip J. Eby pje at telecommunity.com
Mon Jan 8 20:02:27 CET 2007


At 06:05 PM 1/8/2007 +0000, John J Lee wrote:
>On Mon, 8 Jan 2007, David Fraser wrote:
>[...]
> > So I need to go and code a test enumerator for py.test to discover tests
> > within eggs (which is possible)
>[...]
>
>Or (for new code) use nose, which AIUI is intended to be pretty much
>py.test implemented within the unittest framework (plus whatever bits and
>pieces the nose authors wanted to change, it's true).

I'm not sure whether nose handles test discovery in eggs, but I believe 
that, like py.test, it has pluggable enumeration capabilities.

What would be nice is if we could get some folks working on py.test and 
nose to chime in on the proposal, to make sure that it's sound.  At the 
moment, the proposal (or at least my suggested version of it) allows for:

* specification of one "loader" for all tests in an egg

* specification of zero or more entry points for locating tests

The only way to provide any configuration to the loader is via attributes 
of the entry points.  For example, if the entry point is a module, you 
could set your options location via attributes of the module.

The loader must support a .loadTestFromName(name, obj) call, where name 
will be an empty string, and obj will be the object specified by a test 
entry point.  The return value must be a unittest.TestSuite.  And it must 
be possible to call the loader multiple times with different 'obj' values.



More information about the Distutils-SIG mailing list