chore(deps): update dependency pytest-mock to >=3.17.0 #736

Merged
tobru merged 1 commit from renovate/pytest-mock-3.x into main 2026-10-29 09:14:13 +00:00
Member

This PR contains the following updates:

Package Change Age Confidence
pytest-mock (changelog) >=3.16.0 → >=3.17.0 age confidence

Release Notes

pytest-dev/pytest-mock (pytest-mock)

v3.17.0

Compare Source

2026-10-17

  • #&#8203;641 <https://github.com/pytest-dev/pytest-mock/pull/641>_: Failures of mock assertions such as assert_called_with are again reported only once, instead of two or three times with the original error from the mock module chained before them.
  • #&#8203;642 <https://github.com/pytest-dev/pytest-mock/pull/642>_: Mock assertion failures no longer show misleading introspection when they are not about the arguments of the last call: assert_called, assert_called_once, assert_not_called, assert_any_call, their await counterparts, and assert_called_once_with/assert_awaited_once_with when the mock was not called (awaited) exactly once. The introspection also no longer reports arguments passed by position versus by keyword as different for autospecced mocks, and no longer shows empty Args:/Kwargs: sections when assertion rewriting is not available.
  • #&#8203;643 <https://github.com/pytest-dev/pytest-mock/pull/643>_: assert_has_calls and assert_has_awaits failures no longer show pytest introspection, which compared the expected and actual calls position by position and so reported differences between unrelated calls. The mock's own message, listing the expected and actual calls, is still shown.

v3.16.1

Compare Source

