diff options
author | Michael Droettboom <mdboom@gmail.com> | 2022-10-10 15:28:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-10 15:28:41 (GMT) |
commit | dfcdee4a18ece6f7c4fe1aa5830ee861f8b15b24 (patch) | |
tree | e1da8ab49ae56781272ca12d7d71647c38989643 /Modules | |
parent | 187e853690908ca2af19a0701ca7529b43d05df9 (diff) | |
download | cpython-dfcdee4a18ece6f7c4fe1aa5830ee861f8b15b24.zip cpython-dfcdee4a18ece6f7c4fe1aa5830ee861f8b15b24.tar.gz cpython-dfcdee4a18ece6f7c4fe1aa5830ee861f8b15b24.tar.bz2 |
gh-94808: Add coverage for bytesarray_setitem (#95802)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_testcapimodule.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 173d7c2..95c67fc 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4847,6 +4847,20 @@ sequence_setitem(PyObject *self, PyObject *args) static PyObject * +sequence_delitem(PyObject *self, PyObject *args) +{ + Py_ssize_t i; + PyObject *seq; + if (!PyArg_ParseTuple(args, "On", &seq, &i)) { + return NULL; + } + if (PySequence_DelItem(seq, i)) { + return NULL; + } + Py_RETURN_NONE; +} + +static PyObject * hasattr_string(PyObject *self, PyObject* args) { PyObject* obj; @@ -5885,6 +5899,7 @@ static PyMethodDef TestMethods[] = { {"write_unraisable_exc", test_write_unraisable_exc, METH_VARARGS}, {"sequence_getitem", sequence_getitem, METH_VARARGS}, {"sequence_setitem", sequence_setitem, METH_VARARGS}, + {"sequence_delitem", sequence_delitem, METH_VARARGS}, {"hasattr_string", hasattr_string, METH_VARARGS}, {"meth_varargs", meth_varargs, METH_VARARGS}, {"meth_varargs_keywords", _PyCFunction_CAST(meth_varargs_keywords), METH_VARARGS|METH_KEYWORDS}, |