From f0cc38503e2d91341ca4e263d5acf934b7c0d130 Mon Sep 17 00:00:00 2001 From: Mario Corchero Date: Mon, 10 Jul 2023 15:35:54 +0200 Subject: [PATCH] GH-61215: threadingmock: Remove unused branch for `timeout` (#106591) 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 --- mock/mock.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mock/mock.py b/mock/mock.py index 4bd5b1e4..fba26bd2 100644 --- a/mock/mock.py +++ b/mock/mock.py @@ -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