[TIP] Python mock library comparison

Kumar McMillan kumar.mcmillan at gmail.com
Sat Mar 5 23:41:44 PST 2011


On Sun, Feb 27, 2011 at 7:21 PM, Gary Bernhardt
<gary.bernhardt at gmail.com> wrote:
>  - Fudge and MiniMock examples (Kumar? Ian?)
>
> Pull requests are welcome!
> https://github.com/garybernhardt/python-mock-comparison

Thanks Gary.  It's pretty cool to see everything side by side.  Here
is the Fudge section:
https://github.com/kumar303/python-mock-comparison/compare/master
(pull request sent)

fwiw, I'm not a huge fan of abstract code examples using some_object,
some_method, some_value, etc.  I much prefer examples that represent
realistic situations, even if they are slightly contrived -- it's so
much easier on my brain!  This was a major requirement for me when I
wrote fudge's own documentation --
http://farmdev.com/projects/fudge/using-fudge.html -- and I encourage
all developers to think up realistic situations when writing code
samples.

That said, I like mocking the open function as a context manager,
that's something one might do in real life so it will make sense to a
developer who is considering a mock library.

-Kumar

>
> --
> Gary
> http://blog.extracheese.org
>
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python
>



More information about the testing-in-python mailing list