[TIP] Defining a convention for running tests, #2

Michael Foord fuzzyman at voidspace.org.uk
Sat Feb 27 14:51:32 PST 2010


On 27/02/2010 22:32, Robert Collins wrote:
> On Sat, 2010-02-27 at 22:12 +0000, Michael Foord wrote:
>
>    
>>> It is no less useful, but its not more useful either. If we define API
>>> conformance instead, then python -m<runner>   somepackage.tests is no
>>> less useful than *either* and can be more useful: runner glue can choose
>>> result objects, provide command line handling that the user finds
>>> atractive, provide parallel execution glue etc, while still being
>>> standardised.
>>>
>>>        
>> Except how does a project *specify* what the<runner>  argument is
>> supposed to be?
>>
>> This is the value a standard entry point provides.
>>      
> They don't *need* to. Thats the point. You can use testtools.run,
> unittest.run, nose, trial, zope runtests, subunit.run, unittestgui,
> tribunal. If py.test adds a 'I can run a TestSuite' mode, then you can
> use that too [and that could introspect for e.g. a py.test.TestSuite and
> handle such things differently, to both interoperate and do 'native'
> things.
>
>    
Ok, I'm not sure if that meets Titus' use case - but then if the package 
has a dependency on a specific test runner (nose, py.test, unittest2 or 
whatever) to run tests then it will already need to be installed on the 
client. Without a standard entry point the tests will need to be capable 
of being run with a unittest TextTestRunner.

That leads to an interesting point - what if a package has dependencies 
that are only needed to run tests (like testtools, testresources etc). 
You probably don't want to declare them as requirements but you do want 
to require them somehow. I am discussing now about how packages should 
declare test-only dependencies.

Michael

> -Rob
>    


-- 
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.





More information about the testing-in-python mailing list