gh-112730: Make the test suite resilient to color-activation environment variables (#117672)

This commit is contained in:
Pablo Galindo Salgado 2024-04-24 21:25:22 +01:00 committed by GitHub
parent 59a4d52973
commit 345e1e04ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 89 additions and 16 deletions

View file

@ -10,6 +10,7 @@ import textwrap
import unittest
from test import support
from test.support import os_helper
from test.support import force_not_colorized
from test.support.script_helper import (
spawn_python, kill_python, assert_python_ok, assert_python_failure,
interpreter_requires_environment
@ -1027,6 +1028,7 @@ class IgnoreEnvironmentTest(unittest.TestCase):
class SyntaxErrorTests(unittest.TestCase):
@force_not_colorized
def check_string(self, code):
proc = subprocess.run([sys.executable, "-"], input=code,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)