From 0951508e522d1c9a46b6775051780ade5cbd4ffe Mon Sep 17 00:00:00 2001 From: Mario Corchero Date: Mon, 10 Jul 2023 14:59:22 +0200 Subject: [PATCH] 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`. --- Lib/unittest/mock.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index 7ef7e7180b31c2..3ed54b3ba230ed 100644 --- a/Lib/unittest/mock.py +++ b/Lib/unittest/mock.py @@ -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