[TIP] Testify

Michael Foord fuzzyman at voidspace.org.uk
Sun Oct 31 20:20:41 PDT 2010

On 31/10/2010 06:41, holger krekel wrote:
> On Sun, Oct 31, 2010 at 15:15 +1300, Robert Collins wrote:
>> On Sun, Oct 31, 2010 at 2:20 AM, Marius Gedminas<marius at gedmin.as>  wrote:
>>> But it would be nice to be able to switch test _runners_ and get all
>>> those nice features (different output formats, colorization,
>>> parallelization, test selection) for your existing test suites, no
>>> matter which framework these used.
>> I'd like to make all runners be the same five lines:
>> result.startTestRun()
>> try:
>>      suite.run(result)
>> finally:
>>      result.stopTestRun()
>> The real interesting stuff is in creating suite (for parallelisation)
>> and result (for colourisations, xml output, streaming to another
>> server etc).
> How would sharing the above lines help anything?
I'm inclined to agree. One of my goals with unittest2 is to make it so 
that test writers don't *have* to collect their own suites and then 
write code like the above just to run tests. For fairly standard test 
suites this is already possible because of test discovery. As soon as 
you want to do something custom you need to revert to juggling suites 
and results. This is what the plugins branch addresses.

Having test frameworks be able to run each others tests is a noble goal. 
In unittest2 you can use load_tests to return a "unittest compatible 
suite object" for each module - so for tests backed by a real Python 
module that is at least theoretically possible. (py.test, and probably 
other frameworks too, will do more than just run Python tests however.)

All the best,


> Rephrasing Marius goal, *the actual tests* should be runnable
> from different test tools.  If we as test tool maintainers share
> some code because it makes things easier for us, is a different
> and somewhat orthogonal matter.
> cheers,
> holger
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python



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