Skip to content
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

gh-106368: Improve coverage reports for argument clinic #107693

Merged
merged 1 commit into from
Aug 6, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Aug 6, 2023

  • Use ... rather than pass for empty bodies in abstract methods that are never meant to be executed. Exclude lines consisting solely of ... in our .coveragerc file.
  • Use raise AssertionError instead of raise RuntimeError for an exception that's never meant to be executed -- it would indicate a bug in Tools/clinic/ itself, rather than an incorrect usage of argument clinic, if that line was ever executed. Exclude raise AssertionError( lines in our .coveragerc file.
  • A reasonably large block of code in Tools/clinic/cpp.py was being excluded from coverage reports because it was all inside an if __name__ == "__main__" block, and if __name__ == "__main__" blocks are excluded in our .coveragerc file. That was making our coverage for cpp.py look better than it actually was. Move that block inside a _main() function so that it's correctly reported as being uncovered in coverage reports.

Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@AlexWaygood AlexWaygood merged commit ee3bf45 into python:main Aug 6, 2023
@AlexWaygood AlexWaygood deleted the clinic-coverage branch August 6, 2023 19:40
kostyafarber pushed a commit to kostyafarber/cpython that referenced this pull request Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants