Skip to content

Commit 078d709

Browse files
committed
Merge PR #938 into 18.0
Signed-off-by sbidoul
2 parents 6c0a91a + 579297e commit 078d709

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

queue_job/tests/common.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@
66
from operator import attrgetter
77
from unittest import TestCase, mock
88

9+
from odoo.tests.common import SETATTR_SOURCES
10+
911
from odoo.addons.queue_job.delay import Graph
1012

1113
# pylint: disable=odoo-addons-relative-import
1214
from odoo.addons.queue_job.job import Job
1315

16+
# Register queue_job patcher as a known path to prevent verbose warning
17+
# in tests when methods are patched.
18+
SETATTR_SOURCES["_patch_method"] = tuple(
19+
list(SETATTR_SOURCES.get("_patch_method", [])) + ["/queue_job/models/base.py"],
20+
)
21+
1422

1523
@contextmanager
1624
def trap_jobs():
@@ -206,7 +214,7 @@ def assert_enqueued_job(self, method, args=None, kwargs=None, properties=None):
206214

207215
if expected_call not in actual_calls:
208216
raise AssertionError(
209-
"Job {} was not enqueued.\n" "Actual enqueued jobs:\n{}".format(
217+
"Job {} was not enqueued.\nActual enqueued jobs:\n{}".format(
210218
self._format_job_call(expected_call),
211219
"\n".join(
212220
f" * {self._format_job_call(call)}" for call in actual_calls

0 commit comments

Comments
 (0)