---
title: "pytest-mock 3.17.0 Breaking Changes on PyPI | Since.dev"
description: "What each pytest-mock release removed, renamed or changed: 19 breaking changes in 7 versions on PyPI, each with its source."
canonical_url: https://since.dev/packages/pypi/pytest-mock
last_updated: 2026-12-04
---

# 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

Latest version `3.17.0`, released October 17, 2026. [Source repository](https://github.com/pytest-dev/pytest-mock)

Its 3.16.0 release drops [Python 3.9](https://since.dev/calendar/python/3.9.md). [Python end of life dates](https://since.dev/calendar/python.md).

- From [2.0.0](#v-2-0-0) to [3.17.0](#v-3-17-0): 17 breaking changes in 6 versions.

## pytest-mock 3.17.0 breaking changes

pytest-mock 3.17.0, released October 17, 2026: 2 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](https://pypi.org/project/pytest-mock/3.17.0/)
- **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](https://pypi.org/project/pytest-mock/3.17.0/)

## pytest-mock 3.16.1 breaking changes

pytest-mock 3.16.1, released October 17, 2026: 5 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](https://github.com/pytest-dev/pytest-mock/releases/tag/v3.16.1)
- **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](https://github.com/pytest-dev/pytest-mock/releases/tag/v3.16.1)
- **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](https://pypi.org/project/pytest-mock/3.16.1/)
- **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](https://pypi.org/project/pytest-mock/3.16.1/)
- **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](https://pypi.org/project/pytest-mock/3.16.1/)

## pytest-mock 3.16.0 breaking changes

pytest-mock 3.16.0, released September 27, 2026: 3 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](https://github.com/pytest-dev/pytest-mock/releases/tag/v3.16.0)
- **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](https://github.com/pytest-dev/pytest-mock/releases/tag/v3.16.0)
- **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](https://pypi.org/project/pytest-mock/3.16.0/)

## pytest-mock 3.15.1 breaking changes

pytest-mock 3.15.1, released September 16, 2025: 2 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](https://github.com/pytest-dev/pytest-mock/releases/tag/v3.15.1)
- **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](https://pypi.org/project/pytest-mock/3.15.1/)

## pytest-mock 3.15.0 breaking changes

pytest-mock 3.15.0, released September 4, 2025: 1 breaking change.

- **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](https://github.com/pytest-dev/pytest-mock/releases/tag/v3.15.0)

## pytest-mock 3.0.0 breaking changes

pytest-mock 3.0.0, released March 31, 2020: 4 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](https://github.com/pytest-dev/pytest-mock/releases/tag/v3.0.0)
- **Removed** `pytest_mock.sys`  

pytest_mock.sys was removed in pytest-mock 3.0.0 [pypi.org](https://pypi.org/project/pytest-mock/3.0.0/)
- **Removed** `pytest_mock.text_type`  

pytest_mock.text_type was removed in pytest-mock 3.0.0 [pypi.org](https://pypi.org/project/pytest-mock/3.0.0/)
- **Removed** `pytest_mock.unicode_literals`  

pytest_mock.unicode_literals was removed in pytest-mock 3.0.0 [pypi.org](https://pypi.org/project/pytest-mock/3.0.0/)

## Older versions

1 older version.

### pytest-mock 2.0.0 breaking changes

pytest-mock 2.0.0, released January 4, 2020: 2 breaking changes.

- **Removed** `pytest_mock.mock`  

The deprecated mock alias to the mocker fixture has been removed. Use the mocker fixture instead. [pypi.org](https://pypi.org/project/pytest-mock/2.0.0/)
- **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](https://github.com/pytest-dev/pytest-mock/releases/tag/v2.0.0)

## Related packages

- [pytest-asyncio](https://since.dev/packages/pypi/pytest-asyncio.md)
- [pytest-cov](https://since.dev/packages/pypi/pytest-cov.md)
- [pytest-django](https://since.dev/packages/pypi/pytest-django.md)
- [pytest-env](https://since.dev/packages/pypi/pytest-env.md)
- [pytest-github-actions-annotate-failures](https://since.dev/packages/pypi/pytest-github-actions-annotate-failures.md)
- [pytest-rerunfailures](https://since.dev/packages/pypi/pytest-rerunfailures.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#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.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
