pytest-mock breaking changes
pytest-mock 3.17.0 (October 17, 2026) is its newest release with breaking changes, 2 of them. The first: Removed pytest_mock.plugin.assert_has_calls_wrapper. Every breaking API change we have recorded in pytest-mock on PyPI: 19 breaking changes in 7 versions. Below, its 7 versions with breaking changes, newest first, removals and renames first, each with its source.
Updated December 4, 2026
On this page
Latest version 3.17.0, released October 17, 2026. Source repository
Its 3.16.0 release drops Python 3.9. Python end of life dates.
pytest-mock 3.17.0 breaking changes
- Removed
pytest_mock.plugin.assert_has_calls_wrapper
pytest_mock.plugin.assert_has_calls_wrapper was removed in pytest-mock 3.17.0 pypi.org - Signature changed
pytest_mock.plugin.assert_wrapper
Was def assert_wrapper(__wrapped_mock_method__: Callable[..., Any], __call_args_attr__: str, *args: Any, **kwargs: Any) -> None; now def assert_wrapper(__wrapped_mock_method__: Callable[..., Any], __call_args_attr__: str | None, *args... pypi.org
pytest-mock 3.16.1 breaking changes
- Behavior changed
mocker.resetall
mocker.resetall() now also resets spy_return and spy_exception on spies, and no longer overwrites attributes with those names on mocks that are not spies. Code relying on the old reset behavior may need to change. github.com - Behavior changed
mocker.stop
When the same object is used in several patches, mocker.stop() now undoes the most recent patch first. Code that relied on the previous order may need to change. github.com - Signature changed
pytest_mock.plugin.assert_has_calls_wrapper
Was def assert_has_calls_wrapper(__wrapped_mock_method__: Callable[..., Any], *args: Any, **kwargs: Any) -> None; now def assert_has_calls_wrapper(__wrapped_mock_method__: Callable[..., Any], __call_list_attr__: str, *args: Any, **kwargs... pypi.org - Signature changed
pytest_mock.plugin.assert_wrapper
Was def assert_wrapper(__wrapped_mock_method__: Callable[..., Any], *args: Any, **kwargs: Any) -> None; now def assert_wrapper(__wrapped_mock_method__: Callable[..., Any], __call_args_attr__: str, *args: Any, **kwargs: Any) -> None. pypi.org - Signature changed
pytest_mock.plugin.MockCacheItem.__init__
Was def __init__(self, mock: MockType, patch: Any | None = None) -> None; now def __init__(self, mock: MockType, patch: Any | None = None, is_spy: bool = False, spy_side_effect: Callable[..., Any] | None = None, reset_mocks: tuple[Any... pypi.org
pytest-mock 3.16.0 breaking changes
- Removed
Python 3.9 is end-of-life and is no longer supported. Users on Python 3.9 must upgrade their interpreter to keep using this release. github.com - Behavior changed
mocker.resetall
Passing return_value=True or side_effect=True to mocker.resetall now also applies to non-callable mocks, such as those from create_autospec(instance=True). Previously both arguments were ignored for them, so review tests that relied on... github.com - Signature changed
pytest_mock.MockerFixture.spy
Was def spy(self, obj: object, name: str, duplicate_iterators: bool = False) -> MockType; now def spy(self, obj: object, name: str, duplicate_iterators: bool = False) -> SpyType. pypi.org
pytest-mock 3.15.1 breaking changes
- Behavior changed
mocker.spy
Iterator duplication in mocker.spy is no longer automatic. Code that spies on iterators must pass duplicate_iterators=True to mocker.spy to get duplicated iterators. github.com - Signature changed
pytest_mock.MockerFixture.spy
Was def spy(self, obj: object, name: str) -> MockType; now def spy(self, obj: object, name: str, duplicate_iterators: bool = False) -> MockType. pypi.org
pytest-mock 3.15.0 breaking changes
- Removed
Python 3.8 is end of life and is no longer supported. Users on Python 3.8 must upgrade Python before installing this release. github.com
pytest-mock 3.0.0 breaking changes
- Removed
Python 2.7 and 3.4 are no longer supported, so users on those versions must upgrade Python before using this release. github.com - Removed
pytest_mock.sys
pytest_mock.sys was removed in pytest-mock 3.0.0 pypi.org - Removed
pytest_mock.text_type
pytest_mock.text_type was removed in pytest-mock 3.0.0 pypi.org - Removed
pytest_mock.unicode_literals
pytest_mock.unicode_literals was removed in pytest-mock 3.0.0 pypi.org
Older versions
1 older version.
Show 1 older version
pytest-mock 2.0.0 breaking changes
- Removed
pytest_mock.mock
The deprecated mock alias to the mocker fixture has been removed. Use the mocker fixture instead. pypi.org - Renamed
mocker.spy
The spy attributes for tracking returned values and raised exceptions are now called spy_return and spy_exception instead of return_value and side_effect. Update code that reads or sets these attributes. github.com
Related packages
- pytest-asyncio
- pytest-cov
- pytest-django
- pytest-env
- pytest-github-actions-annotate-failures
- pytest-rerunfailures
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.