summaryrefslogtreecommitdiffstats
path: root/Modules/_testinternalcapi.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2024-08-12 19:19:33 (GMT)
committerGitHub <noreply@github.com>2024-08-12 19:19:33 (GMT)
commit503af8fe9a93ea6bc5bdfc76eb56b106a47c7292 (patch)
treee51b1b7bbfdb6862d48fd846207cedc85f0678c1 /Modules/_testinternalcapi.c
parentab094d1b2b348f670743f88e52d1a3f2cab5abd5 (diff)
downloadcpython-503af8fe9a93ea6bc5bdfc76eb56b106a47c7292.zip
cpython-503af8fe9a93ea6bc5bdfc76eb56b106a47c7292.tar.gz
cpython-503af8fe9a93ea6bc5bdfc76eb56b106a47c7292.tar.bz2
gh-117482: Make the Slot Wrapper Inheritance Tests Much More Thorough (gh-122867)
There were a still a number of gaps in the tests, including not looking at all the builtin types and not checking wrappers in subinterpreters that weren't in the main interpreter. This fixes all that. I considered incorporating the names of the PyTypeObject fields (a la gh-122866), but figured doing so doesn't add much value.
Diffstat (limited to 'Modules/_testinternalcapi.c')
-rw-r--r--Modules/_testinternalcapi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c
index 6e6386b..00174ff 100644
--- a/Modules/_testinternalcapi.c
+++ b/Modules/_testinternalcapi.c
@@ -2035,6 +2035,20 @@ gh_119213_getargs_impl(PyObject *module, PyObject *spam)
}
+static PyObject *
+get_static_builtin_types(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _PyStaticType_GetBuiltins();
+}
+
+
+static PyObject *
+identify_type_slot_wrappers(PyObject *self, PyObject *Py_UNUSED(ignored))
+{
+ return _PyType_GetSlotWrapperNames();
+}
+
+
static PyMethodDef module_functions[] = {
{"get_configs", get_configs, METH_NOARGS},
{"get_recursion_depth", get_recursion_depth, METH_NOARGS},
@@ -2129,6 +2143,8 @@ static PyMethodDef module_functions[] = {
{"uop_symbols_test", _Py_uop_symbols_test, METH_NOARGS},
#endif
GH_119213_GETARGS_METHODDEF
+ {"get_static_builtin_types", get_static_builtin_types, METH_NOARGS},
+ {"identify_type_slot_wrappers", identify_type_slot_wrappers, METH_NOARGS},
{NULL, NULL} /* sentinel */
};