ANN: mock 0.7.0 release candidate 1

Fuzzyman fuzzyman at gmail.com
Fri Feb 25 15:27:10 CET 2011


There is a new release of mock: mock 0.7.0 rc1

http://pypi.python.org/pypi/mock

This is intended to be the last release of mock before 0.7.0 final and
the only changes anticipated are documentation changes which I've
finally started work on.

mock is a Python library for simple mocking and patching (replacing
objects with mocks during test runs). The "headline features" in 0.7.0
are Python 3 support and the ability to mock magic methods. You can
now mock objects that behave like containers or are used as context
managers. mock is designed for use with unittest, based on the "action
-> assertion" pattern rather than "record -> replay". People are
happily using mock with Python test frameworks like nose and py.test.
0.7.0 is a major new release with a bunch of other new features and
bugfixes as well.

http://pypi.python.org/pypi/mock/ (download)
http://www.voidspace.org.uk/python/mock/ (documentation)
https://code.google.com/p/mock/ (repo and issue tracker)

Changelog:

http://www.voidspace.org.uk/python/mock/changelog.html#version-0-7-0-rc-1

Changes since beta 4:

* Tested with jython, pypy and Python 3.2 and 3.1
* Decorated functions / methods have their docstring and __module__
preserved on Python 2.4
* BUGFIX: mock.patch now works correctly with certain types of objects
that proxy attribute access, like the django settings object
* BUGFIX: reset_mock caused infinite recursion when a mock is set as
its own return value

Michael Foord


More information about the Python-announce-list mailing list