Skip to content

All tests in test_bigmem.py are skipped if _testcapi is not available #152168

Closed

Description

@ShaharNaveh

Bug report

Bug description:

This line:

_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:

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

Activity

  1. StanFromIreland commented on Jun 25, 2026

    @StanFromIreland
    Member

    Do you want to open a PR?

  2. ShaharNaveh commented on Jun 25, 2026

    @ShaharNaveh
    ContributorAuthor

    Do you want to open a PR?

    Would love to!

  3. StanFromIreland commented on Jun 25, 2026

    @StanFromIreland
    Member

    Great, if you have any questions feel free to ask here.

  4. added a commit that references this issue on Jun 25, 2026
  5. added 2 commits that reference this issue on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions