cpython icon indicating copy to clipboard operation
cpython copied to clipboard

gh-93649: Split getargs testing from _testcapimodule.c

Open erlend-aasland opened this issue 3 years ago • 1 comments

  • Issue: gh-93649

erlend-aasland avatar Nov 10 '22 20:11 erlend-aasland

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.

erlend-aasland avatar Nov 11 '22 16:11 erlend-aasland

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.

encukou avatar Nov 14 '22 12:11 encukou

Leaks in failing tests?

Yes, only in error handling paths, and it's not a problem in practice.

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.

+1

erlend-aasland avatar Nov 14 '22 17:11 erlend-aasland