You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore(deps): update dependency pytest-mock to v3.17.0 - #856
#​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.
#​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.
#​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.
#​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).
#​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.
#​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.
#​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.
#​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.
#​627 <https://github.com/pytest-dev/pytest-mock/pull/627>_: Document async_stub await assertions and the distinction between call and await tracking.
#​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.
#​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.
#​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
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer TIP This summary will be updated as you push new changes.
❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
3.16.0→3.17.0Release Notes
pytest-dev/pytest-mock (pytest-mock)
v3.17.0Compare Source
2026-10-17
#​641 <https://github.com/pytest-dev/pytest-mock/pull/641>_: Failures of mock assertions such asassert_called_withare again reported only once, instead of two or three times with the original error from themockmodule chained before them.#​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, theirawaitcounterparts, andassert_called_once_with/assert_awaited_once_withwhen 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 emptyArgs:/Kwargs:sections when assertion rewriting is not available.#​643 <https://github.com/pytest-dev/pytest-mock/pull/643>_:assert_has_callsandassert_has_awaitsfailures 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.1Compare Source
2026-10-17
#​617 <https://github.com/pytest-dev/pytest-mock/pull/617>_: Fixedassert_has_callsraisingValueErrorinstead ofAssertionError(or showing misleading introspection) when the expected calls are plain tuples rather thancall(...)objects, such as(args, kwargs)entries of another mock'scall_args_list,(args,),(kwargs,),(name, args)or(name, kwargs).#​621 <https://github.com/pytest-dev/pytest-mock/pull/621>_: Fixedmocker.stop()sometimes stopping the wrong mock, for example with mocks frommocker.create_autospec.#​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.#​623 <https://github.com/pytest-dev/pytest-mock/pull/623>_: Fixed misleading introspection inassert_has_awaitsfailures, andassert_has_calls/assert_has_awaitsraisingIndexErrorinstead ofAssertionErrorwhencallsis passed by keyword.#​624 <https://github.com/pytest-dev/pytest-mock/pull/624>_: Clearspy_return_iterafter a spied synchronous or asynchronous function raises, matchingspy_return.#​627 <https://github.com/pytest-dev/pytest-mock/pull/627>_: Documentasync_stubawait assertions and the distinction between call and await tracking.#​629 <https://github.com/pytest-dev/pytest-mock/pull/629>_: Fixedmocker.resetall()skipping the mocks patched withmocker.patch.multiple(), both the ones it creates and the ones passed explicitly.#​630 <https://github.com/pytest-dev/pytest-mock/pull/630>_:mocker.resetall()now also resetsspy_returnandspy_exceptionof spies, like it already did forspy_return_listandspy_return_iter, and no longer overwrites attributes with these names on mocks that are not spies.#​633 <https://github.com/pytest-dev/pytest-mock/pull/633>_: Fixed spies onclassmethod,staticmethod, builtins and classes returning aMagicMockinstead of calling the spied code aftermocker.resetall(side_effect=True). Resetting a spy'sside_effectnow goes back to calling the spied code, also clearing anyside_effectset on the spy.Configuration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.