[TIP] Python mock library comparison

Michael Foord fuzzyman at voidspace.org.uk
Sat Mar 5 03:59:10 PST 2011


On 28/02/2011 01:21, Gary Bernhardt wrote:
> Over the last few days, there's been some back-and-forth as various
> mock libraries update their comparison documents. This seems like a
> precarious situation asking to go out of sync. I decided to try and
> consolidate the efforts.
>

Hey, there's another one! Chai. :-)

http://blog.agoragames.com/2011/03/02/chai-the-simple-python-mock/

Gary, thanks for your work on this. I'll fix the mock "partial mocking" 
example and send a pull request your way.

All the best,

Michael

> Here's what we have:
>    - A GitHub project based on Michael's latest comparison document
> (https://github.com/garybernhardt/python-mock-comparison)
>    - A publicly reachable copy of the docs for linking
> (http://garybernhardt.github.com/python-mock-comparison/)
>    - All examples executing as doctests (160 tests total!)
>    - python-mock and pmock removed (both are unmaintained)
>    - Dingus examples added
>
> I also found several examples that were wrong—enough to justify the
> effort in itself. The mocker examples were also quite out of date. Now
> that the examples are doctests, life will be perfect forever!
>
> The notable bits live in a single comparison.rst file. Mock library
> maintainers are welcome to include that in their docs (taking on the
> burden of keeping their copy up to date) or to simply link to the
> version hosted on GitHub.
>
> Here's what we still need:
>    - Fixes for the two failing Mox examples that are confusing me.
> They're currently marked XXX and commented out.
>    - Probably some cleanup of existing examples; my brain is fried
> after the conversion to doctests.
>    - Fudge and MiniMock examples (Kumar? Ian?)
>
> Pull requests are welcome!
> https://github.com/garybernhardt/python-mock-comparison
>


-- 
http://www.voidspace.org.uk/

May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing http://www.sqlite.org/different.html




More information about the testing-in-python mailing list