ANN: mock 0.6.0, Python mocking and testing library

F

Fuzzyman

mock is a Python mock object library for testing, with additional
support for runtime monkey patching.

Most mocking libraries follow the ‘record -> replay’ pattern of
mocking. I prefer the ‘action -> assertion’ pattern, which is more
readable and intuitive; particularly when working with the Python
unittest module.

This release, version 0.6.0, is a minor release but with a few new
features:

* mock homepage http://www.voidspace.org.uk/python/mock/
* download http://www.voidspace.org.uk/downloads/mock-0.6.0.zip
* PDF documentation http://www.voidspace.org.uk/downloads/mock.pdf
* Google code project and SVN repository http://code.google.com/p/mock/

New in 0.6.0:

* New test layout compatible with test discovery
* Descriptors (static methods / class methods etc) can now be patched
and restored correctly
* Mocks can raise exceptions when called by setting side_effect to an
exception class or instance
* Mocks that wrap objects will not pass on calls to the underlying
object if an explicit return_value is set
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,954
Messages
2,570,116
Members
46,704
Latest member
BernadineF

Latest Threads

Top