[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-announce-list
Subject:    [ANN] mock 1.0.0 released
From:       Michael Foord <fuzzyman () gmail ! com>
Date:       2012-10-07 20:48:46
Message-ID: 4117bc95-8145-4a1f-88a2-ccb62264c737 () googlegroups ! com
[Download RAW message or body]

Hey all,

I'm pleased to announce that mock 1.0.0 has been released. This is the "standard \
library version", mock 1.0.0 has feature parity with "unittest.mock" in the Python \
3.3 standard library.

mock is a library for testing in Python. It allows you to replace parts of your \
system under test with mock objects and make assertions about how they have been \
used.

You can download mock from the PyPI page or install it with:

    pip install -U mock

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

Full list of changes since 0.8:

* `mocksignature`, along with the `mocksignature` argument to `patch`, removed
* Support for deleting attributes (accessing deleted attributes will raise an
  `AttributeError`)
* Added the `mock_open` helper function for mocking the builtin `open`
* `__class__` is assignable, so a mock can pass an `isinstance` check without
  requiring a spec
* Addition of `PropertyMock`, for mocking properties
* `MagicMocks` made unorderable by default (in Python 3). The comparison
  methods (other than equality and inequality) now return `NotImplemented`
* Propagate traceback info to support subclassing of `_patch` by other
  libraries
* `create_autospec` works with attributes present in results of `dir` that
  can't be fetched from the object's class. Contributed by Konstantine Rybnikov
* Any exceptions in an iterable `side_effect` will be raised instead of
  returned
* In Python 3, `create_autospec` now supports keyword only arguments
* Added `patch.stopall` method to stop all active patches created by `start`
* BUGFIX: calling `MagicMock.reset_mock` wouldn't reset magic method mocks
* BUGFIX: calling `reset_mock` on a `MagicMock` created with autospec could
  raise an exception
* BUGFIX: passing multiple spec arguments to patchers (`spec` , `spec_set` and
  `autospec`) had unpredictable results, now it is an error
* BUGFIX: using `spec=True` *and* `create=True` as arguments to patchers could
  result in using `DEFAULT` as the spec. Now it is an error instead
* BUGFIX: using `spec` or `autospec` arguments to patchers, along with
  `spec_set=True` did not work correctly
* BUGFIX: using an object that evaluates to False as a spec could be ignored
* BUGFIX: a list as the `spec` argument to a patcher would always result in a
  non-callable mock. Now if `__call__` is in the spec the mock is callable

All the best,

Michael Foord
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

        Support the Python Software Foundation:
        http://www.python.org/psf/donations/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic