]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-112730: Respect tests that require environment variables with no-colorize fixes...
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Fri, 26 Apr 2024 20:23:30 +0000 (21:23 +0100)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2024 20:23:30 +0000 (21:23 +0100)
Lib/test/test_traceback.py
Lib/test/test_tracemalloc.py

index 19611937fc278b01271dcf7c2b30c80f0bf9961d..8927fccc28932094eee73a708ed97e82c5bed843 100644 (file)
@@ -384,6 +384,7 @@ class TracebackCases(unittest.TestCase):
         ])
 
     @requires_subprocess()
+    @force_not_colorized
     def test_encoded_file(self):
         # Test that tracebacks are correctly printed for encoded source files:
         # - correct line number (Issue2384)
@@ -410,7 +411,7 @@ class TracebackCases(unittest.TestCase):
                         """.format(firstlines, message))
 
                 process = subprocess.Popen([sys.executable, TESTFN],
-                    stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env={})
+                    stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
                 stdout, stderr = process.communicate()
                 stdout = stdout.decode(output_encoding).splitlines()
             finally:
index f685430a7d36adebf2223ac465589de4f7038e77..5755f7697de91aeff56c87d01a54e5e22fe5b5ee 100644 (file)
@@ -8,6 +8,7 @@ from test.support.script_helper import (assert_python_ok, assert_python_failure,
                                         interpreter_requires_environment)
 from test import support
 from test.support import os_helper
+from test.support import force_not_colorized
 
 try:
     import _testcapi
@@ -938,11 +939,12 @@ class TestCommandLine(unittest.TestCase):
         stdout = stdout.rstrip()
         self.assertEqual(stdout, b'10')
 
+    @force_not_colorized
     def check_env_var_invalid(self, nframe):
         with support.SuppressCrashReport():
             ok, stdout, stderr = assert_python_failure(
                 '-c', 'pass',
-                PYTHONTRACEMALLOC=str(nframe), __cleanenv=True)
+                PYTHONTRACEMALLOC=str(nframe))
 
         if b'ValueError: the number of frames must be in range' in stderr:
             return