Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pytest-mock to 3.7.0 #507

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pyup-bot
Copy link
Collaborator

This PR updates pytest-mock from 3.3.1 to 3.7.0.

Changelog

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

3.4.0

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

* Add `mock.seal` alias to the `mocker` fixture (`211`_). Thanks `coiax`_ for the PR.

* Fixed spying on exceptions not covered by the ``Exception``
superclass (`215`_), like ``KeyboardInterrupt`` -- PR `216`_
by `webknjaz`_.

Before the fix, both ``spy_return`` and ``spy_exception``
were always assigned to ``None``
whenever such an exception happened. And after this fix,
``spy_exception`` is set to a correct value of an exception
that has actually happened.

.. _coiax: https://github.com/coiax
.. _webknjaz: https://github.com/sponsors/webknjaz
.. _211: https://github.com/pytest-dev/pytest-mock/pull/211
.. _215: https://github.com/pytest-dev/pytest-mock/issues/215
.. _216: https://github.com/pytest-dev/pytest-mock/pull/216
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