2026-10-17

  • #&#8203;617 <https://github.com/pytest-dev/pytest-mock/pull/617>_: Fixed assert_has_calls raising ValueError instead of AssertionError (or showing misleading introspection) when the expected calls are plain tuples rather than call(...) objects, such as (args, kwargs) entries of another mock's call_args_list, (args,), (kwargs,), (name, args) or (name, kwargs).
  • #&#8203;621 <https://github.com/pytest-dev/pytest-mock/pull/621>_: Fixed mocker.stop() sometimes stopping the wrong mock, for example with mocks from mocker.create_autospec.
  • #&#8203;621 <https://github.com/pytest-dev/pytest-mock/pull/621>_: mocker.stop() now undoes the most recent patch first when the same object is used in several patches.
  • #&#8203;623 <https://github.com/pytest-dev/pytest-mock/pull/623>_: Fixed misleading introspection in assert_has_awaits failures, and assert_has_calls/assert_has_awaits raising IndexError instead of AssertionError when calls is passed by keyword.
  • #&#8203;624 <https://github.com/pytest-dev/pytest-mock/pull/624>_: Clear spy_return_iter after a spied synchronous or asynchronous function raises, matching spy_return.
  • #&#8203;627 <https://github.com/pytest-dev/pytest-mock/pull/627>_: Document async_stub await assertions and the distinction between call and await tracking.
  • #&#8203;629 <https://github.com/pytest-dev/pytest-mock/pull/629>_: Fixed mocker.resetall() skipping the mocks patched with mocker.patch.multiple(), both the ones it creates and the ones passed explicitly.
  • #&#8203;630 <https://github.com/pytest-dev/pytest-mock/pull/630>_: mocker.resetall() now also resets spy_return and spy_exception of spies, like it already did for spy_return_list and spy_return_iter, and no longer overwrites attributes with these names on mocks that are not spies.
  • #&#8203;633 <https://github.com/pytest-dev/pytest-mock/pull/633>_: Fixed spies on classmethod, staticmethod, builtins and classes returning a MagicMock instead of calling the spied code after mocker.resetall(side_effect=True). Resetting a spy's side_effect now goes back to calling the spied code, also clearing any side_effect set on the spy.

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [pytest-mock](https://github.com/pytest-dev/pytest-mock) ([changelog](https://pytest-mock.readthedocs.io/en/latest/changelog.html)) | `>=3.16.0` → `>=3.17.0` | ![age](https://developer.mend.io/api/mc/badges/age/pypi/pytest-mock/3.17.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/pytest-mock/3.16.0/3.17.0?slim=true) | --- ### Release Notes <details> <summary>pytest-dev/pytest-mock (pytest-mock)</summary> ### [`v3.17.0`](https://github.com/pytest-dev/pytest-mock/blob/HEAD/CHANGELOG.rst#3170) [Compare Source](https://github.com/pytest-dev/pytest-mock/compare/v3.16.1...v3.17.0) *2026-10-17* - `#&#8203;641 <https://github.com/pytest-dev/pytest-mock/pull/641>`\_: Failures of mock assertions such as `assert_called_with` are again reported only once, instead of two or three times with the original error from the `mock` module chained before them. - `#&#8203;642 <https://github.com/pytest-dev/pytest-mock/pull/642>`\_: Mock assertion failures no longer show misleading introspection when they are not about the arguments of the last call: `assert_called`, `assert_called_once`, `assert_not_called`, `assert_any_call`, their `await` counterparts, and `assert_called_once_with`/`assert_awaited_once_with` when the mock was not called (awaited) exactly once. The introspection also no longer reports arguments passed by position versus by keyword as different for autospecced mocks, and no longer shows empty `Args:`/`Kwargs:` sections when assertion rewriting is not available. - `#&#8203;643 <https://github.com/pytest-dev/pytest-mock/pull/643>`\_: `assert_has_calls` and `assert_has_awaits` failures no longer show pytest introspection, which compared the expected and actual calls position by position and so reported differences between unrelated calls. The mock's own message, listing the expected and actual calls, is still shown. ### [`v3.16.1`](https://github.com/pytest-dev/pytest-mock/blob/HEAD/CHANGELOG.rst#3161) [Compare Source](https://github.com/pytest-dev/pytest-mock/compare/v3.16.0...v3.16.1) *2026-10-17* - `#&#8203;617 <https://github.com/pytest-dev/pytest-mock/pull/617>`\_: Fixed `assert_has_calls` raising `ValueError` instead of `AssertionError` (or showing misleading introspection) when the expected calls are plain tuples rather than `call(...)` objects, such as `(args, kwargs)` entries of another mock's `call_args_list`, `(args,)`, `(kwargs,)`, `(name, args)` or `(name, kwargs)`. - `#&#8203;621 <https://github.com/pytest-dev/pytest-mock/pull/621>`\_: Fixed `mocker.stop()` sometimes stopping the wrong mock, for example with mocks from `mocker.create_autospec`. - `#&#8203;621 <https://github.com/pytest-dev/pytest-mock/pull/621>`\_: `mocker.stop()` now undoes the most recent patch first when the same object is used in several patches. - `#&#8203;623 <https://github.com/pytest-dev/pytest-mock/pull/623>`\_: Fixed misleading introspection in `assert_has_awaits` failures, and `assert_has_calls`/`assert_has_awaits` raising `IndexError` instead of `AssertionError` when `calls` is passed by keyword. - `#&#8203;624 <https://github.com/pytest-dev/pytest-mock/pull/624>`\_: Clear `spy_return_iter` after a spied synchronous or asynchronous function raises, matching `spy_return`. - `#&#8203;627 <https://github.com/pytest-dev/pytest-mock/pull/627>`\_: Document `async_stub` await assertions and the distinction between call and await tracking. - `#&#8203;629 <https://github.com/pytest-dev/pytest-mock/pull/629>`\_: Fixed `mocker.resetall()` skipping the mocks patched with `mocker.patch.multiple()`, both the ones it creates and the ones passed explicitly. - `#&#8203;630 <https://github.com/pytest-dev/pytest-mock/pull/630>`\_: `mocker.resetall()` now also resets `spy_return` and `spy_exception` of spies, like it already did for `spy_return_list` and `spy_return_iter`, and no longer overwrites attributes with these names on mocks that are not spies. - `#&#8203;633 <https://github.com/pytest-dev/pytest-mock/pull/633>`\_: Fixed spies on `classmethod`, `staticmethod`, builtins and classes returning a `MagicMock` instead of calling the spied code after `mocker.resetall(side_effect=True)`. Resetting a spy's `side_effect` now goes back to calling the spied code, also clearing any `side_effect` set on the spy. </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xNzYuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjE3Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->
tobru merged commit 9ab40a14ff into main 2026-10-29 09:14:13 +00:00
tobru deleted branch renovate/pytest-mock-3.x 2026-10-29 09:14:13 +00:00
Sign in to join this conversation.
No description provided.