[ACCEPTED]-What is your favorite Python mocking library?-mocking
I've only used one, but I've had good results 11 with Michael Foord's Mock: http://www.voidspace.org.uk/python/mock/.
Michael's introduction 10 says it better than I could:
There are already 9 several Python mocking libraries available, so 8 why another one?
Most mocking libraries follow 7 the 'record -> replay' pattern of mocking. I 6 prefer the 'action -> assertion' pattern, which 5 is more readable and intuitive particularly 4 when working with the Python unittest module.
...
It 3 also provides utility functions / objects 2 to assist with testing, particularly monkey 1 patching.
I'm the author for mocktest. I think it's 2 pretty fully featured and easy to use, but 1 I might be biased:
pyDoubles the test doubles framework for Python, by 2 iExpertos.com. It supports mocks, stubs, spies 1 and matchers, including Hamcrest matchers
I've used pMock in the past, and didn't mind 2 it, it had pretty decent docs too. However, Foord's 1 Mock as mentioned above is also nice.
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.