[python] Re: [wingide-users] Tests in Wing IDE 3.0

Michael Foord fuzzyman at voidspace.org.uk
Mon Nov 19 11:00:16 MST 2007


Wingware Support wrote:
> Pete wrote:
>> Lemme add another vote for py.test.  I just started using it and it's 
>> way nicer than unittest derrived tests (like nose).  Mainly because 
>> it doesn't reek of Java:
>
> We currently plan to develop a plugin system so many testing systems 
> can be accommodated.
>
>> unittest (& nose):
>> self.AssertEquals(x, 'pants')
>>
>> py.test:
>> assert x == 'pants'
>
> Just as an aside, the assert form works in unittest derived tests -- 
> or at least I think it does and my tests seem to work even though I 
> don't think I've ever used any of the assertThisOrThat methods.  I'm 
> sure each testing tool has its advantages but I suspect the assert 
> statement can be used with all (or almost all) of them.

Yup - assert works fine with unittest. py.test has always been a bit 
'magical' for my tastes, but tastes vary. :-)

I've always understood that the *main* feature of nose is test 
autodiscovery (plus extensibility). Again I prefer to specify the 
location of my tests myself (although perhaps nose includes a way of 
doing this?). The disadvantage of vanilla unittest is that it has no 
test discovery system and you have to roll your own every time.

I find the 'self.assertEquals' approach very intuitive and easy to read 
FWIW. It also makes building a comprehensive framework by writing your 
own assert methods very easy. I'm sure py.test has its own idiom for 
this - but I'm quite happy with unittest.

Unfortunately we use IronPython so the built in test support doesn't 
work for us. :-(

Michael
http://www.manning.com/foord

>
> Cheers,
>
> John
> _________________________________________________
> Wing IDE users list
> http://wingware.com/lists/wingide
>



More information about the wingide-users mailing list