How do you integrate coverage.py
in testing out your custom modules in Odoo? I have already implemented some unit-test for the module but right now I would like to test for the test the code coverage of the test.
4
votes
1 Answers
4
votes
The Odoo Community Association continuous integration tools, Maintainer Quality Tools, do this and much more. You should consider reusing them.
Going straight to the point, you need to run something like:
coverage run /home/odoo-9.0/odoo.py -d mydb --stop-after-init --test-enable --init <module>
You may want to check the MQT source code doing it, or see in action in a TravisCI build.