Releases: pytest-dev/pytest-mock
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.spy
now also works withasync def
functions (#179). Thanks @frankie567 for the PR!
2.0.0 (2020-01-04)
Breaking Changes
-
mocker.spy
attributes for tracking returned values and raised exceptions of its spied functions
are now calledspy_return
andspy_exception
, instead of reusing the existing
MagicMock
attributesreturn_value
andside_effect
.Version
1.13
introduced 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_effect
causes
unittest.mock
to behave this way (#175). -
The deprecated
mock
alias to themocker
fixture has finally been removed.
1.13.0 (2019-12-05)
- The object returned by
mocker.spy
now also tracks any side effect of the spied method/function.
1.12.1 (2019-11-20)
- Fix error if
mocker.patch
is used in code where the source file is not available, for example stale.pyc
files (#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. -
mocker
now raises aValueError
when used as a context-manager.
Thanks @binarymason for the PR (#165).
1.11.1 (2019-10-04)
v1.11.0: mocker.spy now also tracks return value
mocker.spy
now also tracks the return value.
mock.ANY
spy now supports classmethods and staticmethods
Thanks to @fogo, mocker.spy
can now prey upon staticmethods and classmethods. 😄