◐ Shell
clean mode source ↗

gh-106368: Improve coverage reports for argument clinic by AlexWaygood · Pull Request #107693 · python/cpython

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@AlexWaygood

  • 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.

AlexWaygood

erlend-aasland

Choose a reason for hiding this comment

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

Thanks!

kostyafarber pushed a commit to kostyafarber/cpython that referenced this pull request

Aug 7, 2023

Labels