pytest-odoo
pytest-odoo copied to clipboard
Support Odoo 18
Just open this issue as self remember from fist try
- In odoo 18 there is a change (https://github.com/odoo/odoo/commit/ccf3c1ed3949f3307909678efe1245aa92ef752f) that expect unit test launcher
if not result.wasSuccessful() and BaseCase._tests_run_count != 1:
_logger.runbot('Disabling auto-retry after a failed test')
BaseCase._tests_run_count = 1
wasSuccessful does not exists while launching test using pytest. commenting those lines seems to works as an ungly workaround.
-
Also we get an logging error because configuration seems to be changed a bit late which was introduce by this commit https://github.com/odoo/odoo/commit/1f3a15a7d1f527ab05937810b6a1fb60c22ff455#diff-80aef099e5fb41cc09e699d35b749152aca50caf5b0bc16c400081c29023fbecR95
-
Also a warning is shown while open registry: `` `/.venv/lib/python3.12/site-packages/pytest_odoo.py:167: DeprecationWarning: Use directly odoo.modules.registry.Registry odoo.registry(db_name)
I (we) needs to spend more time to investigate a bit more and properly fix that some how
-
For the first part of the issue I'm trying make it merge a PR from odoo side to avoid technical debt in this project
- https://github.com/odoo/odoo/pull/184409
- https://github.com/OCA/OCB/pull/1262
-
for the 2 other parts #80 avoid logging error/warning
FYI I've found a workaround for the odoo core issue: export ODOO_TEST_FAILURE_RETRIES=-1 -> bypasses the retry stuff.
FYI I've found a workaround for the odoo core issue:
export ODOO_TEST_FAILURE_RETRIES=-1-> bypasses the retry stuff.
good to know, thanks.
As the PR was rejected I'll try to propose something to properly overwrite things to make it smooth !
@simahawk can I explore that in an other PR or you prefer I carry on this work on the exiting PR #80?
As you prefer. You can create a new PR.
@simahawk here a new PR https://github.com/camptocamp/pytest-odoo/pull/82 as proposition ready to review to avoid your suggested workaround !
FYI I've found a workaround for the odoo core issue:
export ODOO_TEST_FAILURE_RETRIES=-1-> bypasses the retry stuff.
Doesn't work properly. With that, failing tests are marked as successful
I'm closing this issue all works as been merge (I've probably an issue comming from #82 but I'll create a new issue