[TIP] Coming changes to unittest2 plugins

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


On Mon, Sep 27, 2010 at 7:31 PM, holger krekel <holger at merlinux.eu> wrote:
> On Mon, Sep 27, 2010 at 18:09 +0100, Michael Foord wrote:
>>  On 27/09/2010 18:05, holger krekel wrote:
>>> "dotted object addresses" look simple but they are really hiding
>>> complexity (also due to Python's complicated import system).
>>> This is also indicated by the fact that distutils2.util.resolve_name
>>> has 20 lines of code (and easily gives meaningless errors, btw) whereas
>>> the "a.b:C" notation requires a brain-dead simple 2-liner to resolve.
>>
>> But we should optimize for the user and not for the framework - right?
>> As the users here are Python developers, using the Python syntax for
>> specifying objects seems 'nicer'.
>
> My point is that the apparent "niceity" involves some evil magic (*) and
> can easily give strange error conditions to a developer.  Note that i am
> not only talking about unittest2 plugins here lbut a more general
> distutils2 context, anyway.

I quite disagree here:

1/ the new import system will be simpler, and we will be able to
switch to it at some point. We just have to live with __import__ for
the time being. And even if it's a bit weird, it works.

2/ I'd like to see any error we would be unable to solve.

3/ For this specific work there's no need to make the call
performant/fast since the location is loaded once.


Regards
Tarek

>
> cheers,
> holger
>
> (*) where "evil magic" is measured in calls / dealings with
>    the python import system :)
>



-- 
Tarek Ziadé | http://ziade.org



More information about the testing-in-python mailing list