https://github.com/python/cpython/commit/e47e10150172d1262a92f340536a752a22eb6ea4 commit: e47e10150172d1262a92f340536a752a22eb6ea4 branch: 3.14 author: Miss Islington (bot) <[email protected]> committer: freakboy3742 <[email protected]> date: 2026-09-30T23:19:01Z summary:
[3.14] gh-158536: Skip some Android logging tests on OS versions with aggressive "chatty" filtering (GH-158531) (#158538) Address a test suite failure when run on Android 26-30 (inclusive) due to the adb logger dropping lines with a "chatty ... Identical 3 lines" marker. (cherry picked from commit 763b6edb0ec959bdfb78f098b76829365de36ca5) Co-authored-by: Malcolm Smith <[email protected]> files: M Lib/test/test_android.py diff --git a/Lib/test/test_android.py b/Lib/test/test_android.py index 31daafbc3d6300..edab0fe71a610a 100644 --- a/Lib/test/test_android.py +++ b/Lib/test/test_android.py @@ -1,4 +1,5 @@ import io +import platform import queue import re import subprocess @@ -16,6 +17,11 @@ if sys.platform != "android": raise unittest.SkipTest("Android-specific") +# Some API levels filter out consecutive identical lines and replace them with a +# "chatty" marker. +api_level = platform.android_ver().api_level +chatty_issue = (26 <= api_level <= 30) + # (name, level, fileno) STREAM_INFO = [("stdout", "I", 1), ("stderr", "W", 2)] @@ -174,15 +180,13 @@ def write(s, lines=None, *, write_len=None): write("\u0000b", [r"\xc0\x80b"]) write("a\u0000b", [r"a\xc0\x80b"]) - # Multi-line messages. Avoid identical consecutive lines, as - # they may activate "chatty" filtering and break the tests. - # - # Additional spaces will appear in the output where necessary to - # protect leading newlines. + # Multi-line messages. Additional spaces will appear in the output where + # necessary to protect leading newlines. write("\nx", [" "]) write("\na\n", ["x", "a"]) write("\n", [" "]) - write("\n\n", [" ", " "]) + if not chatty_issue: + write("\n\n", [" ", " "]) write("b\n", ["b"]) write("c\n\n", ["c", " "]) write("d\ne", ["d"]) @@ -201,7 +205,8 @@ def write(s, lines=None, *, write_len=None): write("\nx", [" ", "x"]) write("\na\n", [" ", "a"]) write("\n", [" "]) - write("\n\n", [" ", " "]) + if not chatty_issue: + write("\n\n", [" ", " "]) write("b\n", ["b"]) write("c\n\n", ["c", " "]) write("d\ne", ["d", "e"]) _______________________________________________ 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]
