Skip to content

Commit 4032012

Browse files
committed
[3.13] gh-141794: Reduce size of compiler stress tests to fix Android warnings (GH-142263)
(cherry picked from commit f193c8f) Co-authored-by: Malcolm Smith <[email protected]>
1 parent a12841c commit 4032012

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Lib/test/test_compile.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,11 +993,13 @@ def test_path_like_objects(self):
993993
# An implicit test for PyUnicode_FSDecoder().
994994
compile("42", FakePath("test_compile_pathlike"), "single")
995995

996+
# bpo-31113: Stack overflow when compile a long sequence of
997+
# complex statements.
996998
@support.requires_resource('cpu')
997999
def test_stack_overflow(self):
998-
# bpo-31113: Stack overflow when compile a long sequence of
999-
# complex statements.
1000-
compile("if a: b\n" * 200000, "<dummy>", "exec")
1000+
# Android test devices have less memory.
1001+
size = 100_000 if sys.platform == "android" else 200_000
1002+
compile("if a: b\n" * size, "<dummy>", "exec")
10011003

10021004
# Multiple users rely on the fact that CPython does not generate
10031005
# bytecode for dead code blocks. See bpo-37500 for more context.

0 commit comments

Comments
 (0)