[TIP] unittest2 and the future of nose

Michael Foord fuzzyman at voidspace.org.uk
Thu Mar 4 14:35:17 PST 2010

On 04/03/2010 22:21, jason pellerin wrote:
> 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().

Great! So the combination of distutils2 and unittest2 should make life 
much easier.

Hooking into unittest.main() is an interesting point that will need to 
be considered when the extensibility machinery is implemented.


> JP


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.

More information about the testing-in-python mailing list