mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-117968: Add tests for the part of the PyRun family of the C API (GH-117982)
Co-authored-by: NGRsoftlab <78017794+NGRsoftlab@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
This commit is contained in:
parent
c1d7147c82
commit
6078f2033e
7 changed files with 235 additions and 1 deletions
|
@ -3904,6 +3904,16 @@ PyInit__testcapi(void)
|
|||
PyModule_AddIntConstant(m, "the_number_three", 3);
|
||||
PyModule_AddIntMacro(m, Py_C_RECURSION_LIMIT);
|
||||
|
||||
if (PyModule_AddIntMacro(m, Py_single_input)) {
|
||||
return NULL;
|
||||
}
|
||||
if (PyModule_AddIntMacro(m, Py_file_input)) {
|
||||
return NULL;
|
||||
}
|
||||
if (PyModule_AddIntMacro(m, Py_eval_input)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
testcapistate_t *state = get_testcapi_state(m);
|
||||
state->error = PyErr_NewException("_testcapi.error", NULL, NULL);
|
||||
PyModule_AddObject(m, "error", state->error);
|
||||
|
@ -3998,6 +4008,9 @@ PyInit__testcapi(void)
|
|||
if (_PyTestCapi_Init_PyAtomic(m) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
if (_PyTestCapi_Init_Run(m) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
if (_PyTestCapi_Init_Hash(m) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue