Coverage: exclude some noise #656
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Going through the current test coverage results, there's quite a bit of noise from things that are not expected to be executed or would not be meaningful to test. For example, dummy functions with placeholder bodies:
typing_extensions/src/test_typing_extensions.py
Lines 7788 to 7789 in e589a26
and unexpected error handling:
typing_extensions/src/test_typing_extensions.py
Lines 5958 to 5965 in e589a26
It would be nice to exclude these from the coverage report so that it's easier to see what's actually missing coverage.
This PR adds exclusions for:
pass
andraise NotImplementedError
used as placeholder bodies (viapyproject.toml
config)# pragma: no cover
comments)raise NotImplementedError
or...
)if __name__ == '__main__'
block in the tests and the__repr__
of an internal sentinel