Skip to content

gh-155146: Do not depend on the exact number of allocations in test_class - #155150

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-155146-nomemory-alloc-index
Aug 4, 2026
Merged

gh-155146: Do not depend on the exact number of allocations in test_class#155150
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-155146-nomemory-alloc-index

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Try to fail every one of the first allocations and accept the first one which fails in the code detaching the instance dictionary from the object, instead of assuming that this is the first allocation after set_nomemory().

Also run the test with the test.support.isolation.runInSubprocess() decorator instead of executing it as a source string in a subprocess.

…test_class

Try to fail every one of the first allocations and accept the first one which
fails in the code detaching the instance dictionary from the object, instead
of assuming that this is the first allocation after set_nomemory().

Run the test with the test.support.isolation.runInSubprocess() decorator
instead of executing it as a source string in a subprocess.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting core review labels Aug 4, 2026
@serhiy-storchaka serhiy-storchaka added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Aug 4, 2026
@serhiy-storchaka
serhiy-storchaka merged commit 416c346 into python:main Aug 4, 2026
59 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

GH-155155 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Aug 4, 2026
@bedevere-app

bedevere-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

GH-155156 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Aug 4, 2026
@bedevere-app

bedevere-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

GH-155157 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Aug 4, 2026
serhiy-storchaka added a commit that referenced this pull request Aug 4, 2026
… test_class (GH-155150) (GH-155157)

Try to fail every one of the first allocations and accept the first one which
fails in the code detaching the instance dictionary from the object, instead
of assuming that this is the first allocation after set_nomemory().

Run the test with the test.support.isolation.runInSubprocess() decorator
instead of executing it as a source string in a subprocess.
(cherry picked from commit 416c346)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
serhiy-storchaka added a commit that referenced this pull request Aug 4, 2026
… test_class (GH-155150) (GH-155156)

Try to fail every one of the first allocations and accept the first one which
fails in the code detaching the instance dictionary from the object, instead
of assuming that this is the first allocation after set_nomemory().

Run the test with the test.support.isolation.runInSubprocess() decorator
instead of executing it as a source string in a subprocess.
(cherry picked from commit 416c346)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant