[kforge-dev] using nosetests (pros/cons)

Rufus Pollock rufus.pollock at okfn.org
Wed May 7 13:08:07 UTC 2008


On 05/05/08 20:36, John Bywater wrote:
> Rufus Pollock wrote:
>>> We aren't diverging on tools, are we?
>>
>> I don't think so though I would *really* like to start using a 
>> standard testrunner such as nosetest rather than our own hand-crafted 
>> one if that were possible.
>>
>> I know this is something I've brought up before and we've stayed with 
>> our hand-crafted solution as a results of your arguments but with the 
>> development of e.g. nosetests over the last few years and our usage of 
>> it on other projects it seems like it might really make sense to start 
>> migrating to this ... (at least on kforge).
> 
> Let's stick to running KForge tests with kforge-test for now. That code 
> could make better use of the unittest test runner code. I never 
> straightened it out. But let's keep things simple and leave this aspect 
> alone for now.

But why bother to continue to write our own bespoke wrapper of the 
unittest runner where nosetests already exists?

> Of course in time we can change anything. But let's be disciplined and 
> remain with the current state for now.
> 
> 
>>> My view #1: we don't need to change anything here because nothing is 
>>> broken.
>>> My view #2: we both need to be a force for convergence.
>>>
>>> Don't you want to use the unittest package when testing KForge? 
>>> What's happening?
>>
>> nosetests runs unittest-based tests as well as non-unittest based 
>> tests ...
> 
> 
> Yes, but you don't know that it does everything in the same way, and we 
> need to run the tests in the same way.
> 
> Let's just run KForge tests with kforge-test. It isn't broken and we 
> don't really need to spend time discussing it. Can't we both just run 
> kforge-test?

The thing is I really find nosetests a lot more convenient:

   * No need to write special 'suite' methods
   * Easier ways to run/not run tests from command line
   * Better reporting from succeeding/failing tests (using -d switch)
   * Possibility to use nosetest plugins etc

Thus, at least on KForge I'd be a big +1 for moving to this particularly 
since I don't think we actually need to change any of our tests to have 
them run by nose ...

~rufus





More information about the kforge-dev mailing list