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:
Eric Snow 2024-07-29 10:23:23 -06:00 committed by GitHub
parent 89fa05fdce
commit 490e0ad83a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 141 additions and 46 deletions

View file

@ -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();