From 52ff864c5889a2a20f8f71b504ecb6a85b6660f1 Mon Sep 17 00:00:00 2001 From: Julien Olivain Date: Sun, 18 Jan 2026 16:22:50 +0100 Subject: [PATCH] support/testing: test_python.py: disable interpreter colors Python 3.14 (not yet in Buildroot) introduced colors, enabled by default, when the output is a terminal. This behavior can make the pexpect pattern matching more difficult in some cases. See: https://docs.python.org/3.14/using/cmdline.html#controlling-color This commit globally disables the Python interpreter colors in the base runtime Python test, by setting the NO_COLOR=1 environment variable. Signed-off-by: Julien Olivain (cherry picked from commit 3a6e2b4a0395f6e049cd847cf16406a4d0d998ad) Signed-off-by: Thomas Perale --- support/testing/tests/package/test_python.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/support/testing/tests/package/test_python.py b/support/testing/tests/package/test_python.py index c9ecf9acda..e815376d21 100644 --- a/support/testing/tests/package/test_python.py +++ b/support/testing/tests/package/test_python.py @@ -17,6 +17,9 @@ class TestPythonBase(infra.basetest.BRTest): kernel="builtin", options=["-initrd", cpio_file]) self.emulator.login() + # Disable Python colors for all Python tests, to make pexpect + # pattern matching easier. + self.assertRunOk("export NO_COLOR=1") def version_test(self, version, timeout=-1): cmd = self.interpreter + " --version 2>&1 | grep '^{}'".format(version)