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`.

Backports: 3e23fa71f43fb225ca29a931644d1100e2f4d6b8
Signed-off-by: Chris Withers <chris@simplistix.co.uk>
  • Loading branch information
mariocj89 authored and cjw296 committed Jul 11, 2023
1 parent acd5fc5 commit f0cc385
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mock/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -3064,9 +3064,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 f0cc385

Please sign in to comment.