Issue #251 new

Report covered 'no-cover' lines

Anonymous created an issue

It is often the case that a feature will be added in one commit, but there isn't any client code that calls a particular method yet. As such, the method is marked

pragma: no cover

coverage passes and everyone continues along their merry way.

Later, when client code is added that exercises that code path, it would be nice if coverage.py could complain saying something like "WARNING: Block marked 'no cover' actually covered. You may want to remove the pragma." That way, we could continually make sure that the minimum amount of code is under 'no cover' pragmas.

Comments (1)

  1. Ned Batchelder repo owner

    Hmm, I'm not sure I approve of pragma'ing away code that you intend to cover eventually, but it's an interesting idea to alert the user to unneeded pragmas.

  2. Log in to comment