There are many other Python mocking packages out there, too - notably pMock, a jMock style mocking library, Mock and minimock, a mocking library for the doctest unit test library. ![]() And they missed a trick not calling the documentation MoxDox. On the downside, Mox isn't in PyPI, which is a shame. It can get confused if your mocked class uses delegation, but you can always fall back to MockAnything(). Mox will warn you if you call a method on a mock that the mocked class doesn't have, which is handy. But it's possible that PyMock has all of this - given the documentation, it's hard to tell. I think it's has more functionality, too, with some nice comparators, side effects and callbacks. It's much better documented than PyDoc, and has more meaningful, helpful failure messages. But wherever Mox does differ from PyMock, it's better. Superficially, it's very similar to PyMock. The docs really could be better, and the failure messages are not very helpful, but it does the job.īut then I found Mox. ![]() It's heavily inspired by EasyMock, a mocking style I'm used to. PyMock is what I've been using up till now. Given that I'm speaking on Python mocking shortly, I thought I'd better dig through my accumulated bookmarks and see what I'm missing.
0 Comments
Leave a Reply. |