Skip to content

Drop introspection from assert_has_calls and assert_has_awaits - #643

Merged
nicoddemus merged 1 commit into
pytest-dev:mainfrom
nicoddemus:drop-has-calls-introspection
Oct 17, 2026
Merged

nicoddemus merged 1 commit into
pytest-dev:mainfrom
nicoddemus:drop-has-calls-introspection

Conversation

@nicoddemus

@nicoddemus nicoddemus commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Fixes #639.

assert_has_calls and assert_has_awaits pass when the expected calls appear as a contiguous run anywhere in the actual calls (or in any order with any_order=True), but the introspection pytest-mock adds to their failures compares actual and expected calls position by position from the first call. It reports differences between calls that have nothing to do with each other:

m(1); m(2); m(3)
m.assert_has_calls([call(2), call(4)])
AssertionError: Calls not found.
Expected: [call(2), call(4)]
  Actual: [call(1), call(2), call(3)]

pytest introspection follows:

Args:
assert (1,) == (2,)
Args:
assert (2,) == (4,)
Args:
assert (3,) == ()

With this PR, the same failure is reported with the mock's own message only:

    def test_has_calls(mocker):
        m = mocker.stub()
        m(1); m(2); m(3)
>       m.assert_has_calls([mocker.call(2), mocker.call(4)])
E       AssertionError: Calls not found.
E       Expected: [call(2), call(4)]
E         Actual: [call(1), call(2), call(3)]

test_example.py:4: AssertionError

