Repository navigation
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
This line:
cpython/Lib/test/test_bigmem.py
Line 13 in a00464b
| _testcapi = import_helper.import_module('_testcapi') |
causes the entire test module to be skipped if _testcapi isn't available but, the only test requiring it is:
cpython/Lib/test/test_bigmem.py
Lines 1261 to 1279 in a00464b
| class ImmortalityTest(unittest.TestCase): | |
| @bigmemtest(size=_2G, memuse=pointer_size * 9/8) | |
| def test_stickiness(self, size): | |
| """Check that immortality is "sticky", so that | |
| once an object is immortal it remains so.""" | |
| if size < _2G: | |
| # Not enough memory to cause immortality on overflow | |
| return | |
| o1 = o2 = o3 = o4 = o5 = o6 = o7 = o8 = object() | |
| l = [o1] * (size-20) | |
| self.assertFalse(_testcapi.is_immortal(o1)) | |
| for _ in range(30): | |
| l.append(l[0]) | |
| self.assertTrue(_testcapi.is_immortal(o1)) | |
| del o2, o3, o4, o5, o6, o7, o8 | |
| self.assertTrue(_testcapi.is_immortal(o1)) | |
| del l | |
| self.assertTrue(_testcapi.is_immortal(o1)) |
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
StanFromIreland commentedon Jun 25, 2026
Do you want to open a PR?
ShaharNaveh commentedon Jun 25, 2026
Would love to!
StanFromIreland commentedon Jun 25, 2026
Great, if you have any questions feel free to ask here.
gh-152168: Don't skip `test_bigmem` if `_testcapi` is missing (#152171)
[3.15] gh-152168: Don't skip `test_bigmem` if `_testcapi` is missing (G…
[3.14] gh-152168: Don't skip `test_bigmem` if `_testcapi` is missing (G…