Releases: kaste/mockito-python
Releases · kaste/mockito-python
1.5.4
Surprisingly deepcopy(mock())
returned None
. Fix that! For dumb mocks, let deepcopy(m)
return an actual deep copy of m
. For strict mocks, let it throw if it is an unexpected usage.
You can quickly define mock({"__deepcopy__": None})
to expect the usage and get the default deepcopy
algorithm. Note that expectations and recorded usages are shared by default even for copied mocks. You can fix that DIY, e.g when(copy).deepcopy(m).thenReturn(n)
. (Or the other way around: when(m).__deepcopy__(...).thenReturn(n)
.