[TIP] Mock objects in testing object composition?

Paul Dubois pfdubois at gmail.com
Tue Apr 24 13:32:02 PDT 2007


You're trying too hard. You want your grid tests as a secondary test of your
tile class. You've got unit tests on the tile class, sure, but you also
exercise it further in context. That can only be good. If somehow the tile
class got bad and only the grid test showed it, that would be a good thing,
right? The goal here is to find errors, not minimize test failures.

On 4/24/07, Julius Lucks <lucks at fas.harvard.edu> wrote:
>
> Hi Benji,
> I am new to this, so this might not be the best reason, but 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?
>
> Cheers,
>
> Julius
>
> -----------------------------------------------------
> http://openwetware.org/wiki/User:Lucks
> -----------------------------------------------------
>
>
>
> On Apr 24, 2007, at 4:09 PM, Benji York wrote:
>
> Julius Lucks wrote:
>
> However, how do I test the Grid behavior, independently of a
> properly-functioning Tile class (i.e. how do I isolate the tests of the
> Grid object)?
>
>
> What is your motivation for doing so?  I don't see a problem with the
> tests for Grid requiring Tile.
> --
> Benji York
> http://benjiyork.com
>
>
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.idyll.org/pipermail/testing-in-python/attachments/20070424/268de7a7/attachment.htm 


More information about the testing-in-python mailing list