[3.13] gh-141794: Reduce size of compiler stress tests to fix Android warnings (GH-142263) (#142409)

(cherry picked from commit f193c8fe9e)
This commit is contained in:
Malcolm Smith 2025-12-08 10:37:53 +00:00 committed by GitHub
parent a12841c197
commit 2ef7698127
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -993,11 +993,13 @@ def test_path_like_objects(self):
# An implicit test for PyUnicode_FSDecoder().
compile("42", FakePath("test_compile_pathlike"), "single")
# bpo-31113: Stack overflow when compile a long sequence of
# complex statements.
@support.requires_resource('cpu')
def test_stack_overflow(self):
# bpo-31113: Stack overflow when compile a long sequence of
# complex statements.
compile("if a: b\n" * 200000, "<dummy>", "exec")
# Android test devices have less memory.
size = 100_000 if sys.platform == "android" else 200_000
compile("if a: b\n" * size, "<dummy>", "exec")
# Multiple users rely on the fact that CPython does not generate
# bytecode for dead code blocks. See bpo-37500 for more context.