[TIP] Which mock object framework should I use?

tarjei tarjei at nu.no
Sun Nov 18 07:59:18 PST 2007

Hash: SHA1

Gustavo Niemeyer wrote:
> Hello Martin,
>>> You can add Mocker <http://labix.org/mocker> to the list. Looks
>>> very well documented and thought out.
>> Ah yes, an omission from my side, I had actually looked at it. I
>> agree it looks good, but I'd appreciate any pointers to practical
>> experience.
> You won't find many pointers for practical experience with Mocker
> yet, as I've released it publicly only a week ago or so.  Even
> then, I do believe it has a superset of the features of all the
> others, and a few more, in a well packed way.
> Please let me know if you have any questions or suggestions about
> it.


I come from a mainly php background to the Python world, and I've
mainly been using the pmock library for mocking.

Since you are working on a new Mock implementation, my wishlist is
that you look at the api that is used by the simpletest package
(simpletest.org) for mocking.

What I like about the simpletest api is that it doesn't require too
much typing.

Instead of : (example from pmock)
you can have:
obj.expectOnce('some_method', ('myparam','otherparam'), 'tt')

Which is IMHO both more readable and easier to work with.

Kind regards,

Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


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

More information about the testing-in-python mailing list