Skip to content

Commit 3cc5c4a

Browse files
[3.11] gh-106368: Increase Argument Clinic test coverage (GH-106389) (#106391)
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 7688964 commit 3cc5c4a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Lib/test/test_clinic.py

+24
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,18 @@ def test_disallowed_grouping__empty_group_on_right(self):
729729
)
730730
self.assertIn(msg, out)
731731

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

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

0 commit comments

Comments
 (0)