_testcapi.set_nomemory is very specific to the allocations count. So, it can't be tested on other implementations reliably.
It can't be tested on CPython reliably either, free-threading builds, JIT builds, various platforms all do different things. I don't think we should mark tests as CPython only simply because they use _testcapi.
Yes, they can be ~reliably tested in CPython :)
Because they are right now. They execute on different envs, diffent builds.
But, we can't enforce tests of the internal details and memory management tests on other implementations. Other implementations will use different memory allocation patterns.
Activity
StanFromIreland commented on Jun 25, 2026
I think this is wrong, I know at least RustPython is trying to implement _testcapi.
StanFromIreland commented on Jun 25, 2026
Oh and how could I (almost) forget! We provide it in PyPy.
sobolevn commented on Jun 25, 2026
_testcapi.set_nomemory is very specific to the allocations count. So, it can't be tested on other implementations reliably.
StanFromIreland commented on Jun 25, 2026
It can't be tested on CPython reliably either, free-threading builds, JIT builds, various platforms all do different things. I don't think we should mark tests as CPython only simply because they use _testcapi.
sobolevn commented on Jun 25, 2026
Yes, they can be ~reliably tested in CPython :)
Because they are right now. They execute on different envs, diffent builds.
But, we can't enforce tests of the internal details and memory management tests on other implementations. Other implementations will use different memory allocation patterns.
gh-152236: Fix skips on `_testcapi.set_nomemory` tests (#152253)
[3.14] gh-152236: Fix skips on `_testcapi.set_nomemory` tests (GH-152253
[3.15] gh-152236: Fix skips on `_testcapi.set_nomemory` tests (GH-152253
[3.13] gh-152236: Fix skips on `_testcapi.set_nomemory` tests (GH-152253