diff options
| -rw-r--r-- | Lib/test/test_clinic.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/test/test_clinic.py b/Lib/test/test_clinic.py index 76729c8..32aac40 100644 --- a/Lib/test/test_clinic.py +++ b/Lib/test/test_clinic.py @@ -1524,6 +1524,27 @@ class ClinicParserTest(TestCase): 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 |
