Repository navigation
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-subinterpreterstype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
Description
There are several things that we can do better:
- Do not skip all tests if
_interpretersmodule is missingIt is only needed for two testscpython/Lib/test/test_interpreters/test_stress.py
Lines 7 to 8 in ea7f64a
# Raise SkipTest if subinterpreters not supported. _interpreters = import_helper.import_module('_interpreters') - Add
@threading_helper.requires_working_threading()tocpython/Lib/test/test_interpreters/test_stress.py
Lines 28 to 31 in ea7f64a
@support.bigmemtest(size=200, memuse=32*2**20, dry_run=False) def test_create_many_threaded(self, size): alive = [] start = threading.Event() - Remove memhooks from so they won't mess with the environment
cpython/Lib/test/test_interpreters/test_stress.py
Lines 79 to 85 in ea7f64a
def test_create_interpreter_no_memory(self): import _testcapi assertion = self.assertRaises(InterpreterError) _testcapi.set_nomemory(0, 1) with assertion: _interpreters.create()
I have a PR ready.
Linked PRs
- gh-152391: Improve
test_interpreters.test_stresstest #152396 - [3.15] gh-152391: Improve
test_interpreters.test_stresstest (GH-152396) #152427 - [3.14] gh-152391: Improve
test_interpreters.test_stresstest (GH-152396) #152428 - [3.13] gh-152391: Improve
test_interpreters.test_stresstest (GH-152396) #152430
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-subinterpreterstype-refactorCode refactoring (with no changes in behavior)Code refactoring (with no changes in behavior)
Projects
- StatusShow more project fieldsDone
Activity
StanFromIreland commentedon Jun 27, 2026
See also #148244
gh-152391: Improve `test_interpreters.test_stress` test (#152396)
[3.15] gh-152391: Improve `test_interpreters.test_stress` test (GH-15…
[3.14] gh-152391: Improve `test_interpreters.test_stress` test (GH-15…
[3.13] gh-152391: Improve `test_interpreters.test_stress` test (GH-15…