How to instruct coverage.py to omit top-level definitions and count only method's bodies?
问题 I want to test the coverage of a single package within a large body of software (specifically an Odoo addon). I have no control over the overall setup of the test. Hacking Odoo to start the coverage collection before loading the modules is not worth it -- running all Odoo tests takes about 20 minutes on regular hardware; so I want to selectively test the coverage of some custom modules. I'm using setUpModule and tearDownModule like this: _coverage = Coverage( source=[ 'odoo.addons.xhg