Skip to content

Commit

Permalink
pythongh-106368: Increase Argument Clinic test coverage
Browse files Browse the repository at this point in the history
Add:

- test_disallowed_gropuing__no_matching_bracket
- test_double_slash
  • Loading branch information
erlend-aasland committed Jul 3, 2023
1 parent 648688c commit 2e2b42f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,18 @@ def test_disallowed_grouping__empty_group_on_right(self):
)
self.assertIn(msg, out)

def test_disallowed_gropuing__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 @@ -809,6 +821,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

0 comments on commit 2e2b42f

Please sign in to comment.