Skip to content

Commit

Permalink
GH-61215: threadingmock: Remove unused branch for timeout (#106591)
Browse files Browse the repository at this point in the history
threadingmock: Remove unused branch for `timeout`

This is no longer needed as the mock does not hold a "timeout"
parameter, the timeout is stored in `_mock_wait_timeout`.
  • Loading branch information
mariocj89 committed Jul 10, 2023
1 parent 3f9bc86 commit 3e23fa7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions Lib/unittest/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -3012,9 +3012,7 @@ class ThreadingMixin(Base):
DEFAULT_TIMEOUT = None

def _get_child_mock(self, /, **kw):
if "timeout" in kw:
kw["timeout"] = kw.pop("timeout")
elif isinstance(kw.get("parent"), ThreadingMixin):
if isinstance(kw.get("parent"), ThreadingMixin):
kw["timeout"] = kw["parent"]._mock_wait_timeout
elif isinstance(kw.get("_new_parent"), ThreadingMixin):
kw["timeout"] = kw["_new_parent"]._mock_wait_timeout
Expand Down

0 comments on commit 3e23fa7

Please sign in to comment.