[TIP] Functional Testing of Desktop Applications

Grig Gheorghiu grig at gheorghiu.net
Sun Mar 4 17:49:19 PST 2007

--- Laura Creighton <lac at openend.se> wrote:

> In a message of Mon, 05 Mar 2007 00:01:35 GMT, Michael Foord writes:
> <snip>
> >This leads us into a bit of a debate about how much to mock out in
> our 
> >unit tests. The most extreme testing doctrine says that you should
> mock 
> >out *all* your dependencies when testing a unit - even dependencies 
> >within the same object (if you are testing method 'a' and it
> contains a 
> >call to function or method 'b' you should mock 'b').
> >
> A different, related problem.  The idea is that your tests stay live
> and you run them all periodically to make sure nothing breaks.  Do
> this properly, and write a thing like pypy (and py.test) and you
> will find that a run of all your tests takes 3-4 hours. :-(  Thus
> the most extreme doctrine above only works on "small-enough"
> projects.

I think that mocking actually speeds things up tremendously, while also
complicating them....But for a project like PyPy, which does lots of
backend stuff, I would think mocking would be beneficial in many cases
-- so that functionality gets tested in isolation. It would be
interesting to know whether the PyPy guys actually do any mocking in
their testing.


More information about the testing-in-python mailing list