camptocamp/pytest-odoo

Support Status

blaggacao opened this issue · 1 comments

Hi, I'm investigating this wonderful piece of code.

Analyzing this: odoo-dev/odoo@95a131b

My questions are:

  • How far standard odoo module test are supported?
  • Looking at the marked modules, is there a support gap?
  • Isn't ModuleTest necesary in combination with pre and post tests?
  • Where DataTests used for (now deprecated) yaml files (and are therfore not needed here)?

Odoo's --test-enable machinery and pytest-odoo do not cover exactly the same scope. The odoo's test runner runs the tests during the upgrades of the addons, that's why they need the "at install" and "post install" markers.

Running tests during upgrades of addons is waaay too slow to work efficiently in a TDD mode, that's where pytest-odoo shines. Consider that all the tests are running post-install with pytest-odoo, as you must run the upgrade of the addon before (but only when needed vs each run).

At the end of the day, you'll have to run the odoo tests with --test-enable because, in very rare conditions, a test can pass with pytest-odoo but not with the "at install" tests run during the upgrade (or the reverse). I consider pytest-odoo to be a development tool, but not the tool that should replace entirely --test-enable in a CI.