mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
gh-94808: Add coverage for bytesarray_setitem (#95802)
This commit is contained in:
parent
187e853690
commit
dfcdee4a18
2 changed files with 85 additions and 41 deletions
|
|
@ -4846,6 +4846,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)
|
||||
{
|
||||
|
|
@ -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},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue