pypi pytest-mock 3.17.0
v3.17.0

3 hours ago

2026-10-17

  • #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: 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: 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.

Don't miss a new pytest-mock release

NewReleases is sending notifications on new releases.