2026-10-17
- #641: Failures of mock assertions such as
assert_called_withare again reported only once, instead of two or three times with the original error from themockmodule 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, 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:
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.