[TIP] mock 0.8 rc1: performance improvements and bugfixes

Michael Foord michael at voidspace.org.uk
Thu Dec 29 05:34:44 PST 2011

Hey all,

A late christmas present (or nuisance depending on your point of view...), I've released mock 0.8 release candidate 1. The main changes in this release are performance improvements and a couple of bugfixes.

mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects. The latest stable release is 0.7.2, which you can download from pypi.

You can download the new release candidate or install it with:

	pip install -U mock==dev
	easy_install mock

* http://www.voidspace.org.uk/downloads/mock-0.8.0rc1.tar.gz
* http://pypi.python.org/pypi/mock

Full details here:


Changelog for this release:

	• create_autospec on the return value of a mock class will use __call__ for the signature rather than __init__
	• Performance improvement instantiating Mock and MagicMock
	• Mocks used as magic methods have the same type as their parent instead of being hardcoded to MagicMock

Special thanks to Julian Berman for his help with diagnosing and improving performance in this release. I have started work on the doc changes and I'm hoping that the 0.8 final release won't be too far off.

As always please try out the new release. I'm considering making this release a "proper" pypi release, so that it is the default version installed by pip. I consider mock 0.8 to now be production ready, modulo the fact that there is still a lot of doc work to do. I'll see how far I get on the doc work in the remainder of the Christmas break.

All the best,

Michael Foord


May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
-- the sqlite blessing 

More information about the testing-in-python mailing list