From cd793c265f5bc329f1c1faf9fe1c7a000ed611a5 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Wed, 18 Feb 2026 22:16:33 +0100 Subject: [PATCH] [FIX] mock.patch(auto_spec=True) does not exist There is no parameter auto_spec to mock.patch. This is likely a typo. Running the tests with Python 3.12 give a RuntimeError ``` File "/usr/local/lib/python3.12/unittest/mock.py", line 1311, in __init__ _check_spec_arg_typos(kwargs) File "/usr/local/lib/python3.12/unittest/mock.py", line 1287, in _check_spec_arg_typos raise RuntimeError( RuntimeError: 'auto_spec' might be a typo. ``` --- queue_job/tests/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queue_job/tests/common.py b/queue_job/tests/common.py index 6bbc5be9e4..639f8f2f14 100644 --- a/queue_job/tests/common.py +++ b/queue_job/tests/common.py @@ -94,7 +94,7 @@ def button_that_uses_delayable_chain(self): with mock.patch( "odoo.addons.queue_job.delay.Job", name="Job Class", - auto_spec=True, + unsafe=True, ) as job_cls_mock: with JobsTrap(job_cls_mock) as trap: yield trap