Skip to content

Commit 4fecd76

Browse files
committed
remove C API internal tests
1 parent 574184c commit 4fecd76

File tree

3 files changed

+1
-68
lines changed

3 files changed

+1
-68
lines changed

Lib/test/test_capi/test_exceptions.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -256,23 +256,6 @@ def test_set_string(self):
256256
# CRASHES setstring(ZeroDivisionError, NULL)
257257
# CRASHES setstring(NULL, b'error')
258258

259-
def test_set_locale_string(self):
260-
# test _PyErr_SetLocaleString()
261-
setlocalestring = _testcapi.err_setlocalestring
262-
with self.assertRaises(ZeroDivisionError) as e:
263-
setlocalestring(ZeroDivisionError, b'error')
264-
self.assertEqual(e.exception.args, ('error',))
265-
with self.assertRaises(ZeroDivisionError) as e:
266-
setlocalestring(ZeroDivisionError, 'помилка'.encode())
267-
self.assertEqual(e.exception.args, ('помилка',))
268-
269-
with self.assertRaises(ZeroDivisionError):
270-
setlocalestring(ZeroDivisionError, b'\xff')
271-
self.assertRaises(SystemError, setlocalestring, list, b'error')
272-
273-
# CRASHES setlocalestring(ZeroDivisionError, NULL)
274-
# CRASHES setlocalestring(NULL, b'error')
275-
276259
def test_format(self):
277260
"""Test PyErr_Format()"""
278261
import_helper.import_module('ctypes')

Modules/_testcapi/clinic/exceptions.c.h

Lines changed: 1 addition & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/_testcapi/exceptions.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,6 @@ _testcapi_err_setstring_impl(PyObject *module, PyObject *exc,
157157
return NULL;
158158
}
159159

160-
/*[clinic input]
161-
_testcapi.err_setlocalestring
162-
exc: object
163-
value: str(zeroes=True, accept={robuffer, str, NoneType})
164-
/
165-
[clinic start generated code]*/
166-
167-
static PyObject *
168-
_testcapi_err_setlocalestring_impl(PyObject *module, PyObject *exc,
169-
const char *value,
170-
Py_ssize_t value_length)
171-
/*[clinic end generated code: output=5c02a10d4eb573d7 input=628c26bdc2497a92]*/
172-
{
173-
NULLABLE(exc)
174-
_PyErr_SetLocaleString(exc, value);
175-
return NULL;
176-
}
177-
178160

179161
/*[clinic input]
180162
_testcapi.err_setfromerrnowithfilename
@@ -418,7 +400,6 @@ static PyMethodDef test_methods[] = {
418400
_TESTCAPI_EXC_SET_OBJECT_METHODDEF
419401
_TESTCAPI_EXC_SET_OBJECT_FETCH_METHODDEF
420402
_TESTCAPI_ERR_SETSTRING_METHODDEF
421-
_TESTCAPI_ERR_SETLOCALESTRING_METHODDEF
422403
_TESTCAPI_ERR_SETFROMERRNOWITHFILENAME_METHODDEF
423404
_TESTCAPI_RAISE_EXCEPTION_METHODDEF
424405
_TESTCAPI_RAISE_MEMORYERROR_METHODDEF

0 commit comments

Comments
 (0)