https://github.com/python/cpython/commit/3206fc74fbb4a99e0a7e43ebbad86f68ab32a631 commit: 3206fc74fbb4a99e0a7e43ebbad86f68ab32a631 branch: 3.15 author: Miss Islington (bot) <[email protected]> committer: sobolevn <[email protected]> date: 2026-06-27T15:37:40Z summary:
[3.15] gh-152391: Improve `test_interpreters.test_stress` test (GH-152396) (#152427) gh-152391: Improve `test_interpreters.test_stress` test (GH-152396) (cherry picked from commit 219f7a9453a2a89266f6e65d75df1606b4816043) Co-authored-by: sobolevn <[email protected]> files: M Lib/test/test_interpreters/test_stress.py diff --git a/Lib/test/test_interpreters/test_stress.py b/Lib/test/test_interpreters/test_stress.py index 50d87a6ccd3cadb..50d2444a4c72d31 100644 --- a/Lib/test/test_interpreters/test_stress.py +++ b/Lib/test/test_interpreters/test_stress.py @@ -25,6 +25,7 @@ def test_create_many_sequential(self): del alive support.gc_collect() + @threading_helper.requires_working_threading() @support.bigmemtest(size=200, memuse=32*2**20, dry_run=False) def test_create_many_threaded(self, size): alive = [] @@ -80,9 +81,12 @@ def test_create_interpreter_no_memory(self): import _testcapi assertion = self.assertRaises(InterpreterError) - _testcapi.set_nomemory(0, 1) - with assertion: - _interpreters.create() + try: + _testcapi.set_nomemory(0, 1) + with assertion: + _interpreters.create() + finally: + _testcapi.remove_mem_hooks() if __name__ == '__main__': _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]
