bpo-31177: Skip deleted attributes while calling reset_mock (GH-9302)

This commit is contained in:
Xtreak 2018-12-01 15:33:54 +05:30 committed by Victor Stinner
parent 989052047e
commit edeca92c84
3 changed files with 13 additions and 1 deletions

View file

@ -542,7 +542,7 @@ class NonCallableMock(Base):
self._mock_side_effect = None
for child in self._mock_children.values():
if isinstance(child, _SpecState):
if isinstance(child, _SpecState) or child is _deleted:
continue
child.reset_mock(visited)