[TIP] unittest2 and the future of nose

jason pellerin jpellerin at gmail.com
Thu Mar 4 14:21:03 PST 2010


On Thu, Mar 4, 2010 at 5:04 PM, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
> On 04/03/2010 22:00, Tarek Ziadé wrote:
>>
>> On Thu, Mar 4, 2010 at 9:51 PM, jason pellerin<jpellerin at gmail.com>
>>  wrote:
>> [..]
>>
>>>
>>> Third fact: setuptools is dying, distribute is going with it, and
>>> something called distutils2 is going to rise to take its place. This
>>> matters because a LOT of nose's internal complexity is there to
>>> support one thing: 'python setup.py test'. If that command goes away
>>> or changes substantially, nose will have to change with it.
>>>
>>
>> This command is added to distutils2, and should stay very similar.
>>
>
> I would like to know why it was so hard for nose to support it and how it
> can be made easier?

The problem for nose was that until very recently, users could only
specify the test_suite to be used. nose has it's own TestRunner and
TestResult subclasses that implement all of its plugin extension
points. So when run under 'python setup.py test', nose has to wrap
every test case in a result proxy that wraps the result, does some
monkeypatching, and generally makes understanding what happens inside
of the test running/result handling process much harder.

With test_runner available and no need for backwards compatibility,
nose2 will be in much better shape, it will just need to defer some
configuration to runner initialization, or abstract it out to be
called from both it's own main() and unittest.main().

JP



More information about the testing-in-python mailing list