File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1524,6 +1524,27 @@ def test_disallowed_grouping__no_matching_bracket(self):
15241524 err = "Function 'empty_group' has a ']' without a matching '['"
15251525 self .expect_failure (block , err )
15261526
1527+ def test_disallowed_grouping__must_be_position_only (self ):
1528+ dataset = ("""
1529+ with_kwds
1530+ [
1531+ *
1532+ a: object
1533+ ]
1534+ """ , """
1535+ with_kwds
1536+ [
1537+ a: object
1538+ ]
1539+ """ )
1540+ err = (
1541+ "You cannot use optional groups ('[' and ']') unless all "
1542+ "parameters are positional-only ('/')"
1543+ )
1544+ for block in dataset :
1545+ with self .subTest (block = block ):
1546+ self .expect_failure (block , err )
1547+
15271548 def test_no_parameters (self ):
15281549 function = self .parse_function ("""
15291550 module foo
You can’t perform that action at this time.
0 commit comments