[18.0][FIX] queue_job: fix verbose warning in tests with patched methods#938
Open
guewen wants to merge 1 commit into
Open
[18.0][FIX] queue_job: fix verbose warning in tests with patched methods#938guewen wants to merge 1 commit into
guewen wants to merge 1 commit into
Conversation
Methods patched with _patch_method leads to a lot of warnings during
tests that look like:
2026-05-22 08:44:57,099 1 INFO testdb odoo.tests.common: /odoo/external-src/queue/queue_job/models/base.py:270:_patch_method setting edi.exchange.record.action_exchange_generate to <function EDIExchangeRecord.action_exchange_generate at 0x7f23b62a0680>
Stack (most recent call last):
File "/usr/local/bin/odoo", line 8, in <module>
odoo.cli.main()
File "/odoo/src/odoo/cli/command.py", line 66, in main
o.run(args)
File "/odoo/src/odoo/cli/server.py", line 182, in run
main(args)
File "/odoo/src/odoo/cli/server.py", line 175, in main
rc = odoo.service.server.start(preload=preload, stop=stop)
File "/odoo/src/odoo/service/server.py", line 1457, in start
rc = server.run(preload, stop)
File "/odoo/src/odoo/service/server.py", line 622, in run
rc = preload_registries(preload)
File "/odoo/src/odoo/service/server.py", line 1388, in preload_registries
result = loader.run_suite(post_install_suite, global_report=registry._assertion_report)
File "/odoo/src/odoo/tests/loader.py", line 118, in run_suite
suite(results)
File "/usr/local/lib/python3.12/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
File "/odoo/src/odoo/tests/suite.py", line 49, in run
self._tearDownPreviousClass(None, result)
File "/odoo/src/odoo/tests/suite.py", line 190, in _tearDownPreviousClass
super()._tearDownPreviousClass(test, result)
File "/odoo/src/odoo/tests/suite.py", line 112, in _tearDownPreviousClass
previousClass.doClassCleanups()
File "/odoo/src/odoo/tests/case.py", line 247, in doClassCleanups
function(*args, **kwargs)
File "/odoo/src/odoo/tests/common.py", line 989, in reset_changes
cls.registry.setup_models(cr)
File "/usr/local/lib/python3.12/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/odoo/src/odoo/tools/func.py", line 97, in locked
return func(inst, *args, **kwargs)
File "/odoo/src/odoo/modules/registry.py", line 375, in setup_models
model._register_hook()
File "/odoo/external-src/edi-framework/edi_queue_oca/models/edi_exchange_record.py", line 26, in _register_hook
self._patch_method(function, self._patch_job_auto_delay(function))
File "/odoo/external-src/queue/queue_job/models/base.py", line 270, in _patch_method
setattr(cls, name, wrapped)
File "/odoo/src/odoo/tests/common.py", line 971, in metamodel_setattr
_logger.runbot(
File "/odoo/src/odoo/netsvc.py", line 360, in runbot
self.log(logging.RUNBOT, message, *args, **kws)
Contributor
|
Hi @sbidoul, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Methods patched with _patch_method leads to a lot of warnings during tests that look like: