Python Programming, news on the Voidspace Python Projects and all things techie.
mock 0.7.0 release candidate one, a theme a talk and an interview
Mock 0.7.0 release candidate 1 has been released.
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)
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
I'm doing a talk at PyCon 2011 on mock. According to the draft schedule (will be made final shortly) my talk is in the first slot on the first day! At least I won't have to spend half the conference agonising about my talk.
As part of the run up to PyCon, which is scary soon, I've done an interview with Mike Driscoll about the talk, including why I wrote mock and what I hope people will learn from the talk:
Hopefully see you at my talk at PyCon! In preparation for the talk I've been working on the documentation for the 0.7.0 release. It is only documentation changes remaining and I've done most of them. All of the examples in the documentation are now doctests, which means they're tested. That also meant fixing the occasional error in the docs! All the new features are documented as well. I still need to add examples of the new features to the getting started guide and redo the examples page so that instead of duplicating parts of "getting started" it shows off some more advanced uses of Mock, MagicMock, patch and mocksignature.
The changes so far are already online. This includes switching to a new, and nicer, Sphinx theme: ADCtheme. The mock docs are online at:
There are already a bunch of ideas for the next release, which may well be 1.0, are in the mock issue tracker. If you find any bugs or have any feature requests, please add them here:
PyCrypto 2.3 Windows binaries
Hey all, seems like a long time since we've spoken. I'm afraid I'm still crazy busy so I can't chat for long. Just a quick word to let you know that I've uploaded new Windows binaries for PyCrypto 2.3.
As always the Windows binaries, 32 bit installers for Python 2.4 - 2.7, can be found at:
This work is licensed under a Creative Commons Attribution-Share Alike 2.0 License.