coveragepy icon indicating copy to clipboard operation
coveragepy copied to clipboard

Added support for namespace packages

Open felix-ht opened this issue 3 years ago • 2 comments

This pr adds support for including namespace packages the coverage report.

Fixes https://github.com/nedbat/coveragepy/issues/1383

felix-ht avatar May 30 '22 11:05 felix-ht

Thanks. I would rather have a config file setting for this, and not add a command line switch if that's OK with you.

nedbat avatar May 30 '22 14:05 nedbat

include_namespace_packages is a good name?

felix-ht avatar May 30 '22 15:05 felix-ht

Hello @nedbat, do you know if it's possible to merge this PR ? I dont use __init__ files in my project so I need this PR if I want full coverage.

bersiroth avatar Nov 13 '22 21:11 bersiroth

Hello @nedbat, do you know if it's possible to merge this PR ? I dont use __init__ files in my project so I need this PR if I want full coverage.

Just to be clear: this setting will only help find completely unexecuted files. Are you in that situation where you have files that aren't executed, but are not being found with the source= setting?

I think this seems like a reasonable change, but you mentioned "full coverage" which isn't how I would have described it.

nedbat avatar Nov 13 '22 23:11 nedbat

Thank you for your quick answer.

Just to be clear: this setting will only help find completely unexecuted files. Are you in that situation where you have files that aren't executed, but are not being found with the source= setting?

Yes actually in my project where I use pytest-cov (https://github.com/bersiroth/highway-code-test/pull/8) I have a coverage at 100% but it's 100% of executed files, in my case I have lot of files where I didn't make test yet.

I think this seems like a reasonable change, but you mentioned "full coverage" which isn't how I would have described it.

I think "full discover" it's better description. What I wanted to say it's if I configure source with src folder I would like to know coverage of all files in this repository not only executed files.

If this PR still miss somthing, I'm open to handle it

bersiroth avatar Nov 14 '22 11:11 bersiroth

Thanks!

nedbat avatar Nov 17 '22 11:11 nedbat

Some docs, attribution, and style clean-up finished this in commit 709c7443.

nedbat avatar Nov 17 '22 12:11 nedbat

@nedbat happy to see this merged!

felix-ht avatar Nov 17 '22 13:11 felix-ht

This is now released as part of coverage 7.0.0b1.

nedbat avatar Dec 03 '22 18:12 nedbat