Skip to content
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
21 changes: 21 additions & 0 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1524,6 +1524,27 @@ def test_disallowed_grouping__no_matching_bracket(self):
err = "Function 'empty_group' has a ']' without a matching '['"
self.expect_failure(block, err)

def test_disallowed_grouping__must_be_position_only(self):
dataset = ("""
with_kwds
[
*
a: object
]
""", """
with_kwds
[
a: object
]
""")
err = (
"You cannot use optional groups ('[' and ']') unless all "
"parameters are positional-only ('/')"
)
for block in dataset:
with self.subTest(block=block):
self.expect_failure(block, err)

def test_no_parameters(self):
function = self.parse_function("""
module foo
Expand Down