gh-155146: Do not depend on the exact number of allocations in test_class (GH-155150)
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>