Skip to content

Commit 3c737e2

Browse files
committed
Preparing for 5.2.0 release.
1 parent 563f311 commit 3c737e2

14 files changed

+41
-23
lines changed

CHANGELOG.rst

+40
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
1+
5.2.0
2+
-----
3+
4+
- gh-65454: :func:`unittest.mock.Mock.attach_mock` no longer triggers a call
5+
to a ``PropertyMock`` being attached.
6+
7+
- gh-117765: Improved documentation for :func:`unittest.mock.patch.dict`
8+
9+
- gh-124176: Add support for :func:`dataclasses.dataclass` in
10+
:func:`unittest.mock.create_autospec`. Now ``create_autospec`` will check
11+
for potential dataclasses and use :func:`dataclasses.fields` function to
12+
retrieve the spec information.
13+
14+
- gh-123934: Fix :class:`unittest.mock.MagicMock` reseting magic methods
15+
return values after ``.reset_mock(return_value=True)`` was called.
16+
17+
- gh-90848: Fixed :func:`unittest.mock.create_autospec` to configure parent
18+
mock with keyword arguments.
19+
20+
- gh-113569: Indicate if there were no actual calls in unittest
21+
:meth:`~unittest.mock.Mock.assert_has_calls` failure.
22+
23+
- gh-122858: Deprecate :func:`!asyncio.iscoroutinefunction` in favor of
24+
:func:`inspect.iscoroutinefunction`.
25+
26+
- gh-104745: Limit starting a patcher (from :func:`unittest.mock.patch` or
27+
:func:`unittest.mock.patch.object`) more than once without stopping it
28+
29+
- gh-75988: Fixed :func:`unittest.mock.create_autospec` to pass the call
30+
through to the wrapped object to return the real result.
31+
32+
- gh-119600: Fix :func:`unittest.mock.patch` to not read attributes of the
33+
target when ``new_callable`` is set. Patch by Robert Collins.
34+
35+
- gh-113407: Fix import of :mod:`unittest.mock` when CPython is built
36+
without docstrings.
37+
38+
- gh-120732: Fix ``name`` passing to :class:`unittest.mock.Mock` object when
39+
using :func:`unittest.mock.create_autospec`.
40+
141
5.1.0
242
-----
343

NEWS.d/2023-12-22-20-49-52.gh-issue-113407.C_O13_.rst

-1
This file was deleted.

NEWS.d/2023-12-29-17-57-45.gh-issue-113569.qcRCEI.rst

-2
This file was deleted.

NEWS.d/2024-02-27-13-05-51.gh-issue-75988.In6LlB.rst

-1
This file was deleted.

NEWS.d/2024-04-22-21-54-12.gh-issue-90848.5jHEEc.rst

-1
This file was deleted.

NEWS.d/2024-06-04-08-57-02.gh-issue-65454.o9j4wF.rst

-1
This file was deleted.

NEWS.d/2024-06-10-14-00-40.gh-issue-119600.jJMf4C.rst

-2
This file was deleted.

NEWS.d/2024-06-19-15-06-58.gh-issue-120732.OvYV9b.rst

-2
This file was deleted.

NEWS.d/2024-07-14-12-25-53.gh-issue-117765.YFMOUv.rst

-1
This file was deleted.

NEWS.d/2024-08-10-10-21-44.gh-issue-122858.ZC1rJD.rst

-2
This file was deleted.

NEWS.d/2024-09-13-10-34-19.gh-issue-123934.yMe7mL.rst

-2
This file was deleted.

NEWS.d/2024-09-24-13-32-16.gh-issue-124176.6hmOPz.rst

-4
This file was deleted.

NEWS.d/2024-11-10-18-14-51.gh-issue-104745.zAa5Ke.rst

-3
This file was deleted.

mock/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import mock.mock as _mock
88
from mock.mock import *
99

10-
__version__ = '5.1.0'
10+
__version__ = '5.2.0'
1111
version_info = tuple(int(p) for p in
1212
re.match(r'(\d+).(\d+).(\d+)', __version__).groups())
1313

0 commit comments

Comments
 (0)