camptocamp / pytest-odoo

pytest plugin to run Odoo tests
GNU Affero General Public License v3.0
68 stars 45 forks source link

Support Status #26

Open blaggacao opened 5 years ago

blaggacao commented 5 years ago

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

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

My questions are:

guewen commented 5 years ago

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.