- 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 namedmethod
. Thanks @sagarchalise for the report (#31).
- Fix regression in frozen tests due to
distutils
import dependency. Thanks @The-Compiler for the report (#29). - Fix regression when using
pytest-mock
withpytest-2.7.X
. Thanks @akscram for the report (#28).
pytest-mock
now monkeypatches themock
library to improve pytest output for failures of mock call assertions likeMock.assert_called_with()
. Thanks to @Chronial for idea and PR (#26, #27)!
- New
mocker.resetall
function, which callsreset_mock()
in all mocked objects up to that point. Thanks to @mathrick for the PR!
pytest-mock
is now also available as a wheel. Thanks @rouge8 for the PR!
Thanks to @fogo, mocker.spy can now prey upon staticmethods and classmethods. 😄
- Two new auxiliary methods,
spy
andstub
. SeeREADME
for usage. (Thanks @fogo for complete PR!)
Mock
andMagicMock
are now accessible from themocker
fixture, many thanks to @marcwebbie for the complete PR!
mocker
fixture now returns the same object (#8). Many thanks to @RonnyPfannschmidt for the PR!
- 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!
- Small release that just uses
pytest_mock
as the name of the plugin, instead ofpytest-mock
: this makes it simple to depend on this plugin explicitly usingpytest_plugins
module variable mechanism.
Changed fixture name from
mock
intomocker
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.
- Fixed bug #2, where a patch would not be uninstalled correctly after patching the same object twice.
- Added
patch.dict
support.
First release.