Skip to content
Prev Previous commit
Next Next commit
Merge branch 'main' into clinic/kwargs-simple
# Conflicts:
#	Lib/test/test_clinic.py
  • Loading branch information
AA-Turner committed Sep 18, 2025
commit b213f62baf90b326c3f0e47ac0f03727ea4e2541
13 changes: 13 additions & 0 deletions Lib/test/test_clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2744,6 +2744,19 @@ def test_var_keyword_with_pos_or_kw_and_kw_only(self):
err = "Function 'bar' has an invalid parameter declaration (**kwargs?): '**kwds: dict'"
self.expect_failure(block, err)

def test_allow_negative_accepted_by_py_ssize_t_converter_only(self):
errmsg = re.escape("converter_init() got an unexpected keyword argument 'allow_negative'")
unsupported_converters = [converter_name for converter_name in converters.keys()
if converter_name != "Py_ssize_t"]
for converter in unsupported_converters:
with self.subTest(converter=converter):
block = f"""
module m
m.func
a: {converter}(allow_negative=True)
"""
with self.assertRaisesRegex((AssertionError, TypeError), errmsg):
self.parse_function(block)

class ClinicExternalTest(TestCase):
maxDiff = None
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.