gh-93649: Split getargs testing from _testcapimodule.c
- Issue: gh-93649
There is some fishy error handling in some of the test methods. Let's handle those in a separate issue/PR. An example is test_k_code(), where tuple leak in multiple branches.
Leaks in failing tests? The only situation I see where that's is a problem is when tests are used as API usage examples. So, it's good to fix those, but not too important for older tests.
Undefining PyArg_ParseTupleAndKeywords and defining again it is also a bit fishy – IMO it would better to havs the non-Size_T definition in the public header file, albeit shadowed by a macro, so only #undef would suffice. But that's an unrelated issue.
Leaks in failing tests?
Yes, only in error handling paths, and it's not a problem in practice.
Undefining
PyArg_ParseTupleAndKeywordsand defining again it is also a bit fishy – IMO it would better to havs the non-Size_Tdefinition in the public header file, albeit shadowed by a macro, so only#undefwould suffice. But that's an unrelated issue.
+1