Issue #315 resolved

Option to omit empty files (e.g. __init__.py)

Daniel Hahler
created an issue

It would be nice if empty files (especially __init__.py) could be ignored, e.g. via an option omit-empty.

Ref: https://bitbucket.org/ned/coveragepy/issue/1/empty-initpy-files-are-reported-as-1

Comments (4)

  1. Alexander Walters

    The referenced issue is resolved, and I have not seen empty files as being reported. Coverage covers lines, if there are no lines, then there is nothing to hit or miss with. I think you have stumbled onto either a new bug or found some smell in your own code.

  2. Ned Batchelder repo owner

    Alexander Walters Issue #1 was about empty files claiming to have one statement, the fix made them have zero statements, but they are still reported. I suspect Daniel Hahler is using the --source option, which makes completely unexecuted files appear in reports. I like the idea of skipping empty files if they are pulled in via the --source switch.

  3. Log in to comment