Skip to content

Update pytest-mock to 3.16.0 - #757

Open
pyup-bot wants to merge 1 commit into
masterfrom
pyup-update-pytest-mock-3.11.1-to-3.16.0
Open

pyup-bot wants to merge 1 commit into
masterfrom
pyup-update-pytest-mock-3.11.1-to-3.16.0

Conversation

@pyup-bot

Copy link
Copy Markdown
Collaborator

This PR updates pytest-mock from 3.11.1 to 3.16.0.

Changelog

3.16.0

------

*2026-09-27*

* `604 <https://github.com/pytest-dev/pytest-mock/pull/604>`_: Fixed ``duplicate_iterators=True`` for async functions spied with ``mocker.spy``.
* `611 <https://github.com/pytest-dev/pytest-mock/pull/611>`_: Fixed async mock assertion introspection to use awaited arguments instead of the latest call's arguments.
* `606 <https://github.com/pytest-dev/pytest-mock/pull/606>`_: ``mocker.resetall(return_value=True, side_effect=True)`` now also applies to non-callable mocks, such as those returned by ``mocker.create_autospec(SomeClass, instance=True)``. Previously both arguments were silently ignored for them.
* `547 <https://github.com/pytest-dev/pytest-mock/issues/547>`_: Added ``SpyType`` for annotating ``mocker.spy`` results.
* Dropped support for EOL Python 3.9.
* `147 <https://github.com/pytest-dev/pytest-mock/issues/147>`_: Removed handling of ``RuntimeError: stop called on unstarted patcher``, which can no longer occur in the supported Python versions.
* Added support for Python 3.15.

3.15.1

------

*2025-09-16*

* `529 <https://github.com/pytest-dev/pytest-mock/issues/529>`_: Fixed ``itertools._tee object has no attribute error`` -- now ``duplicate_iterators=True`` must be passed to ``mocker.spy`` to duplicate iterators.

3.15.0

------

*2025-09-04*

* Python 3.8 (EOL) is no longer supported.
* `524 <https://github.com/pytest-dev/pytest-mock/pull/524>`_: Added ``spy_return_iter`` to ``mocker.spy``, which contains a duplicate of the return value of the spied method if it is an ``Iterator``.

3.14.1

-------------------

* `503 <https://github.com/pytest-dev/pytest-mock/pull/503>`_: Python 3.14 is now officially supported.

3.14.0

-------------------

* `415 <https://github.com/pytest-dev/pytest-mock/pull/415>`_: ``MockType`` and ``AsyncMockType`` can be imported from ``pytest_mock`` for type annotation purposes.

* `420 <https://github.com/pytest-dev/pytest-mock/issues/420>`_: Fixed a regression which would cause ``mocker.patch.object`` to not being properly cleared between tests.

3.13.0

-------------------

* `417 <https://github.com/pytest-dev/pytest-mock/pull/417>`_: ``spy`` now has ``spy_return_list``, which is a list containing all the values returned by the spied function.
* ``pytest-mock`` now requires ``pytest>=6.2.5``.
* `410 <https://github.com/pytest-dev/pytest-mock/pull/410>`_: pytest-mock's ``setup.py`` file is removed.
If you relied on this file, e.g. to install pytest using ``setup.py install``,
please see `Why you shouldn't invoke setup.py directly <https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html#summary>`_ for alternatives.

3.12.0

-------------------

* Added support for Python 3.12.
* Dropped support for EOL Python 3.7.
* ``mocker.resetall()`` now also resets mocks created by ``mocker.create_autospec`` (`390`_).

.. _390: https://github.com/pytest-dev/pytest-mock/pull/390
Links

@codecov

codecov Bot commented Sep 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5f02dc7) to head (931f778).

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #757   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines          126       126           
=========================================
  Hits           126       126           
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant