Python Mocker or PyMox?

Update: We have developed our own test doubles framework. It is open source. Please check it out at

Mocker and PyMox are two isolation frameworks, or test doubles frameworks able to create mocks and stubs. Mocker is not being released frequently but contains pretty much all the features one need to test-drive. On the other hand PyMox is being developed but it's got an ugly Java-like syntax with does not look like Python. I don't say that Java syntax is ugly, in fact, I like it. What I say is that Python's got its own conventions (PEP-8) and PyMox does not respect it.
Which one to use? I think I need the two of them. PyMox is terrible for stubbing out functions. Awful API for stubs and more than that, it didn't work for me sometimes. However, it's great for mocks. Mocker is nice for stubs and powerful although the proxy/patch stuff is weird. I use both, Mocker for stubs and PyMox for mocks 🙂

  • Gustavo Niemeyer

    Mocker isn’t dead at all. It’s in active use by its author (myself) and many others.

  • Carlos Ble

    Sorry Gustavo, I thought the project was dead. I wrote to you last year about some bug or something and never got an answer. There are now news in its site and I haven’t seen any post in your blog regarding Mocker in a long time. Moreover the last public release is 0.10.1. It would be great if you release a new version. I’ve fixed the blog post removing “mocker is dead” because it is not.
    It would be very cool if you add the syntax


    for mocks, and also de syntax:


    for stubs.

    Thanks for a great doubles framework 🙂

  • Néstor Salceda

    Hey Carlos,

    Perhaps you wanna take a look to fudge:

    I use it, and it looks nice 🙂

  • Carlos Ble

    Thanks Nestor! Didn’t know about that framework. Will check it out 🙂

  • Moj¿esz

    What an significant document, retain penning mate