Pairing the calls correctly would need matching logic on top of the handling of every shape accepted as an expected call (call(...), (args, kwargs), (args,), (kwargs,), (name, args), ...), plus call names once mock_calls with child calls and magic methods is taken into account (#625). That handling has been the source of most of the recent bugs in this feature (#234, #617, #623). The mock's own message already lists both the expected and the actual calls, so this PR drops the introspection for these two assertions and keeps only the traceback hiding, like #642 did for assert_any_call and the count assertions.

This removes assert_has_calls_wrapper and _unpack_expected_call. The tests that checked the introspection now check that each accepted shape, calls= by keyword and any_order by position still fail with an AssertionError (the regressions fixed in #617 and #623) and without introspection.

🤖 Generated with Claude Code

The expected calls may match anywhere in the actual calls, so comparing
them position by position from the first call reported differences
between unrelated calls (pytest-dev#639). Pairing them correctly would need yet
more logic on top of the handling of all the shapes accepted as expected
calls, which has been the source of most recent bugs in this feature.
The mock's own message already lists the expected and actual calls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nicoddemus
nicoddemus force-pushed the drop-has-calls-introspection branch from e2aba2a to d83d0a1 Compare October 17, 2026 16:03
@nicoddemus
nicoddemus merged commit 34b87ae into pytest-dev:main Oct 17, 2026
18 checks passed
tonyandrewmeyer pushed a commit to tonyandrewmeyer/cascade that referenced this pull request Oct 21, 2026
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from
3.16.0 to 3.17.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/releases">pytest-mock's
releases</a>.</em></p>
<blockquote>
<h2>v3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/641">#641</a>:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/642">#642</a>:
Mock assertion failures no longer show misleading introspection when
they are not about the arguments of the last call:
<code>assert_called</code>, <code>assert_called_once</code>,
<code>assert_not_called</code>, <code>assert_any_call</code>, their
<code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/643">#643</a>:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>v3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/617">#617</a>:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/623">#623</a>:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/624">#624</a>:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/627">#627</a>:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/629">#629</a>:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/630">#630</a>:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/633">#633</a>:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst">pytest-mock's
changelog</a>.</em></p>
<blockquote>
<h2>3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#641](pytest-dev/pytest-mock#641)
&lt;https://github.com/pytest-dev/pytest-mock/pull/641&gt;</code>_:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><code>[#642](pytest-dev/pytest-mock#642)
&lt;https://github.com/pytest-dev/pytest-mock/pull/642&gt;</code>_: Mock
assertion failures no longer show misleading introspection when they are
not about the arguments of the last call: <code>assert_called</code>,
<code>assert_called_once</code>, <code>assert_not_called</code>,
<code>assert_any_call</code>, their <code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><code>[#643](pytest-dev/pytest-mock#643)
&lt;https://github.com/pytest-dev/pytest-mock/pull/643&gt;</code>_:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#617](pytest-dev/pytest-mock#617)
&lt;https://github.com/pytest-dev/pytest-mock/pull/617&gt;</code>_:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><code>[#623](pytest-dev/pytest-mock#623)
&lt;https://github.com/pytest-dev/pytest-mock/pull/623&gt;</code>_:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><code>[#624](pytest-dev/pytest-mock#624)
&lt;https://github.com/pytest-dev/pytest-mock/pull/624&gt;</code>_:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><code>[#627](pytest-dev/pytest-mock#627)
&lt;https://github.com/pytest-dev/pytest-mock/pull/627&gt;</code>_:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><code>[#629](pytest-dev/pytest-mock#629)
&lt;https://github.com/pytest-dev/pytest-mock/pull/629&gt;</code>_:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><code>[#630](pytest-dev/pytest-mock#630)
&lt;https://github.com/pytest-dev/pytest-mock/pull/630&gt;</code>_:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><code>[#633](pytest-dev/pytest-mock#633)
&lt;https://github.com/pytest-dev/pytest-mock/pull/633&gt;</code>_:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5c2f207ca7098dde996f9bedd06e596e39b6246b"><code>5c2f207</code></a>
Release 3.17.0</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/96252715fad4a0dfec1997103cc231bc1f133616"><code>9625271</code></a>
Bump the minor version for releases that change existing behavior</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/34b87aeeef1d2a85be5ce4fadb0c6bc4a033c40a"><code>34b87ae</code></a>
Drop introspection from assert_has_calls and assert_has_awaits (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/643">#643</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/866520f2d339c7649af56ac227ca67ed36b1e92e"><code>866520f</code></a>
Only show introspection for failures about the call arguments (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/642">#642</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5ab41c143c57842456caad0029082e919fa6a95d"><code>5ab41c1</code></a>
Do not chain the original mock error to wrapped assertion failures (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/641">#641</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/1916b14db224b893edf18251f26a38487eb0d6a6"><code>1916b14</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/635">#635</a>
from nicoddemus/docs-contributing-resetall</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/212fcd903aeb685a3b39875be82fc84ff58ebc56"><code>212fcd9</code></a>
Document resetall, the changelog format and running tests with tox</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/9374b2c3e38e3bbc2e04328f7026ae3680f0476f"><code>9374b2c</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/634">#634</a>
from pytest-dev/release-3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/fab730daf4a4cfc260d8656b0467503131535a00"><code>fab730d</code></a>
Release 3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/d26d41bb01e99de5c0b59156c667d46985b03470"><code>d26d41b</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/627">#627</a>
from xiehuanyi/docs/async-stub-awaits-20261012-r2</li>
<li>Additional commits viewable in <a
href="https://github.com/pytest-dev/pytest-mock/compare/v3.16.0...v3.17.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pytest-mock&package-manager=uv&previous-version=3.16.0&new-version=3.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
github-actions Bot added a commit to mikelane/reddit-get that referenced this pull request Oct 21, 2026
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from
3.16.0 to 3.17.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/releases">pytest-mock's
releases</a>.</em></p>
<blockquote>
<h2>v3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/641">#641</a>:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/642">#642</a>:
Mock assertion failures no longer show misleading introspection when
they are not about the arguments of the last call:
<code>assert_called</code>, <code>assert_called_once</code>,
<code>assert_not_called</code>, <code>assert_any_call</code>, their
<code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/643">#643</a>:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>v3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/617">#617</a>:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/623">#623</a>:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/624">#624</a>:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/627">#627</a>:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/629">#629</a>:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/630">#630</a>:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/633">#633</a>:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst">pytest-mock's
changelog</a>.</em></p>
<blockquote>
<h2>3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#641](pytest-dev/pytest-mock#641)
&lt;https://github.com/pytest-dev/pytest-mock/pull/641&gt;</code>_:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><code>[#642](pytest-dev/pytest-mock#642)
&lt;https://github.com/pytest-dev/pytest-mock/pull/642&gt;</code>_: Mock
assertion failures no longer show misleading introspection when they are
not about the arguments of the last call: <code>assert_called</code>,
<code>assert_called_once</code>, <code>assert_not_called</code>,
<code>assert_any_call</code>, their <code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><code>[#643](pytest-dev/pytest-mock#643)
&lt;https://github.com/pytest-dev/pytest-mock/pull/643&gt;</code>_:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#617](pytest-dev/pytest-mock#617)
&lt;https://github.com/pytest-dev/pytest-mock/pull/617&gt;</code>_:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><code>[#623](pytest-dev/pytest-mock#623)
&lt;https://github.com/pytest-dev/pytest-mock/pull/623&gt;</code>_:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><code>[#624](pytest-dev/pytest-mock#624)
&lt;https://github.com/pytest-dev/pytest-mock/pull/624&gt;</code>_:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><code>[#627](pytest-dev/pytest-mock#627)
&lt;https://github.com/pytest-dev/pytest-mock/pull/627&gt;</code>_:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><code>[#629](pytest-dev/pytest-mock#629)
&lt;https://github.com/pytest-dev/pytest-mock/pull/629&gt;</code>_:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><code>[#630](pytest-dev/pytest-mock#630)
&lt;https://github.com/pytest-dev/pytest-mock/pull/630&gt;</code>_:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><code>[#633](pytest-dev/pytest-mock#633)
&lt;https://github.com/pytest-dev/pytest-mock/pull/633&gt;</code>_:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5c2f207ca7098dde996f9bedd06e596e39b6246b"><code>5c2f207</code></a>
Release 3.17.0</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/96252715fad4a0dfec1997103cc231bc1f133616"><code>9625271</code></a>
Bump the minor version for releases that change existing behavior</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/34b87aeeef1d2a85be5ce4fadb0c6bc4a033c40a"><code>34b87ae</code></a>
Drop introspection from assert_has_calls and assert_has_awaits (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/643">#643</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/866520f2d339c7649af56ac227ca67ed36b1e92e"><code>866520f</code></a>
Only show introspection for failures about the call arguments (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/642">#642</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5ab41c143c57842456caad0029082e919fa6a95d"><code>5ab41c1</code></a>
Do not chain the original mock error to wrapped assertion failures (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/641">#641</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/1916b14db224b893edf18251f26a38487eb0d6a6"><code>1916b14</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/635">#635</a>
from nicoddemus/docs-contributing-resetall</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/212fcd903aeb685a3b39875be82fc84ff58ebc56"><code>212fcd9</code></a>
Document resetall, the changelog format and running tests with tox</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/9374b2c3e38e3bbc2e04328f7026ae3680f0476f"><code>9374b2c</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/634">#634</a>
from pytest-dev/release-3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/fab730daf4a4cfc260d8656b0467503131535a00"><code>fab730d</code></a>
Release 3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/d26d41bb01e99de5c0b59156c667d46985b03470"><code>d26d41b</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/627">#627</a>
from xiehuanyi/docs/async-stub-awaits-20261012-r2</li>
<li>Additional commits viewable in <a
href="https://github.com/pytest-dev/pytest-mock/compare/v3.16.0...v3.17.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pytest-mock&package-manager=pip&previous-version=3.16.0&new-version=3.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
Eric-Arellano pushed a commit to IBM/qauvern that referenced this pull request Oct 21, 2026
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from
3.16.0 to 3.17.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/releases">pytest-mock's
releases</a>.</em></p>
<blockquote>
<h2>v3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/641">#641</a>:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/642">#642</a>:
Mock assertion failures no longer show misleading introspection when
they are not about the arguments of the last call:
<code>assert_called</code>, <code>assert_called_once</code>,
<code>assert_not_called</code>, <code>assert_any_call</code>, their
<code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/643">#643</a>:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>v3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/617">#617</a>:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/623">#623</a>:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/624">#624</a>:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/627">#627</a>:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/629">#629</a>:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/630">#630</a>:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/633">#633</a>:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst">pytest-mock's
changelog</a>.</em></p>
<blockquote>
<h2>3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#641](pytest-dev/pytest-mock#641)
&lt;https://github.com/pytest-dev/pytest-mock/pull/641&gt;</code>_:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><code>[#642](pytest-dev/pytest-mock#642)
&lt;https://github.com/pytest-dev/pytest-mock/pull/642&gt;</code>_: Mock
assertion failures no longer show misleading introspection when they are
not about the arguments of the last call: <code>assert_called</code>,
<code>assert_called_once</code>, <code>assert_not_called</code>,
<code>assert_any_call</code>, their <code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><code>[#643](pytest-dev/pytest-mock#643)
&lt;https://github.com/pytest-dev/pytest-mock/pull/643&gt;</code>_:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#617](pytest-dev/pytest-mock#617)
&lt;https://github.com/pytest-dev/pytest-mock/pull/617&gt;</code>_:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><code>[#623](pytest-dev/pytest-mock#623)
&lt;https://github.com/pytest-dev/pytest-mock/pull/623&gt;</code>_:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><code>[#624](pytest-dev/pytest-mock#624)
&lt;https://github.com/pytest-dev/pytest-mock/pull/624&gt;</code>_:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><code>[#627](pytest-dev/pytest-mock#627)
&lt;https://github.com/pytest-dev/pytest-mock/pull/627&gt;</code>_:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><code>[#629](pytest-dev/pytest-mock#629)
&lt;https://github.com/pytest-dev/pytest-mock/pull/629&gt;</code>_:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><code>[#630](pytest-dev/pytest-mock#630)
&lt;https://github.com/pytest-dev/pytest-mock/pull/630&gt;</code>_:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><code>[#633](pytest-dev/pytest-mock#633)
&lt;https://github.com/pytest-dev/pytest-mock/pull/633&gt;</code>_:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5c2f207ca7098dde996f9bedd06e596e39b6246b"><code>5c2f207</code></a>
Release 3.17.0</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/96252715fad4a0dfec1997103cc231bc1f133616"><code>9625271</code></a>
Bump the minor version for releases that change existing behavior</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/34b87aeeef1d2a85be5ce4fadb0c6bc4a033c40a"><code>34b87ae</code></a>
Drop introspection from assert_has_calls and assert_has_awaits (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/643">#643</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/866520f2d339c7649af56ac227ca67ed36b1e92e"><code>866520f</code></a>
Only show introspection for failures about the call arguments (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/642">#642</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5ab41c143c57842456caad0029082e919fa6a95d"><code>5ab41c1</code></a>
Do not chain the original mock error to wrapped assertion failures (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/641">#641</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/1916b14db224b893edf18251f26a38487eb0d6a6"><code>1916b14</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/635">#635</a>
from nicoddemus/docs-contributing-resetall</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/212fcd903aeb685a3b39875be82fc84ff58ebc56"><code>212fcd9</code></a>
Document resetall, the changelog format and running tests with tox</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/9374b2c3e38e3bbc2e04328f7026ae3680f0476f"><code>9374b2c</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/634">#634</a>
from pytest-dev/release-3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/fab730daf4a4cfc260d8656b0467503131535a00"><code>fab730d</code></a>
Release 3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/d26d41bb01e99de5c0b59156c667d46985b03470"><code>d26d41b</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/627">#627</a>
from xiehuanyi/docs/async-stub-awaits-20261012-r2</li>
<li>Additional commits viewable in <a
href="https://github.com/pytest-dev/pytest-mock/compare/v3.16.0...v3.17.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pytest-mock&package-manager=uv&previous-version=3.16.0&new-version=3.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
github-actions Bot pushed a commit to aio-libs/aiohttp that referenced this pull request Oct 21, 2026
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from
3.16.0 to 3.17.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/releases">pytest-mock's
releases</a>.</em></p>
<blockquote>
<h2>v3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/641">#641</a>:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/642">#642</a>:
Mock assertion failures no longer show misleading introspection when
they are not about the arguments of the last call:
<code>assert_called</code>, <code>assert_called_once</code>,
<code>assert_not_called</code>, <code>assert_any_call</code>, their
<code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/643">#643</a>:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>v3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/617">#617</a>:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/623">#623</a>:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/624">#624</a>:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/627">#627</a>:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/629">#629</a>:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/630">#630</a>:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/633">#633</a>:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst">pytest-mock's
changelog</a>.</em></p>
<blockquote>
<h2>3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#641](pytest-dev/pytest-mock#641)
&lt;https://github.com/pytest-dev/pytest-mock/pull/641&gt;</code>_:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><code>[#642](pytest-dev/pytest-mock#642)
&lt;https://github.com/pytest-dev/pytest-mock/pull/642&gt;</code>_: Mock
assertion failures no longer show misleading introspection when they are
not about the arguments of the last call: <code>assert_called</code>,
<code>assert_called_once</code>, <code>assert_not_called</code>,
<code>assert_any_call</code>, their <code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><code>[#643](pytest-dev/pytest-mock#643)
&lt;https://github.com/pytest-dev/pytest-mock/pull/643&gt;</code>_:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#617](pytest-dev/pytest-mock#617)
&lt;https://github.com/pytest-dev/pytest-mock/pull/617&gt;</code>_:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><code>[#623](pytest-dev/pytest-mock#623)
&lt;https://github.com/pytest-dev/pytest-mock/pull/623&gt;</code>_:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><code>[#624](pytest-dev/pytest-mock#624)
&lt;https://github.com/pytest-dev/pytest-mock/pull/624&gt;</code>_:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><code>[#627](pytest-dev/pytest-mock#627)
&lt;https://github.com/pytest-dev/pytest-mock/pull/627&gt;</code>_:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><code>[#629](pytest-dev/pytest-mock#629)
&lt;https://github.com/pytest-dev/pytest-mock/pull/629&gt;</code>_:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><code>[#630](pytest-dev/pytest-mock#630)
&lt;https://github.com/pytest-dev/pytest-mock/pull/630&gt;</code>_:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><code>[#633](pytest-dev/pytest-mock#633)
&lt;https://github.com/pytest-dev/pytest-mock/pull/633&gt;</code>_:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5c2f207ca7098dde996f9bedd06e596e39b6246b"><code>5c2f207</code></a>
Release 3.17.0</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/96252715fad4a0dfec1997103cc231bc1f133616"><code>9625271</code></a>
Bump the minor version for releases that change existing behavior</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/34b87aeeef1d2a85be5ce4fadb0c6bc4a033c40a"><code>34b87ae</code></a>
Drop introspection from assert_has_calls and assert_has_awaits (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/643">#643</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/866520f2d339c7649af56ac227ca67ed36b1e92e"><code>866520f</code></a>
Only show introspection for failures about the call arguments (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/642">#642</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5ab41c143c57842456caad0029082e919fa6a95d"><code>5ab41c1</code></a>
Do not chain the original mock error to wrapped assertion failures (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/641">#641</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/1916b14db224b893edf18251f26a38487eb0d6a6"><code>1916b14</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/635">#635</a>
from nicoddemus/docs-contributing-resetall</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/212fcd903aeb685a3b39875be82fc84ff58ebc56"><code>212fcd9</code></a>
Document resetall, the changelog format and running tests with tox</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/9374b2c3e38e3bbc2e04328f7026ae3680f0476f"><code>9374b2c</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/634">#634</a>
from pytest-dev/release-3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/fab730daf4a4cfc260d8656b0467503131535a00"><code>fab730d</code></a>
Release 3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/d26d41bb01e99de5c0b59156c667d46985b03470"><code>d26d41b</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/627">#627</a>
from xiehuanyi/docs/async-stub-awaits-20261012-r2</li>
<li>Additional commits viewable in <a
href="https://github.com/pytest-dev/pytest-mock/compare/v3.16.0...v3.17.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pytest-mock&package-manager=pip&previous-version=3.16.0&new-version=3.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
github-actions Bot pushed a commit to aio-libs/aiohttp that referenced this pull request Oct 21, 2026
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from
3.16.0 to 3.17.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/releases">pytest-mock's
releases</a>.</em></p>
<blockquote>
<h2>v3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/641">#641</a>:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/642">#642</a>:
Mock assertion failures no longer show misleading introspection when
they are not about the arguments of the last call:
<code>assert_called</code>, <code>assert_called_once</code>,
<code>assert_not_called</code>, <code>assert_any_call</code>, their
<code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/643">#643</a>:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>v3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/617">#617</a>:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/623">#623</a>:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/624">#624</a>:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/627">#627</a>:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/629">#629</a>:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/630">#630</a>:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/633">#633</a>:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst">pytest-mock's
changelog</a>.</em></p>
<blockquote>
<h2>3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#641](pytest-dev/pytest-mock#641)
&lt;https://github.com/pytest-dev/pytest-mock/pull/641&gt;</code>_:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><code>[#642](pytest-dev/pytest-mock#642)
&lt;https://github.com/pytest-dev/pytest-mock/pull/642&gt;</code>_: Mock
assertion failures no longer show misleading introspection when they are
not about the arguments of the last call: <code>assert_called</code>,
<code>assert_called_once</code>, <code>assert_not_called</code>,
<code>assert_any_call</code>, their <code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><code>[#643](pytest-dev/pytest-mock#643)
&lt;https://github.com/pytest-dev/pytest-mock/pull/643&gt;</code>_:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#617](pytest-dev/pytest-mock#617)
&lt;https://github.com/pytest-dev/pytest-mock/pull/617&gt;</code>_:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><code>[#623](pytest-dev/pytest-mock#623)
&lt;https://github.com/pytest-dev/pytest-mock/pull/623&gt;</code>_:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><code>[#624](pytest-dev/pytest-mock#624)
&lt;https://github.com/pytest-dev/pytest-mock/pull/624&gt;</code>_:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><code>[#627](pytest-dev/pytest-mock#627)
&lt;https://github.com/pytest-dev/pytest-mock/pull/627&gt;</code>_:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><code>[#629](pytest-dev/pytest-mock#629)
&lt;https://github.com/pytest-dev/pytest-mock/pull/629&gt;</code>_:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><code>[#630](pytest-dev/pytest-mock#630)
&lt;https://github.com/pytest-dev/pytest-mock/pull/630&gt;</code>_:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><code>[#633](pytest-dev/pytest-mock#633)
&lt;https://github.com/pytest-dev/pytest-mock/pull/633&gt;</code>_:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5c2f207ca7098dde996f9bedd06e596e39b6246b"><code>5c2f207</code></a>
Release 3.17.0</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/96252715fad4a0dfec1997103cc231bc1f133616"><code>9625271</code></a>
Bump the minor version for releases that change existing behavior</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/34b87aeeef1d2a85be5ce4fadb0c6bc4a033c40a"><code>34b87ae</code></a>
Drop introspection from assert_has_calls and assert_has_awaits (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/643">#643</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/866520f2d339c7649af56ac227ca67ed36b1e92e"><code>866520f</code></a>
Only show introspection for failures about the call arguments (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/642">#642</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5ab41c143c57842456caad0029082e919fa6a95d"><code>5ab41c1</code></a>
Do not chain the original mock error to wrapped assertion failures (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/641">#641</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/1916b14db224b893edf18251f26a38487eb0d6a6"><code>1916b14</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/635">#635</a>
from nicoddemus/docs-contributing-resetall</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/212fcd903aeb685a3b39875be82fc84ff58ebc56"><code>212fcd9</code></a>
Document resetall, the changelog format and running tests with tox</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/9374b2c3e38e3bbc2e04328f7026ae3680f0476f"><code>9374b2c</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/634">#634</a>
from pytest-dev/release-3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/fab730daf4a4cfc260d8656b0467503131535a00"><code>fab730d</code></a>
Release 3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/d26d41bb01e99de5c0b59156c667d46985b03470"><code>d26d41b</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/627">#627</a>
from xiehuanyi/docs/async-stub-awaits-20261012-r2</li>
<li>Additional commits viewable in <a
href="https://github.com/pytest-dev/pytest-mock/compare/v3.16.0...v3.17.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pytest-mock&package-manager=pip&previous-version=3.16.0&new-version=3.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
github-merge-queue Bot pushed a commit to CDCgov/dibbs-text-to-code that referenced this pull request Oct 21, 2026
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from
3.15.1 to 3.17.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/releases">pytest-mock's
releases</a>.</em></p>
<blockquote>
<h2>v3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/641">#641</a>:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/642">#642</a>:
Mock assertion failures no longer show misleading introspection when
they are not about the arguments of the last call:
<code>assert_called</code>, <code>assert_called_once</code>,
<code>assert_not_called</code>, <code>assert_any_call</code>, their
<code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/643">#643</a>:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>v3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/617">#617</a>:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/623">#623</a>:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/624">#624</a>:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/627">#627</a>:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/629">#629</a>:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/630">#630</a>:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/633">#633</a>:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
<h2>v3.16.0</h2>
<p><em>2026-09-27</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/604">#604</a>:
Fixed <code>duplicate_iterators=True</code> for async functions spied
with <code>mocker.spy</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/611">#611</a>:
Fixed async mock assertion introspection to use awaited arguments
instead of the latest call's arguments.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/606">#606</a>:
<code>mocker.resetall(return_value=True, side_effect=True)</code> now
also applies to non-callable mocks, such as those returned by
<code>mocker.create_autospec(SomeClass, instance=True)</code>.
Previously both arguments were silently ignored for them.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/547">#547</a>:
Added <code>SpyType</code> for annotating <code>mocker.spy</code>
results.</li>
<li>Dropped support for EOL Python 3.9.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/147">#147</a>:
Removed handling of <code>RuntimeError: stop called on unstarted
patcher</code>, which can no longer occur in the supported Python
versions.</li>
<li>Added support for Python 3.15.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst">pytest-mock's
changelog</a>.</em></p>
<blockquote>
<h2>3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#641](pytest-dev/pytest-mock#641)
&lt;https://github.com/pytest-dev/pytest-mock/pull/641&gt;</code>_:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><code>[#642](pytest-dev/pytest-mock#642)
&lt;https://github.com/pytest-dev/pytest-mock/pull/642&gt;</code>_: Mock
assertion failures no longer show misleading introspection when they are
not about the arguments of the last call: <code>assert_called</code>,
<code>assert_called_once</code>, <code>assert_not_called</code>,
<code>assert_any_call</code>, their <code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><code>[#643](pytest-dev/pytest-mock#643)
&lt;https://github.com/pytest-dev/pytest-mock/pull/643&gt;</code>_:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#617](pytest-dev/pytest-mock#617)
&lt;https://github.com/pytest-dev/pytest-mock/pull/617&gt;</code>_:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><code>[#623](pytest-dev/pytest-mock#623)
&lt;https://github.com/pytest-dev/pytest-mock/pull/623&gt;</code>_:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><code>[#624](pytest-dev/pytest-mock#624)
&lt;https://github.com/pytest-dev/pytest-mock/pull/624&gt;</code>_:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><code>[#627](pytest-dev/pytest-mock#627)
&lt;https://github.com/pytest-dev/pytest-mock/pull/627&gt;</code>_:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><code>[#629](pytest-dev/pytest-mock#629)
&lt;https://github.com/pytest-dev/pytest-mock/pull/629&gt;</code>_:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><code>[#630](pytest-dev/pytest-mock#630)
&lt;https://github.com/pytest-dev/pytest-mock/pull/630&gt;</code>_:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><code>[#633](pytest-dev/pytest-mock#633)
&lt;https://github.com/pytest-dev/pytest-mock/pull/633&gt;</code>_:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
<h2>3.16.0</h2>
<p><em>2026-09-27</em></p>
<ul>
<li><code>[#604](pytest-dev/pytest-mock#604)
&lt;https://github.com/pytest-dev/pytest-mock/pull/604&gt;</code>_:
Fixed <code>duplicate_iterators=True</code> for async functions spied
with <code>mocker.spy</code>.</li>
<li><code>[#611](pytest-dev/pytest-mock#611)
&lt;https://github.com/pytest-dev/pytest-mock/pull/611&gt;</code>_:
Fixed async mock assertion introspection to use awaited arguments
instead of the latest call's arguments.</li>
<li><code>[#606](pytest-dev/pytest-mock#606)
&lt;https://github.com/pytest-dev/pytest-mock/pull/606&gt;</code>_:
<code>mocker.resetall(return_value=True, side_effect=True)</code> now
also applies to non-callable mocks, such as those returned by
<code>mocker.create_autospec(SomeClass, instance=True)</code>.
Previously both arguments were silently ignored for them.</li>
<li><code>[#547](pytest-dev/pytest-mock#547)
&lt;https://github.com/pytest-dev/pytest-mock/issues/547&gt;</code>_:
Added <code>SpyType</code> for annotating <code>mocker.spy</code>
results.</li>
<li>Dropped support for EOL Python 3.9.</li>
<li><code>[#147](pytest-dev/pytest-mock#147)
&lt;https://github.com/pytest-dev/pytest-mock/issues/147&gt;</code>_:
Removed handling of <code>RuntimeError: stop called on unstarted
patcher</code>, which can no longer occur in the supported Python
versions.</li>
<li>Added support for Python 3.15.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5c2f207ca7098dde996f9bedd06e596e39b6246b"><code>5c2f207</code></a>
Release 3.17.0</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/96252715fad4a0dfec1997103cc231bc1f133616"><code>9625271</code></a>
Bump the minor version for releases that change existing behavior</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/34b87aeeef1d2a85be5ce4fadb0c6bc4a033c40a"><code>34b87ae</code></a>
Drop introspection from assert_has_calls and assert_has_awaits (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/643">#643</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/866520f2d339c7649af56ac227ca67ed36b1e92e"><code>866520f</code></a>
Only show introspection for failures about the call arguments (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/642">#642</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5ab41c143c57842456caad0029082e919fa6a95d"><code>5ab41c1</code></a>
Do not chain the original mock error to wrapped assertion failures (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/641">#641</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/1916b14db224b893edf18251f26a38487eb0d6a6"><code>1916b14</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/635">#635</a>
from nicoddemus/docs-contributing-resetall</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/212fcd903aeb685a3b39875be82fc84ff58ebc56"><code>212fcd9</code></a>
Document resetall, the changelog format and running tests with tox</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/9374b2c3e38e3bbc2e04328f7026ae3680f0476f"><code>9374b2c</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/634">#634</a>
from pytest-dev/release-3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/fab730daf4a4cfc260d8656b0467503131535a00"><code>fab730d</code></a>
Release 3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/d26d41bb01e99de5c0b59156c667d46985b03470"><code>d26d41b</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/627">#627</a>
from xiehuanyi/docs/async-stub-awaits-20261012-r2</li>
<li>Additional commits viewable in <a
href="https://github.com/pytest-dev/pytest-mock/compare/v3.15.1...v3.17.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pytest-mock&package-manager=uv&previous-version=3.15.1&new-version=3.17.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
jkennedyvz pushed a commit to langchain-ai/langchain-litellm that referenced this pull request Oct 23, 2026
…ates (#381)

Bumps the python-deps group with 3 updates in the / directory:
[pydantic](https://github.com/pydantic/pydantic),
[pytest-mock](https://github.com/pytest-dev/pytest-mock) and
[ruff](https://github.com/astral-sh/ruff).

Updates `pydantic` from 2.14.0 to 2.14.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pydantic/pydantic/releases">pydantic's
releases</a>.</em></p>
<blockquote>
<h2>v2.14.1 2026-10-11</h2>
<h3>What's Changed</h3>
<h4>Performance</h4>
<ul>
<li>Avoid Python tuple allocation during model fields validation by <a
href="https://github.com/Viicos"><code>@​Viicos</code></a> in <a
href="https://redirect.github.com/pydantic/pydantic/pull/13955">#13955</a></li>
<li>Avoid unnecessary extra dict allocation in model validation by <a
href="https://github.com/Viicos"><code>@​Viicos</code></a> in <a
href="https://redirect.github.com/pydantic/pydantic/pull/13956">#13956</a></li>
</ul>
<h4>Fixes</h4>
<ul>
<li>Fix <code>arguments-v3</code> schema with variadic keywords by <a
href="https://github.com/Viicos"><code>@​Viicos</code></a> in <a
href="https://redirect.github.com/pydantic/pydantic/pull/13954">#13954</a></li>
<li>Fix <code>TypeError</code> on <code>ForwardRef</code> on Python
3.10.0 by <a href="https://github.com/Viicos"><code>@​Viicos</code></a>
in <a
href="https://redirect.github.com/pydantic/pydantic/pull/13964">#13964</a></li>
<li>Support <code>closed</code> and <code>extra_items</code> via
inheritance in <code>TypedDict</code> by <a
href="https://github.com/Viicos"><code>@​Viicos</code></a> in <a
href="https://redirect.github.com/pydantic/pydantic/pull/13967">#13967</a></li>
<li>Enforce the <code>max_digits</code> whole-digits limit in the Python
<code>Decimal</code> validator by <a
href="https://github.com/Viicos"><code>@​Viicos</code></a> in <a
href="https://redirect.github.com/pydantic/pydantic/pull/13972">#13972</a></li>
<li>Reject out-of-range int inputs for <code>timedelta</code> by <a
href="https://github.com/Viicos"><code>@​Viicos</code></a> in <a
href="https://redirect.github.com/pydantic/pydantic/pull/13973">#13973</a></li>
<li>Support named tuples in <code>Sequence</code> validation by <a
href="https://github.com/Viicos"><code>@​Viicos</code></a> in <a
href="https://redirect.github.com/pydantic/pydantic/pull/13978">#13978</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/pydantic/pydantic/compare/v2.14.0...v2.14.1">https://github.com/pydantic/pydantic/compare/v2.14.0...v2.14.1</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pydantic/pydantic/blob/main/HISTORY.md">pydantic's
changelog</a>.</em></p>
<blockquote>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pydantic/pydantic/commit/b2212c787fb5c73386dc770681ec49cd09da8e73"><code>b2212c7</code></a>
Prepare release v2.14.1</li>
<li><a
href="https://github.com/pydantic/pydantic/commit/968fb2b6eed196a3f17ca9a3aa4697b518614531"><code>968fb2b</code></a>
Fix docs conversion table</li>
<li><a
href="https://github.com/pydantic/pydantic/commit/6adc8b3f6146cabf290bdefd51c87486dd659091"><code>6adc8b3</code></a>
Support named tuples in <code>Sequence</code> validation</li>
<li><a
href="https://github.com/pydantic/pydantic/commit/7637fbc31c91f86870c3b34d220d5b7fd62c54db"><code>7637fbc</code></a>
Reject out-of-range int inputs for <code>timedelta</code></li>
<li><a
href="https://github.com/pydantic/pydantic/commit/dfdbfcb5fa6cf0ae291cb8aebc5bf2153670fe9c"><code>dfdbfcb</code></a>
Enforce the <code>max_digits</code> whole-digits limit in the Python
<code>Decimal</code> validator</li>
<li><a
href="https://github.com/pydantic/pydantic/commit/e2456d3161d0969b917fc769b2e06b7e076cb886"><code>e2456d3</code></a>
Support <code>closed</code> and <code>extra_items</code> via inheritance
in <code>TypedDict</code></li>
<li><a
href="https://github.com/pydantic/pydantic/commit/317655dfe022ebfc818c8e8e744b671fe53d8c3f"><code>317655d</code></a>
Harden CI security</li>
<li><a
href="https://github.com/pydantic/pydantic/commit/3ba1dd48939542a04748a9bcfd3248496fa0bcc5"><code>3ba1dd4</code></a>
Fix <code>TypeError</code> on <code>ForwardRef</code> on Python
3.10.0</li>
<li><a
href="https://github.com/pydantic/pydantic/commit/43681abc488119808fcdae2f60cadd5520ceed26"><code>43681ab</code></a>
Bump <code>samuelcolvin/check-python-version</code> action to v5.1</li>
<li><a
href="https://github.com/pydantic/pydantic/commit/d6bc53a8559d93814009eb2043db133a90f7f921"><code>d6bc53a</code></a>
Avoid unnecessary extra dict allocation in model validation</li>
<li>See full diff in <a
href="https://github.com/pydantic/pydantic/compare/v2.14.0...v2.14.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `pytest-mock` from 3.16.0 to 3.17.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/releases">pytest-mock's
releases</a>.</em></p>
<blockquote>
<h2>v3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/641">#641</a>:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/642">#642</a>:
Mock assertion failures no longer show misleading introspection when
they are not about the arguments of the last call:
<code>assert_called</code>, <code>assert_called_once</code>,
<code>assert_not_called</code>, <code>assert_any_call</code>, their
<code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/643">#643</a>:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>v3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/617">#617</a>:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/623">#623</a>:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/624">#624</a>:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/627">#627</a>:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/629">#629</a>:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/630">#630</a>:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/633">#633</a>:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst">pytest-mock's
changelog</a>.</em></p>
<blockquote>
<h2>3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#641](pytest-dev/pytest-mock#641)
&lt;https://github.com/pytest-dev/pytest-mock/pull/641&gt;</code>_:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><code>[#642](pytest-dev/pytest-mock#642)
&lt;https://github.com/pytest-dev/pytest-mock/pull/642&gt;</code>_: Mock
assertion failures no longer show misleading introspection when they are
not about the arguments of the last call: <code>assert_called</code>,
<code>assert_called_once</code>, <code>assert_not_called</code>,
<code>assert_any_call</code>, their <code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><code>[#643](pytest-dev/pytest-mock#643)
&lt;https://github.com/pytest-dev/pytest-mock/pull/643&gt;</code>_:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#617](pytest-dev/pytest-mock#617)
&lt;https://github.com/pytest-dev/pytest-mock/pull/617&gt;</code>_:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><code>[#623](pytest-dev/pytest-mock#623)
&lt;https://github.com/pytest-dev/pytest-mock/pull/623&gt;</code>_:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><code>[#624](pytest-dev/pytest-mock#624)
&lt;https://github.com/pytest-dev/pytest-mock/pull/624&gt;</code>_:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><code>[#627](pytest-dev/pytest-mock#627)
&lt;https://github.com/pytest-dev/pytest-mock/pull/627&gt;</code>_:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><code>[#629](pytest-dev/pytest-mock#629)
&lt;https://github.com/pytest-dev/pytest-mock/pull/629&gt;</code>_:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><code>[#630](pytest-dev/pytest-mock#630)
&lt;https://github.com/pytest-dev/pytest-mock/pull/630&gt;</code>_:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><code>[#633](pytest-dev/pytest-mock#633)
&lt;https://github.com/pytest-dev/pytest-mock/pull/633&gt;</code>_:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5c2f207ca7098dde996f9bedd06e596e39b6246b"><code>5c2f207</code></a>
Release 3.17.0</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/96252715fad4a0dfec1997103cc231bc1f133616"><code>9625271</code></a>
Bump the minor version for releases that change existing behavior</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/34b87aeeef1d2a85be5ce4fadb0c6bc4a033c40a"><code>34b87ae</code></a>
Drop introspection from assert_has_calls and assert_has_awaits (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/643">#643</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/866520f2d339c7649af56ac227ca67ed36b1e92e"><code>866520f</code></a>
Only show introspection for failures about the call arguments (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/642">#642</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5ab41c143c57842456caad0029082e919fa6a95d"><code>5ab41c1</code></a>
Do not chain the original mock error to wrapped assertion failures (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/641">#641</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/1916b14db224b893edf18251f26a38487eb0d6a6"><code>1916b14</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/635">#635</a>
from nicoddemus/docs-contributing-resetall</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/212fcd903aeb685a3b39875be82fc84ff58ebc56"><code>212fcd9</code></a>
Document resetall, the changelog format and running tests with tox</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/9374b2c3e38e3bbc2e04328f7026ae3680f0476f"><code>9374b2c</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/634">#634</a>
from pytest-dev/release-3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/fab730daf4a4cfc260d8656b0467503131535a00"><code>fab730d</code></a>
Release 3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/d26d41bb01e99de5c0b59156c667d46985b03470"><code>d26d41b</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/627">#627</a>
from xiehuanyi/docs/async-stub-awaits-20261012-r2</li>
<li>Additional commits viewable in <a
href="https://github.com/pytest-dev/pytest-mock/compare/v3.16.0...v3.17.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `ruff` from 0.17.0 to 0.17.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/ruff/releases">ruff's
releases</a>.</em></p>
<blockquote>
<h2>0.17.1</h2>
<h2>Release Notes</h2>
<p>Released on 2026-10-15.</p>
<h3>Preview features</h3>
<ul>
<li>[<code>pycodestyle</code>] Don't treat <code>None</code>,
<code>True</code>, or <code>False</code> as keywords
(<code>E271</code>-<code>E274</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29322">#29322</a>)</li>
</ul>
<h3>Bug fixes</h3>
<ul>
<li>Fix dedent with multiple leading comments (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29382">#29382</a>)</li>
<li>[<code>flake8-pyi</code>] Detect legacy positional-only parameters
in <code>__new__</code> methods (<code>PYI063</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/28502">#28502</a>)</li>
<li>[<code>flake8-pyi</code>] Fix false positives on quoted annotations
(<code>PYI036</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29274">#29274</a>)</li>
<li>[<code>perflint</code>] Avoid invalid comprehension suggestions
(<code>PERF401</code>, <code>PERF403</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29366">#29366</a>)</li>
</ul>
<h3>Rule changes</h3>
<ul>
<li>Treat more <code>collections</code> and <code>weakref</code>
containers as mutable (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29213">#29213</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>[<code>flake8-import-conventions</code>] Update default and example
<code>aliases</code> (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29333">#29333</a>)</li>
</ul>
<h3>Contributors</h3>
<ul>
<li><a href="https://github.com/fixfon"><code>@​fixfon</code></a></li>
<li><a href="https://github.com/mmaxjr"><code>@​mmaxjr</code></a></li>
<li><a
href="https://github.com/joshuavetos"><code>@​joshuavetos</code></a></li>
<li><a
href="https://github.com/nekomario28"><code>@​nekomario28</code></a></li>
<li><a href="https://github.com/ntBre"><code>@​ntBre</code></a></li>
<li><a
href="https://github.com/shan3520"><code>@​shan3520</code></a></li>
</ul>
<h2>Install ruff 0.17.1</h2>
<h3>Install prebuilt binaries via shell script</h3>
<pre lang="sh"><code>curl --proto '=https' --tlsv1.2 -LsSf
https://releases.astral.sh/github/ruff/releases/download/0.17.1/ruff-installer.sh
| sh
</code></pre>
<h3>Install prebuilt binaries via powershell script</h3>
<pre lang="sh"><code>powershell -ExecutionPolicy Bypass -c &quot;irm
https://releases.astral.sh/github/ruff/releases/download/0.17.1/ruff-installer.ps1
| iex&quot;
</code></pre>
<h2>Download ruff 0.17.1</h2>
<p>|  File  | Platform | Checksum |</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md">ruff's
changelog</a>.</em></p>
<blockquote>
<h2>0.17.1</h2>
<p>Released on 2026-10-15.</p>
<h3>Preview features</h3>
<ul>
<li>[<code>pycodestyle</code>] Don't treat <code>None</code>,
<code>True</code>, or <code>False</code> as keywords
(<code>E271</code>-<code>E274</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29322">#29322</a>)</li>
</ul>
<h3>Bug fixes</h3>
<ul>
<li>Fix dedent with multiple leading comments (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29382">#29382</a>)</li>
<li>[<code>flake8-pyi</code>] Detect legacy positional-only parameters
in <code>__new__</code> methods (<code>PYI063</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/28502">#28502</a>)</li>
<li>[<code>flake8-pyi</code>] Fix false positives on quoted annotations
(<code>PYI036</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29274">#29274</a>)</li>
<li>[<code>perflint</code>] Avoid invalid comprehension suggestions
(<code>PERF401</code>, <code>PERF403</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29366">#29366</a>)</li>
</ul>
<h3>Rule changes</h3>
<ul>
<li>Treat more <code>collections</code> and <code>weakref</code>
containers as mutable (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29213">#29213</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>[<code>flake8-import-conventions</code>] Update default and example
<code>aliases</code> (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29333">#29333</a>)</li>
</ul>
<h3>Contributors</h3>
<ul>
<li><a href="https://github.com/fixfon"><code>@​fixfon</code></a></li>
<li><a href="https://github.com/mmaxjr"><code>@​mmaxjr</code></a></li>
<li><a
href="https://github.com/joshuavetos"><code>@​joshuavetos</code></a></li>
<li><a
href="https://github.com/nekomario28"><code>@​nekomario28</code></a></li>
<li><a href="https://github.com/ntBre"><code>@​ntBre</code></a></li>
<li><a
href="https://github.com/shan3520"><code>@​shan3520</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/astral-sh/ruff/commit/4683270c69cbdaf6ad64d3f983fc458d5a43b41f"><code>4683270</code></a>
Bump version to 0.17.1 (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29420">#29420</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/3514027edb659bbc3c787d355be9d130e5587f15"><code>3514027</code></a>
[ty] Update typing conformance suite pin (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29417">#29417</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/829455624d78f2e89669e4b4b14af2b96abdb1ae"><code>8294556</code></a>
Update referenced PR security-review workflow (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29237">#29237</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/d1e1b1f69b511df4385f64b510eeec4da01c1a0e"><code>d1e1b1f</code></a>
[ty] Preserve recursive aliases when rebuilding intersections (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29057">#29057</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/93526150df078af7dd8fc4226cdcc469539d2001"><code>9352615</code></a>
[<code>perflint</code>] Avoid invalid comprehension suggestions
(<code>PERF401</code>, <code>PERF403</code>) (...</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/83a3afc3156d73ae4296f3fa74ede28e4c72bfcd"><code>83a3afc</code></a>
Fix dedent with multiple leading comments (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29382">#29382</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/b42a8734410230f4529151782cae951b99bed858"><code>b42a873</code></a>
[ty] Clarify object attribute write-contract rationale (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29384">#29384</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/d01678ebf594c97a7767d4372061c1f80ae5b5bb"><code>d01678e</code></a>
[ty] Clarify object attribute write-contract rationale (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29384">#29384</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/355b42a7719d8a555e3ee50c89848b42d8a11eb5"><code>355b42a</code></a>
[ty] Avoid writable override contracts from object (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29373">#29373</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/e26e6d2a54ac2c5e1f5b1945042de3ff3885bf8e"><code>e26e6d2</code></a>
[ty] Collect intersection inference through constraint relations (<a
href="https://redirect.github.com/astral-sh/ruff/issues/28677">#28677</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/astral-sh/ruff/compare/0.17.0...0.17.1">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
jkennedyvz pushed a commit to langchain-ai/langchain-sema4 that referenced this pull request Oct 23, 2026
…ectory with 2 updates (#34)

Bumps the development-dependencies group with 2 updates in the
/libs/sema4 directory:
[pytest-mock](https://github.com/pytest-dev/pytest-mock) and
[ruff](https://github.com/astral-sh/ruff).

Updates `pytest-mock` from 3.16.0 to 3.17.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/releases">pytest-mock's
releases</a>.</em></p>
<blockquote>
<h2>v3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/641">#641</a>:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/642">#642</a>:
Mock assertion failures no longer show misleading introspection when
they are not about the arguments of the last call:
<code>assert_called</code>, <code>assert_called_once</code>,
<code>assert_not_called</code>, <code>assert_any_call</code>, their
<code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/643">#643</a>:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>v3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/617">#617</a>:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/621">#621</a>:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/623">#623</a>:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/624">#624</a>:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/627">#627</a>:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/629">#629</a>:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/630">#630</a>:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><a
href="https://redirect.github.com/pytest-dev/pytest-mock/pull/633">#633</a>:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst">pytest-mock's
changelog</a>.</em></p>
<blockquote>
<h2>3.17.0</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#641](pytest-dev/pytest-mock#641)
&lt;https://github.com/pytest-dev/pytest-mock/pull/641&gt;</code>_:
Failures of mock assertions such as <code>assert_called_with</code> are
again reported only once, instead of two or three times with the
original error from the <code>mock</code> module chained before
them.</li>
<li><code>[#642](pytest-dev/pytest-mock#642)
&lt;https://github.com/pytest-dev/pytest-mock/pull/642&gt;</code>_: Mock
assertion failures no longer show misleading introspection when they are
not about the arguments of the last call: <code>assert_called</code>,
<code>assert_called_once</code>, <code>assert_not_called</code>,
<code>assert_any_call</code>, their <code>await</code> counterparts, and
<code>assert_called_once_with</code>/<code>assert_awaited_once_with</code>
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
<code>Args:</code>/<code>Kwargs:</code> sections when assertion
rewriting is not available.</li>
<li><code>[#643](pytest-dev/pytest-mock#643)
&lt;https://github.com/pytest-dev/pytest-mock/pull/643&gt;</code>_:
<code>assert_has_calls</code> and <code>assert_has_awaits</code>
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.</li>
</ul>
<h2>3.16.1</h2>
<p><em>2026-10-17</em></p>
<ul>
<li><code>[#617](pytest-dev/pytest-mock#617)
&lt;https://github.com/pytest-dev/pytest-mock/pull/617&gt;</code>_:
Fixed <code>assert_has_calls</code> raising <code>ValueError</code>
instead of <code>AssertionError</code> (or showing misleading
introspection) when the expected calls are plain tuples rather than
<code>call(...)</code> objects, such as <code>(args, kwargs)</code>
entries of another mock's <code>call_args_list</code>,
<code>(args,)</code>, <code>(kwargs,)</code>, <code>(name, args)</code>
or <code>(name, kwargs)</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
Fixed <code>mocker.stop()</code> sometimes stopping the wrong mock, for
example with mocks from <code>mocker.create_autospec</code>.</li>
<li><code>[#621](pytest-dev/pytest-mock#621)
&lt;https://github.com/pytest-dev/pytest-mock/pull/621&gt;</code>_:
<code>mocker.stop()</code> now undoes the most recent patch first when
the same object is used in several patches.</li>
<li><code>[#623](pytest-dev/pytest-mock#623)
&lt;https://github.com/pytest-dev/pytest-mock/pull/623&gt;</code>_:
Fixed misleading introspection in <code>assert_has_awaits</code>
failures, and
<code>assert_has_calls</code>/<code>assert_has_awaits</code> raising
<code>IndexError</code> instead of <code>AssertionError</code> when
<code>calls</code> is passed by keyword.</li>
<li><code>[#624](pytest-dev/pytest-mock#624)
&lt;https://github.com/pytest-dev/pytest-mock/pull/624&gt;</code>_:
Clear <code>spy_return_iter</code> after a spied synchronous or
asynchronous function raises, matching <code>spy_return</code>.</li>
<li><code>[#627](pytest-dev/pytest-mock#627)
&lt;https://github.com/pytest-dev/pytest-mock/pull/627&gt;</code>_:
Document <code>async_stub</code> await assertions and the distinction
between call and await tracking.</li>
<li><code>[#629](pytest-dev/pytest-mock#629)
&lt;https://github.com/pytest-dev/pytest-mock/pull/629&gt;</code>_:
Fixed <code>mocker.resetall()</code> skipping the mocks patched with
<code>mocker.patch.multiple()</code>, both the ones it creates and the
ones passed explicitly.</li>
<li><code>[#630](pytest-dev/pytest-mock#630)
&lt;https://github.com/pytest-dev/pytest-mock/pull/630&gt;</code>_:
<code>mocker.resetall()</code> now also resets <code>spy_return</code>
and <code>spy_exception</code> of spies, like it already did for
<code>spy_return_list</code> and <code>spy_return_iter</code>, and no
longer overwrites attributes with these names on mocks that are not
spies.</li>
<li><code>[#633](pytest-dev/pytest-mock#633)
&lt;https://github.com/pytest-dev/pytest-mock/pull/633&gt;</code>_:
Fixed spies on <code>classmethod</code>, <code>staticmethod</code>,
builtins and classes returning a <code>MagicMock</code> instead of
calling the spied code after
<code>mocker.resetall(side_effect=True)</code>. Resetting a spy's
<code>side_effect</code> now goes back to calling the spied code, also
clearing any <code>side_effect</code> set on the spy.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5c2f207ca7098dde996f9bedd06e596e39b6246b"><code>5c2f207</code></a>
Release 3.17.0</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/96252715fad4a0dfec1997103cc231bc1f133616"><code>9625271</code></a>
Bump the minor version for releases that change existing behavior</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/34b87aeeef1d2a85be5ce4fadb0c6bc4a033c40a"><code>34b87ae</code></a>
Drop introspection from assert_has_calls and assert_has_awaits (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/643">#643</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/866520f2d339c7649af56ac227ca67ed36b1e92e"><code>866520f</code></a>
Only show introspection for failures about the call arguments (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/642">#642</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/5ab41c143c57842456caad0029082e919fa6a95d"><code>5ab41c1</code></a>
Do not chain the original mock error to wrapped assertion failures (<a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/641">#641</a>)</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/1916b14db224b893edf18251f26a38487eb0d6a6"><code>1916b14</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/635">#635</a>
from nicoddemus/docs-contributing-resetall</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/212fcd903aeb685a3b39875be82fc84ff58ebc56"><code>212fcd9</code></a>
Document resetall, the changelog format and running tests with tox</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/9374b2c3e38e3bbc2e04328f7026ae3680f0476f"><code>9374b2c</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/634">#634</a>
from pytest-dev/release-3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/fab730daf4a4cfc260d8656b0467503131535a00"><code>fab730d</code></a>
Release 3.16.1</li>
<li><a
href="https://github.com/pytest-dev/pytest-mock/commit/d26d41bb01e99de5c0b59156c667d46985b03470"><code>d26d41b</code></a>
Merge pull request <a
href="https://redirect.github.com/pytest-dev/pytest-mock/issues/627">#627</a>
from xiehuanyi/docs/async-stub-awaits-20261012-r2</li>
<li>Additional commits viewable in <a
href="https://github.com/pytest-dev/pytest-mock/compare/v3.16.0...v3.17.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `ruff` from 0.17.0 to 0.17.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/ruff/releases">ruff's
releases</a>.</em></p>
<blockquote>
<h2>0.17.1</h2>
<h2>Release Notes</h2>
<p>Released on 2026-10-15.</p>
<h3>Preview features</h3>
<ul>
<li>[<code>pycodestyle</code>] Don't treat <code>None</code>,
<code>True</code>, or <code>False</code> as keywords
(<code>E271</code>-<code>E274</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29322">#29322</a>)</li>
</ul>
<h3>Bug fixes</h3>
<ul>
<li>Fix dedent with multiple leading comments (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29382">#29382</a>)</li>
<li>[<code>flake8-pyi</code>] Detect legacy positional-only parameters
in <code>__new__</code> methods (<code>PYI063</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/28502">#28502</a>)</li>
<li>[<code>flake8-pyi</code>] Fix false positives on quoted annotations
(<code>PYI036</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29274">#29274</a>)</li>
<li>[<code>perflint</code>] Avoid invalid comprehension suggestions
(<code>PERF401</code>, <code>PERF403</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29366">#29366</a>)</li>
</ul>
<h3>Rule changes</h3>
<ul>
<li>Treat more <code>collections</code> and <code>weakref</code>
containers as mutable (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29213">#29213</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>[<code>flake8-import-conventions</code>] Update default and example
<code>aliases</code> (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29333">#29333</a>)</li>
</ul>
<h3>Contributors</h3>
<ul>
<li><a href="https://github.com/fixfon"><code>@​fixfon</code></a></li>
<li><a href="https://github.com/mmaxjr"><code>@​mmaxjr</code></a></li>
<li><a
href="https://github.com/joshuavetos"><code>@​joshuavetos</code></a></li>
<li><a
href="https://github.com/nekomario28"><code>@​nekomario28</code></a></li>
<li><a href="https://github.com/ntBre"><code>@​ntBre</code></a></li>
<li><a
href="https://github.com/shan3520"><code>@​shan3520</code></a></li>
</ul>
<h2>Install ruff 0.17.1</h2>
<h3>Install prebuilt binaries via shell script</h3>
<pre lang="sh"><code>curl --proto '=https' --tlsv1.2 -LsSf
https://releases.astral.sh/github/ruff/releases/download/0.17.1/ruff-installer.sh
| sh
</code></pre>
<h3>Install prebuilt binaries via powershell script</h3>
<pre lang="sh"><code>powershell -ExecutionPolicy Bypass -c &quot;irm
https://releases.astral.sh/github/ruff/releases/download/0.17.1/ruff-installer.ps1
| iex&quot;
</code></pre>
<h2>Download ruff 0.17.1</h2>
<p>|  File  | Platform | Checksum |</p>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md">ruff's
changelog</a>.</em></p>
<blockquote>
<h2>0.17.1</h2>
<p>Released on 2026-10-15.</p>
<h3>Preview features</h3>
<ul>
<li>[<code>pycodestyle</code>] Don't treat <code>None</code>,
<code>True</code>, or <code>False</code> as keywords
(<code>E271</code>-<code>E274</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29322">#29322</a>)</li>
</ul>
<h3>Bug fixes</h3>
<ul>
<li>Fix dedent with multiple leading comments (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29382">#29382</a>)</li>
<li>[<code>flake8-pyi</code>] Detect legacy positional-only parameters
in <code>__new__</code> methods (<code>PYI063</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/28502">#28502</a>)</li>
<li>[<code>flake8-pyi</code>] Fix false positives on quoted annotations
(<code>PYI036</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29274">#29274</a>)</li>
<li>[<code>perflint</code>] Avoid invalid comprehension suggestions
(<code>PERF401</code>, <code>PERF403</code>) (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29366">#29366</a>)</li>
</ul>
<h3>Rule changes</h3>
<ul>
<li>Treat more <code>collections</code> and <code>weakref</code>
containers as mutable (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29213">#29213</a>)</li>
</ul>
<h3>Documentation</h3>
<ul>
<li>[<code>flake8-import-conventions</code>] Update default and example
<code>aliases</code> (<a
href="https://redirect.github.com/astral-sh/ruff/pull/29333">#29333</a>)</li>
</ul>
<h3>Contributors</h3>
<ul>
<li><a href="https://github.com/fixfon"><code>@​fixfon</code></a></li>
<li><a href="https://github.com/mmaxjr"><code>@​mmaxjr</code></a></li>
<li><a
href="https://github.com/joshuavetos"><code>@​joshuavetos</code></a></li>
<li><a
href="https://github.com/nekomario28"><code>@​nekomario28</code></a></li>
<li><a href="https://github.com/ntBre"><code>@​ntBre</code></a></li>
<li><a
href="https://github.com/shan3520"><code>@​shan3520</code></a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/astral-sh/ruff/commit/4683270c69cbdaf6ad64d3f983fc458d5a43b41f"><code>4683270</code></a>
Bump version to 0.17.1 (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29420">#29420</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/3514027edb659bbc3c787d355be9d130e5587f15"><code>3514027</code></a>
[ty] Update typing conformance suite pin (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29417">#29417</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/829455624d78f2e89669e4b4b14af2b96abdb1ae"><code>8294556</code></a>
Update referenced PR security-review workflow (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29237">#29237</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/d1e1b1f69b511df4385f64b510eeec4da01c1a0e"><code>d1e1b1f</code></a>
[ty] Preserve recursive aliases when rebuilding intersections (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29057">#29057</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/93526150df078af7dd8fc4226cdcc469539d2001"><code>9352615</code></a>
[<code>perflint</code>] Avoid invalid comprehension suggestions
(<code>PERF401</code>, <code>PERF403</code>) (...</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/83a3afc3156d73ae4296f3fa74ede28e4c72bfcd"><code>83a3afc</code></a>
Fix dedent with multiple leading comments (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29382">#29382</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/b42a8734410230f4529151782cae951b99bed858"><code>b42a873</code></a>
[ty] Clarify object attribute write-contract rationale (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29384">#29384</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/d01678ebf594c97a7767d4372061c1f80ae5b5bb"><code>d01678e</code></a>
[ty] Clarify object attribute write-contract rationale (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29384">#29384</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/355b42a7719d8a555e3ee50c89848b42d8a11eb5"><code>355b42a</code></a>
[ty] Avoid writable override contracts from object (<a
href="https://redirect.github.com/astral-sh/ruff/issues/29373">#29373</a>)</li>
<li><a
href="https://github.com/astral-sh/ruff/commit/e26e6d2a54ac2c5e1f5b1945042de3ff3885bf8e"><code>e26e6d2</code></a>
[ty] Collect intersection inference through constraint relations (<a
href="https://redirect.github.com/astral-sh/ruff/issues/28677">#28677</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/astral-sh/ruff/compare/0.17.0...0.17.1">compare
view</a></li>
</ul>
</details>
<br />

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

assert_has_calls/assert_has_awaits introspection pairs the wrong calls

1 participant