I'm glad you brought this up so that I didn't have to. It's something
I've been meaning to look into for a while. I wasn't sure how to add
coverage support to py.test, so I'm glad that it was so simple.
100% coverage is definitely not a worthwhile goal. For one, it's not
possible in most coverage reporting to turn off inclusion of specific
sections of code. For example, since we have code that should only
run in Python 3 (or code that should only run on Python 2) it's
impossible to ever achieve 100% coverage. I'd say ~85% is a more
realistic/useful goal. (Though I believe it is possible to exclude
certain packages from the report. For example, we might want to
exclude astropy.extern, and exclude the tests themselves).
As you said, test coverage does not by any means prove that you've
tested all possible use cases. But it is helpful in directing where
new tests need to be written, and in tracking down why specific bugs
were *not* caught by your tests.
The next question is, is there some way we can add coverage reports to
Jenkins for each build?
Erik