diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2024-04-24 21:25:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-24 21:25:22 +0100 |
commit | 345e1e04ec72698a1e257c805b3840d9f55eb80d (patch) | |
tree | 7a96eb0b69525fa33dd552b4ba952c4c857e3896 /Lib/idlelib/idle_test | |
parent | 59a4d52973ca73bd739f914e88243a31dbef6b32 (diff) | |
download | cpython-345e1e04ec72698a1e257c805b3840d9f55eb80d.tar.gz cpython-345e1e04ec72698a1e257c805b3840d9f55eb80d.zip |
gh-112730: Make the test suite resilient to color-activation environment variables (#117672)
Diffstat (limited to 'Lib/idlelib/idle_test')
-rw-r--r-- | Lib/idlelib/idle_test/test_run.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/idlelib/idle_test/test_run.py b/Lib/idlelib/idle_test/test_run.py index a38e43dcb9d..83ecbffa2a1 100644 --- a/Lib/idlelib/idle_test/test_run.py +++ b/Lib/idlelib/idle_test/test_run.py @@ -8,6 +8,7 @@ import unittest from unittest import mock import idlelib from idlelib.idle_test.mock_idle import Func +from test.support import force_not_colorized idlelib.testing = True # Use {} for executing test user code. @@ -46,6 +47,7 @@ class ExceptionTest(unittest.TestCase): "Did you mean: 'real'?\n"), ) + @force_not_colorized def test_get_message(self): for code, exc, msg in self.data: with self.subTest(code=code): @@ -57,6 +59,7 @@ class ExceptionTest(unittest.TestCase): expect = f'{exc.__name__}: {msg}' self.assertEqual(actual, expect) + @force_not_colorized @mock.patch.object(run, 'cleanup_traceback', new_callable=lambda: (lambda t, e: None)) def test_get_multiple_message(self, mock): |