[TIP] Mock objects in testing object composition?

Julius Lucks lucks at FAS.HARVARD.EDU
Tue Apr 24 13:52:31 PDT 2007


Many thanks Benji and Paul.

Looks like simpler is better.  So when are mock objects useful?

Julius

-----------------------------------------------------
http://openwetware.org/wiki/User:Lucks
-----------------------------------------------------



On Apr 24, 2007, at 4:45 PM, Benji York wrote:

> Julius Lucks wrote:
>> I would like to separate Grid tests from dependance on Tile so  
>> that later on down the road when I change the Tile class and break  
>> it, then my Grid tests don't start to fail for this reason.  Is  
>> this not a good way of thinking?
>
> It sounds ideal, but like so many ideals its cost is likely greater  
> than the benefit.
>
> I wouldn't worry about it.  One day your Tile and Grid tests start  
> failing, you look at one or the other and realize pretty quickly  
> that Tile is at fault, you fix Tile and Grid is happy too.  Not to  
> mention that you making changes to Tile is what caused the tests to  
> start failing, so you'll have a pretty good idea what happened.
> -- 
> Benji York
> http://benjiyork.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/testing-in-python/attachments/20070424/76d1a8d5/attachment.htm 


More information about the testing-in-python mailing list