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-104683: Improve consistency and test coverage of argument-clinic __repr__ functions #107667

Merged
merged 2 commits into from
Aug 5, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Aug 5, 2023

Several of the __repr__ functions in Tools/clinic/ have no test coverage at the moment, so this PR started life as an attempt to get some easy coverage improvements. While working on adding coverage for the __repr__ functions, however, I noticed that the reprs for classes in Tools/clinic/ can be pretty inconsistent -- e.g. Function objects describe themselves as clinic.Function objects in their reprs, but Destination objects just describe themselves as Destination objects. Some classes quoted their self.name attribute in their __repr__ methods; others didn't. This PR therefore also improves the consistency of the __repr__ methods in Tools/clinic/.

Coverage prior to this PR:

Name                     Stmts   Miss Branch BrPart  Cover
----------------------------------------------------------
Tools\clinic\clinic.py    2947    135   1236    114    94%
Tools\clinic\cpp.py        102      9     54      2    90%
----------------------------------------------------------
TOTAL                     3049    144   1290    116    94%

Coverage with this PR:

Name                     Stmts   Miss Branch BrPart  Cover
----------------------------------------------------------
Tools\clinic\clinic.py    2948    119   1236    115    94%
Tools\clinic\cpp.py        103      8     54      2    91%
----------------------------------------------------------
TOTAL                     3051    127   1290    117    94%

So, no change to the top-line stat, but a reasonable reduction in uncovered statements.

@AlexWaygood AlexWaygood merged commit 6996b40 into python:main Aug 5, 2023
18 checks passed
@AlexWaygood AlexWaygood deleted the clinic-reprs branch August 6, 2023 13:18
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