osdir.com

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] Testing C API


Or maybe test_<name>_capi.py so you can more easily discover
test_unicode_cami while working on Unicode. You can use -m "test_*_capi" to
run all C API tests.

Victor

Le lundi 30 juillet 2018, Victor Stinner <vstinner at redhat.com> a ?crit :
> Buildbots have a timeout of 15 min per test. I suggest to use multiple
test_capi_<name>.py files rather than a directory which behaves as a single
test. Or regrtest should be modified to implement timeout differently.
>
> Victor
>
> Le dimanche 29 juillet 2018, Serhiy Storchaka <storchaka at gmail.com> a
?crit :
>> Currently C API is not completely covered by tests. Tests for particular
parts of C API are scattered through different files. There are files
completely purposed for testing C API (like test_capi.py,
test_getargs2.py), there are classes (usually having "CAPI" in the name) in
different files for testing C API specific for unicode, marshal. Argument
parsing tests are split between two files, test_capi.py, test_getargs2.py.
>>
>> I need to add new tests for new features, and I'm going to add new tests
for existing C API. But first I'm going to reorganize tests. Add a new
directory Lib/test/test_capi, and move all C API tests into it, grouped by
function prefixes. test_getargs.py for testing PyArg_*(), test_unicode.py
for testing PyUnicode_*(), etc. Tests that use the _testcapi module, but
don't test specific C API, will left on place.
>>
>> The benefit is that it will be easier to run all C API tests at once,
and only them, and it will be clearer what C API is covered by tests. The
disadvantage is that you will need to run several files for testing marshal
for example.
>>
>> What are your thoughts?
>>
>> _______________________________________________
>> Python-Dev mailing list
>> Python-Dev at python.org
>> https://mail.python.org/mailman/listinfo/python-dev
>> Unsubscribe:
https://mail.python.org/mailman/options/python-dev/vstinner%40redhat.com
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180730/33036574/attachment-0001.html>