Releases: pytest-dev/pytest-mock
3.2.0 (2020-07-11)
-
AsyncMock is now exposed in
mockerand supports provides assertion introspection similar toMockobjects.Added by @tirkarthi in #197.
3.1.1 (2020-05-31)
- Fixed performance regression caused by the
ValueErrorraised
whenmockeris used as context manager (#191).
3.1.0 (2020-04-18)
3.0.0 (2020-03-31)
- Python 2.7 and 3.4 are no longer supported. Users using pip 9 or later will install a compatible version automatically.
mocker.spynow also works withasync deffunctions (#179). Thanks @frankie567 for the PR!
2.0.0 (2020-01-04)
Breaking Changes
-
mocker.spyattributes for tracking returned values and raised exceptions of its spied functions
are now calledspy_returnandspy_exception, instead of reusing the existing
MagicMockattributesreturn_valueandside_effect.Version
1.13introduced a serious regression: after a spied function usingmocker.spy
raises an exception, further calls to the spy will not call the spied function,
always raising the first exception instead: assigning toside_effectcauses
unittest.mockto behave this way (#175). -
The deprecated
mockalias to themockerfixture has finally been removed.
1.13.0 (2019-12-05)
- The object returned by
mocker.spynow also tracks any side effect of the spied method/function.
1.12.1 (2019-11-20)
- Fix error if
mocker.patchis used in code where the source file is not available, for example stale.pycfiles (#169).
1.12.0 (2019-11-19)
Now all patch functions also raise a ValueError when used as a context-manager. Thanks @AlexGascon for the PR (#168).
1.11.2 (2019-10-19)
-
The pytest introspection follows message is no longer shown if there is no pytest introspection (#154).
Thanks @The-Compiler for the report. -
mockernow raises aValueErrorwhen used as a context-manager.
Thanks @binarymason for the PR (#165).