[3.12] gh-117482: Fix the Slot Wrapper Inheritance Tests (gh-122250)

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.

(cherry-picked from commit 490e0ad83a, AKA gh-122248)
This commit is contained in:
Eric Snow 2024-07-29 10:25:17 -06:00 committed by GitHub
parent e29910447b
commit 5bd2ea2b94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 129 additions and 50 deletions

View file

@ -163,15 +163,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();