gh-94808: add tests covering `PyEval_GetFuncDesc` function (GH-98300) · python/cpython@46a493e

GitHub

Original file line numberDiff line numberDiff line change@@ -5975,6 +5975,12 @@ eval_get_func_name(PyObject *self, PyObject *func)

59755975returnPyUnicode_FromString(PyEval_GetFuncName(func));

59765976}

597759775978+staticPyObject*

5979+eval_get_func_desc(PyObject*self, PyObject*func)

5980+{

5981+returnPyUnicode_FromString(PyEval_GetFuncDesc(func));

5982+}

5983+59785984staticPyObject*

59795985get_feature_macros(PyObject*self, PyObject*Py_UNUSED(args))

59805986{

@@ -6452,6 +6458,7 @@ static PyMethodDef TestMethods[] = {

64526458 {"frame_getbuiltins", frame_getbuiltins, METH_O, NULL},

64536459 {"frame_getlasti", frame_getlasti, METH_O, NULL},

64546460 {"eval_get_func_name", eval_get_func_name, METH_O, NULL},

6461+ {"eval_get_func_desc", eval_get_func_desc, METH_O, NULL},

64556462 {"get_feature_macros", get_feature_macros, METH_NOARGS, NULL},

64566463 {"test_code_api", test_code_api, METH_NOARGS, NULL},

64576464 {"settrace_to_record", settrace_to_record, METH_O, NULL},