Skip to content

Commit b84365f

Browse files
[3.12] gh-106368: Increase Argument Clinic test coverage (GH-106389) (#106390)
Add: - test_disallowed_gropuing__no_matching_bracket - test_double_slash (cherry picked from commit 3406f8c) Co-authored-by: Erlend E. Aasland <[email protected]>
1 parent 6720003 commit b84365f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Lib/test/test_clinic.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,18 @@ def test_disallowed_grouping__empty_group_on_right(self):
730730
)
731731
self.assertIn(msg, out)
732732

733+
def test_disallowed_grouping__no_matching_bracket(self):
734+
out = self.parse_function_should_fail("""
735+
module foo
736+
foo.empty_group
737+
param: int
738+
]
739+
group2: int
740+
]
741+
""")
742+
msg = "Function empty_group has a ] without a matching [."
743+
self.assertIn(msg, out)
744+
733745
def test_no_parameters(self):
734746
function = self.parse_function("""
735747
module foo
@@ -809,6 +821,18 @@ def test_single_slash(self):
809821
)
810822
self.assertIn(msg, out)
811823

824+
def test_double_slash(self):
825+
out = self.parse_function_should_fail("""
826+
module foo
827+
foo.bar
828+
a: int
829+
/
830+
b: int
831+
/
832+
""")
833+
msg = "Function bar uses '/' more than once."
834+
self.assertIn(msg, out)
835+
812836
def test_mix_star_and_slash(self):
813837
out = self.parse_function_should_fail("""
814838
module foo

0 commit comments

Comments
 (0)