-
-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No option to exclude imported but not used modules #643
Comments
I understand this impulse, but I don't see a way to do it. As far as Python is concerned, the module was used. How would we decide that a module wasn't used? Lines in the module were executed. Also, I'm unclear why it's important to exclude these files from coverage? There really are lines of code there that really weren't run. Don't you want to know about that? Isn't that the whole point of coverage measurement? |
I would think the coverage report including these files would help you to find unused code? Also, look into pylint, which can report on imports that are never used. |
You can generate a report with the |
Original comment by Abel Asefa (Bitbucket: abelandk, GitHub: abelandk) That is a good option. But what we actually need is something similar but different. For example, if you see the attached snapshot(Sorry I couldn't post the paths due to confidentiality) there are lots of files which shows 0% coverage. I don't want to include those files in my report, I only want to see a file with coverage > 0%. Is there a way to do this? |
Originally reported by Abel Asefa (Bitbucket: abelandk, GitHub: abelandk)
If the module is imported every function def will be declared as covered. A command line or API option should be available to exclude from reporting such kind of coverages.
The text was updated successfully, but these errors were encountered: