Skip to content

Commit c5e2d8c

Browse files
committed
Remove test
1 parent 690201d commit c5e2d8c

File tree

2 files changed

+0
-57
lines changed

2 files changed

+0
-57
lines changed

Lib/test/test_capi/test_getargs.py

-17
Original file line numberDiff line numberDiff line change
@@ -901,23 +901,6 @@ def test_s_hash(self):
901901
self.assertRaises(TypeError, getargs_s_hash, memoryview(b'memoryview'))
902902
self.assertRaises(TypeError, getargs_s_hash, None)
903903

904-
def test_s_hash_int(self):
905-
# "s#" without PY_SSIZE_T_CLEAN defined.
906-
from _testcapi import getargs_s_hash_int
907-
from _testcapi import getargs_s_hash_int2
908-
buf = bytearray([1, 2])
909-
self.assertRaises(SystemError, getargs_s_hash_int, buf, "abc")
910-
self.assertRaises(SystemError, getargs_s_hash_int, buf, x=42)
911-
self.assertRaises(SystemError, getargs_s_hash_int, buf, x="abc")
912-
self.assertRaises(SystemError, getargs_s_hash_int2, buf, ("abc",))
913-
self.assertRaises(SystemError, getargs_s_hash_int2, buf, x=42)
914-
self.assertRaises(SystemError, getargs_s_hash_int2, buf, x="abc")
915-
buf.append(3) # still mutable -- not locked by a buffer export
916-
# getargs_s_hash_int(buf) may not raise SystemError because skipitem()
917-
# is not called. But it is an implementation detail.
918-
# getargs_s_hash_int(buf)
919-
# getargs_s_hash_int2(buf)
920-
921904
def test_z(self):
922905
from _testcapi import getargs_z
923906
self.assertEqual(getargs_z('abc\xe9'), b'abc\xc3\xa9')

Modules/_testcapi/getargs.c

-40
Original file line numberDiff line numberDiff line change
@@ -816,44 +816,6 @@ test_s_code(PyObject *self, PyObject *Py_UNUSED(ignored))
816816
Py_RETURN_NONE;
817817
}
818818

819-
#undef PyArg_ParseTupleAndKeywords
820-
PyAPI_FUNC(int) PyArg_ParseTupleAndKeywords(PyObject *, PyObject *,
821-
const char *, char **, ...);
822-
823-
static PyObject *
824-
getargs_s_hash_int(PyObject *self, PyObject *args, PyObject *kwargs)
825-
{
826-
static char *keywords[] = {"", "", "x", NULL};
827-
Py_buffer buf = {NULL};
828-
const char *s;
829-
int len;
830-
int i = 0;
831-
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "w*|s#i", keywords,
832-
&buf, &s, &len, &i))
833-
{
834-
return NULL;
835-
}
836-
PyBuffer_Release(&buf);
837-
Py_RETURN_NONE;
838-
}
839-
840-
static PyObject *
841-
getargs_s_hash_int2(PyObject *self, PyObject *args, PyObject *kwargs)
842-
{
843-
static char *keywords[] = {"", "", "x", NULL};
844-
Py_buffer buf = {NULL};
845-
const char *s;
846-
int len;
847-
int i = 0;
848-
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "w*|(s#)i", keywords,
849-
&buf, &s, &len, &i))
850-
{
851-
return NULL;
852-
}
853-
PyBuffer_Release(&buf);
854-
Py_RETURN_NONE;
855-
}
856-
857819
static PyObject *
858820
gh_99240_clear_args(PyObject *self, PyObject *args)
859821
{
@@ -906,8 +868,6 @@ static PyMethodDef test_methods[] = {
906868
{"getargs_positional_only_and_keywords", _PyCFunction_CAST(getargs_positional_only_and_keywords), METH_VARARGS|METH_KEYWORDS},
907869
{"getargs_s", getargs_s, METH_VARARGS},
908870
{"getargs_s_hash", getargs_s_hash, METH_VARARGS},
909-
{"getargs_s_hash_int", _PyCFunction_CAST(getargs_s_hash_int), METH_VARARGS|METH_KEYWORDS},
910-
{"getargs_s_hash_int2", _PyCFunction_CAST(getargs_s_hash_int2), METH_VARARGS|METH_KEYWORDS},
911871
{"getargs_s_star", getargs_s_star, METH_VARARGS},
912872
{"getargs_tuple", getargs_tuple, METH_VARARGS},
913873
{"getargs_u", getargs_u, METH_VARARGS},

0 commit comments

Comments
 (0)