mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-112730: Make the test suite resilient to color-activation environment variables (#117672)
This commit is contained in:
parent
59a4d52973
commit
345e1e04ec
13 changed files with 89 additions and 16 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue