[Python-Dev] Re: testing the Python/C API (was: Re: [Patches] PyObject_GetAttr/PyObject_SetAttr core dumps if given non-string names)

Trent Mick trentm@activestate.com
Tue, 27 Jun 2000 10:37:00 -0700


On Tue, Jun 27, 2000 at 01:21:28PM -0400, Jeremy Hylton wrote:
> 
> I don't think I understand the suggested approach well enough to
> critique it.  Most of the tests need to be written in C, right?  When

All of the testing code would be in C, in the _testmodule.c, or whatever
name.

> an error is encountered, it seems that you should check what the C API
> returns *and* what happens at the Python level, i.e. whether the call
> sets a Python exception (or clears an existing Python exception).

Yes you are right. It depends on the API under test. Basically you just try
to test all conditions to ensure that the API behaves as expected/advertised.


> 
> I guess you ought to show us the code.  I don't think it will go in
> Python 1.6, but it sounds like a valuable component for future
> releases. 
> 

Okay. I agree that this would probably not make 1.6 so I will probably wait
on this for a little while. Busy.


Trent

-- 
Trent Mick
trentm@activestate.com