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

[3.11] gh-106368: Increase Argument Clinic test coverage (GH-106389) #106391

Merged
merged 1 commit into from
Jul 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,18 @@ def test_disallowed_grouping__empty_group_on_right(self):
)
self.assertIn(msg, out)

def test_disallowed_grouping__no_matching_bracket(self):
out = self.parse_function_should_fail("""
module foo
foo.empty_group
param: int
]
group2: int
]
""")
msg = "Function empty_group has a ] without a matching [."
self.assertIn(msg, out)

def test_no_parameters(self):
function = self.parse_function("""
module foo
Expand Down Expand Up @@ -808,6 +820,18 @@ def test_single_slash(self):
)
self.assertIn(msg, out)

def test_double_slash(self):
out = self.parse_function_should_fail("""
module foo
foo.bar
a: int
/
b: int
/
""")
msg = "Function bar uses '/' more than once."
self.assertIn(msg, out)

def test_mix_star_and_slash(self):
out = self.parse_function_should_fail("""
module foo
Expand Down