mirror of
https://github.com/python/cpython.git
synced 2025-12-10 02:50:09 +00:00
gh-117482: Fix the Slot Wrapper Inheritance Tests (gh-122248)
The tests were only checking cases where the slot wrapper was present in the initial case. They were missing when the slot wrapper was added in the additional initializations. This fixes that.
This commit is contained in:
parent
89fa05fdce
commit
490e0ad83a
4 changed files with 141 additions and 46 deletions
|
|
@ -170,15 +170,23 @@ PyInit_embedded_ext(void)
|
|||
static int test_repeated_init_exec(void)
|
||||
{
|
||||
if (main_argc < 3) {
|
||||
fprintf(stderr, "usage: %s test_repeated_init_exec CODE\n", PROGRAM);
|
||||
fprintf(stderr,
|
||||
"usage: %s test_repeated_init_exec CODE ...\n", PROGRAM);
|
||||
exit(1);
|
||||
}
|
||||
const char *code = main_argv[2];
|
||||
int loops = main_argc > 3
|
||||
? main_argc - 2
|
||||
: INIT_LOOPS;
|
||||
|
||||
for (int i=1; i <= INIT_LOOPS; i++) {
|
||||
fprintf(stderr, "--- Loop #%d ---\n", i);
|
||||
for (int i=0; i < loops; i++) {
|
||||
fprintf(stderr, "--- Loop #%d ---\n", i+1);
|
||||
fflush(stderr);
|
||||
|
||||
if (main_argc > 3) {
|
||||
code = main_argv[i+2];
|
||||
}
|
||||
|
||||
_testembed_Py_InitializeFromConfig();
|
||||
int err = PyRun_SimpleString(code);
|
||||
Py_Finalize();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue