Thu Feb 16 21:45:18 2012 UTC ()
Update devel/py-mock to 0.8.0.
Changelog:
2012/02/13 Version 0.8.0
------------------------
The only changes since 0.8rc2 are:
* Improved repr of :data:`sentinel` objects
* :data:`ANY` can be used for comparisons against :data:`call` objects
* The return value of the :class:`MagicMock` `__iter__` method can be set to
any iterable and isn't required to be an iterator
Full List of changes since 0.7:
mock 0.8.0 is the last version that will support Python 2.4.
* Addition of :attr:`~Mock.mock_calls` list for *all* calls (including magic
methods and chained calls)
* :func:`patch` and :func:`patch.object` now create a :class:`MagicMock`
instead of a :class:`Mock` by default
* The patchers (`patch`, `patch.object` and `patch.dict`), plus `Mock` and
`MagicMock`, take arbitrary keyword arguments for configuration
* New mock method :meth:`~Mock.configure_mock` for setting attributes and
return values / side effects on the mock and its attributes
* New mock assert methods :meth:`~Mock.assert_any_call` and
:meth:`~Mock.assert_has_calls`
* Implemented :ref:`auto-speccing` (recursive, lazy speccing of mocks with
mocked signatures for functions/methods), as the `autospec` argument to
`patch`
* Added the :func:`create_autospec` function for manually creating
'auto-specced' mocks
* :func:`patch.multiple` for doing multiple patches in a single call, using
keyword arguments
* Setting :attr:`~Mock.side_effect` to an iterable will cause calls to the mock
to return the next value from the iterable
* New `new_callable` argument to `patch` and `patch.object` allowing you to
pass in a class or callable object (instead of `MagicMock`) that will be
called to replace the object being patched
* Addition of :class:`NonCallableMock` and :class:`NonCallableMagicMock`, mocks
without a `__call__` method
* Addition of :meth:`~Mock.mock_add_spec` method for adding (or changing) a
spec on an existing mock
* Protocol methods on :class:`MagicMock` are magic mocks, and are created
lazily on first lookup. This means the result of calling a protocol method is
a `MagicMock` instead of a `Mock` as it was previously
* Addition of :meth:`~Mock.attach_mock` method
* Added :data:`ANY` for ignoring arguments in :meth:`~Mock.assert_called_with`
calls
* Addition of :data:`call` helper object
* Improved repr for mocks
* Improved repr for :attr:`Mock.call_args` and entries in
:attr:`Mock.call_args_list`, :attr:`Mock.method_calls` and
:attr:`Mock.mock_calls`
* Improved repr for :data:`sentinel` objects
* `patch` lookup is done at use time not at decoration time
* In Python 2.6 or more recent, `dir` on a mock will report all the dynamically
created attributes (or the full list of attributes if there is a spec) as
well as all the mock methods and attributes.
* Module level :data:`FILTER_DIR` added to control whether `dir(mock)` filters
private attributes. `True` by default.
* `patch.TEST_PREFIX` for controlling how patchers recognise test methods when
used to decorate a class
* Support for using Java exceptions as a :attr:`~Mock.side_effect` on Jython
* `Mock` call lists (`call_args_list`, `method_calls` & `mock_calls`) are now
custom list objects that allow membership tests for "sub lists" and have
a nicer representation if you `str` or `print` them
* Mocks attached as attributes or return values to other mocks have calls
recorded in `method_calls` and `mock_calls` of the parent (unless a name is
already set on the child)
* Improved failure messages for `assert_called_with` and
`assert_called_once_with`
* The return value of the :class:`MagicMock` `__iter__` method can be set to
any iterable and isn't required to be an iterator
* Added the Mock API (`assert_called_with` etc) to functions created by
:func:`mocksignature`
* Tuples as well as lists can be used to specify allowed methods for `spec` &
`spec_set` arguments
* Calling `stop` on an unstarted patcher fails with a more meaningful error
message
* Renamed the internal classes `Sentinel` and `SentinelObject` to prevent abuse
* BUGFIX: an error creating a patch, with nested patch decorators, won't leave
patches in place
* BUGFIX: `__truediv__` and `__rtruediv__` not available as magic methods on
mocks in Python 3
* BUGFIX: `assert_called_with` / `assert_called_once_with` can be used with
`self` as a keyword argument
* BUGFIX: when patching a class with an explicit spec / spec_set (not a
boolean) it applies "spec inheritance" to the return value of the created
mock (the "instance")
* BUGFIX: remove the `__unittest` marker causing traceback truncation
* Removal of deprecated `patch_object`
* Private attributes `_name`, `_methods`, '_children', `_wraps` and `_parent`
(etc) renamed to reduce likelihood of clash with user attributes.
* Added license file to the distribution
(gls)
diff -r1.1.1.1 -r1.2 pkgsrc/devel/py-mock/Makefile
diff -r1.1.1.1 -r1.2 pkgsrc/devel/py-mock/distinfo
--- pkgsrc/devel/py-mock/Makefile 2011/01/29 14:53:14 1.1.1.1
+++ pkgsrc/devel/py-mock/Makefile 2012/02/16 21:45:18 1.2
| @@ -1,17 +1,17 @@ | | | @@ -1,17 +1,17 @@ |
1 | # $NetBSD: Makefile,v 1.1.1.1 2011/01/29 14:53:14 gdt Exp $ | | 1 | # $NetBSD: Makefile,v 1.2 2012/02/16 21:45:18 gls Exp $ |
2 | # | | 2 | # |
3 | | | 3 | |
4 | DISTNAME= mock-0.7.0b4 | | 4 | DISTNAME= mock-0.8.0 |
5 | PKGNAME= ${PYPKGPREFIX}-${DISTNAME} | | 5 | PKGNAME= ${PYPKGPREFIX}-${DISTNAME} |
6 | CATEGORIES= devel | | 6 | CATEGORIES= devel |
7 | MASTER_SITES= http://pypi.python.org/packages/source/m/mock/ | | 7 | MASTER_SITES= http://pypi.python.org/packages/source/m/mock/ |
8 | | | 8 | |
9 | MAINTAINER= gdt@ir.bbn.com | | 9 | MAINTAINER= gdt@ir.bbn.com |
10 | HOMEPAGE= http://pypi.python.org/pypi/mock | | 10 | HOMEPAGE= http://pypi.python.org/pypi/mock |
11 | COMMENT= Python testing framework | | 11 | COMMENT= Python testing framework |
12 | LICENSE= gnu-gpl-v2 | | 12 | LICENSE= gnu-gpl-v2 |
13 | | | 13 | |
14 | PKG_DESTDIR_SUPPORT= user-destdir | | 14 | PKG_DESTDIR_SUPPORT= user-destdir |
15 | | | 15 | |
16 | USE_LANGUAGES= # none | | 16 | USE_LANGUAGES= # none |
17 | | | 17 | |
--- pkgsrc/devel/py-mock/distinfo 2011/01/29 14:53:14 1.1.1.1
+++ pkgsrc/devel/py-mock/distinfo 2012/02/16 21:45:18 1.2
| @@ -1,5 +1,5 @@ | | | @@ -1,5 +1,5 @@ |
1 | $NetBSD: distinfo,v 1.1.1.1 2011/01/29 14:53:14 gdt Exp $ | | 1 | $NetBSD: distinfo,v 1.2 2012/02/16 21:45:18 gls Exp $ |
2 | | | 2 | |
3 | SHA1 (mock-0.7.0b4.tar.gz) = effb4048d7b32dc8ebc0d9bc45f24600a03aedfb | | 3 | SHA1 (mock-0.8.0.tar.gz) = 28cbecea9abcc2c88e3e0cd47c793c6d112eddfc |
4 | RMD160 (mock-0.7.0b4.tar.gz) = 63ef286883fdd84fd692e82e07343dd7f9596ffc | | 4 | RMD160 (mock-0.8.0.tar.gz) = 1ce268be84b8182331d4fba29b40dfd7d1b60c34 |
5 | Size (mock-0.7.0b4.tar.gz) = 270735 bytes | | 5 | Size (mock-0.8.0.tar.gz) = 749663 bytes |