gh-91324: List feature macros in the stable ABI manifest, improve tests (GH-32415)

This commit is contained in:
Petr Viktorin 2022-04-28 16:30:28 +02:00 committed by GitHub
parent d1de10784d
commit 6dcbc08c95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 232 additions and 23 deletions

View file

@ -5919,6 +5919,18 @@ frame_getlasti(PyObject *self, PyObject *frame)
return PyLong_FromLong(lasti);
}
static PyObject *
get_feature_macros(PyObject *self, PyObject *Py_UNUSED(args))
{
PyObject *result = PyDict_New();
if (!result) {
return NULL;
}
int res;
#include "_testcapi_feature_macros.inc"
return result;
}
static PyObject *negative_dictoffset(PyObject *, PyObject *);
static PyObject *test_buildvalue_issue38913(PyObject *, PyObject *);
@ -6214,6 +6226,7 @@ static PyMethodDef TestMethods[] = {
{"frame_getgenerator", frame_getgenerator, METH_O, NULL},
{"frame_getbuiltins", frame_getbuiltins, METH_O, NULL},
{"frame_getlasti", frame_getlasti, METH_O, NULL},
{"get_feature_macros", get_feature_macros, METH_NOARGS, NULL},
{NULL, NULL} /* sentinel */
};