For plain mocks unstubbing did not reset their state.
It works for patched objects because we first restore the old method
away the mock object ("unregister"), hence there is no way to further
access old recorded invocations.
A mock is usually assigned to local variable thus still accessible.
Although the registry doesn't point to it anymore, the mock itself
(actually a Dummy instance) still points to the underlying recording
Mock.
See #56
For plain
mock
s unstubbing did not reset their state.It works for patched objects because we first restore the old method away the mock object ("unregister"), hence there is no way to further access old recorded invocations.
A mock is usually assigned to local variable thus still accessible. Although the registry doesn't point to it anymore, the mock itself (actually a
Dummy
instance) still points to the underlying recording Mock.