Skip to content

Conversation

pyup-bot
Copy link
Collaborator

This PR updates pytest-mock from 3.4.0 to 3.15.1.

Changelog

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

3.11.1

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

(This release source code is identical to ``3.11.0`` except a small internal fix to deployment/CI)

* Fixed introspection for failed ``assert_has_calls`` (`365`_).

* Updated type annotations for ``mocker.patch`` and ``mocker.spy`` (`364`_).

.. _365: https://github.com/pytest-dev/pytest-mock/pull/365
.. _364: https://github.com/pytest-dev/pytest-mock/pull/364

3.11.0

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

* Fixed introspection for failed ``assert_has_calls`` (`365`_).

* Updated type annotations for ``mocker.patch`` and ``mocker.spy`` (`364`_).

.. _365: https://github.com/pytest-dev/pytest-mock/pull/365
.. _364: https://github.com/pytest-dev/pytest-mock/pull/364

3.10.0

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

* Added new ``mocker.stop(m)`` method to stop specific ``mocker.patch`` or ``mocker.spy`` calls (`319`_).

.. _319: https://github.com/pytest-dev/pytest-mock/pull/319

3.9.0

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

* Expose ``NonCallableMagicMock`` via the ``mocker`` fixture (`318`_).

.. _318: https://github.com/pytest-dev/pytest-mock/pull/318

3.8.2

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

- Fixed ``AsyncMock`` support for Python 3.7+ in ``mocker.async_stub`` (`302`_).

.. _302: https://github.com/pytest-dev/pytest-mock/pull/302

3.8.1

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

* Fixed regression caused by an explicit ``mock`` dependency in the code (`298`_).

.. _298: https://github.com/pytest-dev/pytest-mock/issues/298

3.8.0

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

* Add ``MockerFixture.async_mock`` method. Thanks `PerchunPak`_ for the PR (`296`_).

.. _PerchunPak: https://github.com/PerchunPak
.. _296: https://github.com/pytest-dev/pytest-mock/pull/296

3.7.0

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

* Python 3.10 now officially supported.
* Dropped support for Python 3.6.

3.6.1

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

* Fix ``mocker.resetall()`` when using ``mocker.spy()`` (`237`_). Thanks `blaxter`_ for the report and `shadycuz`_ for the PR.

.. _blaxter: https://github.com/blaxter
.. _shadycuz: https://github.com/shadycuz
.. _237: https://github.com/pytest-dev/pytest-mock/issues/237

3.6.0

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

* pytest-mock no longer supports Python 3.5.

* Correct type annotations for ``mocker.patch.object`` to also include the string form.
Thanks `plannigan`_ for the PR (`235`_).

* ``reset_all`` now supports ``return_value`` and ``side_effect`` keyword arguments. Thanks `alex-marty`_ for the PR (`214`_).

.. _alex-marty: https://github.com/alex-marty
.. _plannigan: https://github.com/plannigan
.. _214: https://github.com/pytest-dev/pytest-mock/pull/214
.. _235: https://github.com/pytest-dev/pytest-mock/pull/235

3.5.1

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

* Use ``inspect.getattr_static`` instead of resorting to ``object.__getattribute__``
magic. This should better comply with objects which implement a custom descriptor
protocol. Thanks `yesthesoup`_ for the PR (`224`_).

.. _yesthesoup: https://github.com/yesthesoup
.. _224: https://github.com/pytest-dev/pytest-mock/pull/224

3.5.0

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

* Now all patch functions will emit a warning instead of raising a ``ValueError`` when used
as a context-manager. Thanks `iforapsy`_ for the PR (`221`_).

* Additionally, ``mocker.patch.context_manager`` is available when the user intends to mock
a context manager (for example  ``threading.Lock`` object), which will not emit that
warning.

.. _iforapsy: https://github.com/iforapsy
.. _221: https://github.com/pytest-dev/pytest-mock/pull/221
Links

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