[TIP] Coming changes to unittest2 plugins

Tarek Ziadé ziade.tarek at gmail.com
Mon Sep 27 08:04:01 PDT 2010

On Mon, Sep 27, 2010 at 4:52 PM, Michael Foord <michael at voidspace.org.uk> wrote:
>  On 27/09/2010 15:47, Tarek Ziadé wrote:
>> On Mon, Sep 27, 2010 at 4:33 PM, Michael Foord<michael at voidspace.org.uk>
>>  wrote:
>>>  [snip...]
>>>  I expect to change configuration
>>> to look like:
>>> package.module:Class
>>> I hate the colon but it is how entry points do it *anyway*. Function
>>> based
>>> plugins will still be possible, but will *require* an initialization
>>> function that takes the hook set.
>> Minor nitpick: I don't think you need a colon here. After some
>> discussion we are dropping it in distutils2 in all places where we
>> point code, since it's easy to find which part is the module and which
>> part is not when configuring a code location.
>> see distutils2.util.resolve_name()
>> A "location.replace(':', '.')" is a simple way to make it
>> setuptools-compatible if this is wished.
> Ok. Being compatible with the distutils2 extension mechanism is more
> important to me than following the setuptools convention (I do hate that
> colon)... :-)

Cool !  Notice that we have two places so far in d2 where we want to
locate the code through configuration:

- pre- and post- hooks for commands (commited already in d2 tip)
- extensions (not present yet)

and maybe a third one soon: new commands could be registered like that
instead of the current mechanism that makes a lot of assumptions
(dir-based with the obligation to have a module and the class named
like the command,)

> All the best,
> Michael Foord
>> Regards
>> Tarek
> --
> http://www.ironpythoninaction.com/
> http://www.voidspace.org.uk/blog
> READ CAREFULLY. By accepting and reading this email you agree, on behalf of
> your employer, to release me from all obligations and waivers arising from
> any and all NON-NEGOTIATED agreements, licenses, terms-of-service,
> shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure,
> non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have
> entered into with your employer, its partners, licensors, agents and
> assigns, in perpetuity, without prejudice to my ongoing rights and
> privileges. You further represent that you have the authority to release me
> from any BOGUS AGREEMENTS on behalf of your employer.

Tarek Ziadé | http://ziade.org

More information about the testing-in-python mailing list