-
-
Notifications
You must be signed in to change notification settings - Fork 122
Coverage: exclude some noise #656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/typing_extensions.py
Outdated
@@ -165,7 +165,7 @@ | |||
|
|||
|
|||
class _Sentinel: | |||
def __repr__(self): | |||
def __repr__(self): # pragma: no cover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine but maybe we should eat our dogfood and use typing_extensions.Sentinel
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or if not, we could also just add a test for this. I know it's trivial code, but it doesn't really do any harm to test it explicitly, and it's nice to keep pragma: no cover
exclusions to a minimum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dogfooding Sentinel
sounds neat - I opened #657 to give that a try
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