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

Pin pytest-mock to latest version 1.2 #1232

Merged
merged 1 commit into from
Sep 30, 2016
Merged

Conversation

pyup-bot
Copy link
Contributor

pytest-mock is not pinned to a specific version.

I'm pinning it to the latest version 1.2 for now.

Changelog

1.2


  • Try to import mock first instead of unittest.mock. This gives the user flexibility
    to install a newer mock version from PyPI instead of using the one available in the
    Python distribution.
    Thanks wcooley_ for the PR (54_).
  • mock.sentinel is now aliased as mocker.sentinel for convenience.
    Thanks kjwilcox_ for the PR (56_).

.. _wcooley: https://github.com/wcooley
.. _kjwilcox: https://github.com/kjwilcox
.. _54: pytest-dev/pytest-mock#54
.. _56: pytest-dev/pytest-mock#56

1.1


  • From this version onward, pytest-mock is licensed under the MIT_ license (45_).
  • Now the plugin also adds introspection information on differing call arguments when
    calling helper methods such as assert_called_once_with. The extra introspection
    information is similar to pytest's and can be disabled with the mock_traceback_monkeypatch
    option.
    Thanks asfaltboy_ for the PR (36_).
  • mocker.stub() now allows passing in the name for the constructed Mock <https://docs.python.org/3/library/unittest.mock.htmlthe-mock-class>_
    object instead of having to set it using the internal _mock_name attribute
    directly. This is useful for debugging as the name is used in the mock's
    repr string as well as related assertion failure messages.
    Thanks jurko-gospodnetic_ for the PR (40_).
  • Monkey patching mock module for friendlier tracebacks is automatically disabled
    with the --tb=native option. The underlying
    mechanism used to suppress traceback entries from mock module does not work with that option
    anyway plus it generates confusing messages on Python 3.5 due to exception chaining (44).
    Thanks blueyed
    for the report.
  • mock.call is now aliased as mocker.call for convenience.
    Thanks jhermann_ for the PR (49_).

.. _jurko-gospodnetic: https://github.com/jurko-gospodnetic
.. _asfaltboy: https://github.com/asfaltboy
.. _jhermann: https://github.com/jhermann
.. _45: pytest-dev/pytest-mock#45
.. _36: pytest-dev/pytest-mock#36
.. _40: pytest-dev/pytest-mock#40
.. _44: pytest-dev/pytest-mock#44
.. _49: pytest-dev/pytest-mock#49
.. _MIT: https://github.com/pytest-dev/pytest-mock/blob/master/LICENSE

1.0


  • Fix AttributeError with mocker.spy when spying on inherited methods
    (42). Thanks blueyed for the PR.

.. _blueyed: https://github.com/blueyed
.. _42: pytest-dev/pytest-mock#42

0.11.0


  • PropertyMock <https://docs.python.org/3/library/unittest.mock.htmlunittest.mock.PropertyMock>_
    is now accessible from mocker.
    Thanks satyrius_ for the PR (32_).
  • Fix regression using one of the assert_* methods in patched
    functions which receive a parameter named method.
    Thanks sagarchalise_ for the report (31_).

.. _sagarchalise: https://github.com/sagarchalise
.. _satyrius: https://github.com/satyrius
.. _31: pytest-dev/pytest-mock#31
.. _32: pytest-dev/pytest-mock#32

0.10.1


  • Fix regression in frozen tests due to distutils import dependency.
    Thanks The-Compiler_ for the report (29_).
  • Fix regression when using pytest-mock with pytest-2.7.X.
    Thanks akscram_ for the report (28_).

.. _akscram: https://github.com/Chronial
.. _28: pytest-dev/pytest-mock#28
.. _29: pytest-dev/pytest-mock#29

0.10


  • pytest-mock now monkeypatches the mock library to improve pytest output
    for failures of mock call assertions like Mock.assert_called_with().
    Thanks to Chronial_ for idea and PR (26, 27)!

.. _Chronial: https://github.com/Chronial
.. _26: pytest-dev/pytest-mock#26
.. _27: pytest-dev/pytest-mock#27

0.9.0


  • New mocker.resetall function, which calls reset_mock() in all mocked
    objects up to that point. Thanks to mathrick_ for the PR!

0.8.1


  • pytest-mock is now also available as a wheel. Thanks rouge8_ for the PR!

0.8.0


  • mock.ANY is now accessible from the mocker fixture (17), thanks tigarmo for the PR!

.. _17: pytest-dev/pytest-qt#17

0.7.0


Thanks to fogo_, mocker.spy can now prey upon staticmethods and classmethods. 😄

0.6.0


  • Two new auxiliary methods, spy and stub. See README for usage.
    (Thanks fogo_ for complete PR!)

0.5.0


  • Mock and MagicMock are now accessible from the mocker fixture,
    many thanks to marcwebbie_ for the complete PR!

0.4.3


  • mocker fixture now returns the same object (8). Many thanks to RonnyPfannschmidt for the PR!

.. _8: pytest-dev/pytest-qt#8

0.4.2


  • Small fix, no longer using wheel as an alternate package since it
    conditionally depends on mock module based on Python version,
    as Python >= 3.3 already includes unittest.mock.
    Many thanks to The-Compiler_ for letting me know and providing a PR with the fix!

0.4.1


  • Small release that just uses pytest_mock as the name of the plugin,
    instead of pytest-mock: this makes it simple to depend on this plugin
    explicitly using pytest_plugins module variable mechanism.

0.4.0


  • Changed fixture name from mock into mocker because it conflicted
    with the actual mock module, which made using it awkward when access to both
    the module and the fixture were required within a test.

    Thanks kmosher_ for request and discussion in 4_. 😄

.. _4: pytest-dev/pytest-qt#4

0.3.0


  • Fixed bug 2_, where a patch would not be uninstalled correctly after
    patching the same object twice.

0.2.0


  • Added patch.dict support.

0.1.0


First release.

.. _2: pytest-dev/pytest-qt#2

.. _mathrick: https://github.com/mathrick
.. _tigarmo: https://github.com/tigarmo
.. _rouge8: https://github.com/rouge8
.. _fogo: https://github.com/fogo
.. _marcwebbie: https://github.com/marcwebbie
.. _RonnyPfannschmidt: https://github.com/RonnyPfannschmidt
.. _The-Compiler: https://github.com/The-Compiler
.. _kmosher: https://github.com/kmosher

Got merge conflicts? Close this PR and delete the branch. I'll create a new PR for you.

Happy merging! 🤖

@codecov-io
Copy link

codecov-io commented Sep 30, 2016

Current coverage is 98.28% (diff: 100%)

Merging #1232 into master will not change coverage

@@             master      #1232   diff @@
==========================================
  Files            29         29          
  Lines          6485       6485          
  Methods           0          0          
  Messages          0          0          
  Branches       1087       1087          
==========================================
  Hits           6374       6374          
  Misses           59         59          
  Partials         52         52          

Powered by Codecov. Last update 54808c7...a5538ad

@asvetlov asvetlov merged commit accd7e9 into master Sep 30, 2016
@asvetlov asvetlov deleted the pyup-pin-pytest-mock-1.2 branch September 30, 2016 04:28
@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants