I'm using coverage module in python to check the code coverage. However, while running 'coverage report', the module is analyzing unwanted files shown below other than the project files.

How can I remove unwanted files from executing in coverage report?
The simplest way is to use --source=. so that it will only consider files in the current directory.
You should use --omit flag to exclude the unwanted files.
The RegEx is allowed to use. Eg.: coverage run --omit "*/app/*,*__init__*,*_ut.py"
You can see more details: https://coverage.readthedocs.io/en/v4.5.x/source.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With