Skip to content

Commit

Permalink
Ensure that type validation is executed for StrictMock instances as well
Browse files Browse the repository at this point in the history
  • Loading branch information
macisamuele committed Feb 20, 2021
1 parent 7ab0b50 commit 3e19346
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions testslide/mock_callable.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,10 +729,9 @@ def _patch(
else:
original_callable = getattr(self._target, self._method)

if not isinstance(self._target, StrictMock):
new_value = _wrap_signature_and_type_validation(
new_value, self._target, self._method, self.type_validation
)
new_value = _wrap_signature_and_type_validation(
new_value, self._target, self._method, self.type_validation
)

restore = self._method in self._target.__dict__
restore_value = self._target.__dict__.get(self._method, None)
Expand Down

0 comments on commit 3e19346

Please sign in to comment.