pytest-odoo icon indicating copy to clipboard operation
pytest-odoo copied to clipboard

Support Status

Open blaggacao opened this issue 6 years ago • 1 comments

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

Analyzing this: https://github.com/odoo-dev/odoo/commit/95a131b7f4eebc6e2c623f936283153d62f9e70f

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)?

blaggacao avatar Oct 23 '18 23:10 blaggacao

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.

guewen avatar Oct 24 '18 06:10 guewen