Skip to content

Commit 5db08d0

Browse files
committed
gh-112730: Respect tests that require environment variables with no-colorize fixes
1 parent 5da0280 commit 5db08d0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/test/test_traceback.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ def f():
384384
])
385385

386386
@requires_subprocess()
387+
@force_not_colorized
387388
def test_encoded_file(self):
388389
# Test that tracebacks are correctly printed for encoded source files:
389390
# - correct line number (Issue2384)
@@ -410,7 +411,7 @@ def do_test(firstlines, message, charset, lineno):
410411
""".format(firstlines, message))
411412

412413
process = subprocess.Popen([sys.executable, TESTFN],
413-
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env={})
414+
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
414415
stdout, stderr = process.communicate()
415416
stdout = stdout.decode(output_encoding).splitlines()
416417
finally:

Lib/test/test_tracemalloc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
interpreter_requires_environment)
99
from test import support
1010
from test.support import os_helper
11+
from test.support import force_not_colorized
1112

1213
try:
1314
import _testcapi
@@ -938,11 +939,12 @@ def test_env_limit(self):
938939
stdout = stdout.rstrip()
939940
self.assertEqual(stdout, b'10')
940941

942+
@force_not_colorized
941943
def check_env_var_invalid(self, nframe):
942944
with support.SuppressCrashReport():
943945
ok, stdout, stderr = assert_python_failure(
944946
'-c', 'pass',
945-
PYTHONTRACEMALLOC=str(nframe), __cleanenv=True)
947+
PYTHONTRACEMALLOC=str(nframe))
946948

947949
if b'ValueError: the number of frames must be in range' in stderr:
948950
return

0 commit comments

Comments
 (0)