Skip to content

Conversation

@AlexWaygood
Copy link
Member

@AlexWaygoodAlexWaygood commented Aug 4, 2023

The early return in self.state_modulename_name() is unreachable, as state_modulename_name() is only ever called from state_dsl_start, and the first thing state_dsl_start does is check whether the line is valid:

ifnotself.valid_line(line):
return

There are two other if not self.valid_line(line) branches in clinic.py which are reachable, but are uncovered:

defstate_function_docstring(self, line: str) ->None:
assertself.functionisnotNone
ifself.group:
fail(f"Function {self.function.name!r} has a ']' without a matching '['.")
ifnotself.valid_line(line):
return

defstate_parameter_docstring(self, line: str) ->None:
ifnotself.valid_line(line):
return

Add a test that covers both of them.

Copy link
Contributor

@erlend-aaslanderlend-aasland left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@AlexWaygoodAlexWaygood merged commit 2c25bd8 into python:mainAug 4, 2023
@AlexWaygoodAlexWaygood deleted the valid-line-coverage branch August 4, 2023 19:41
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@AlexWaygood@erlend-aasland@bedevere-bot