Skip to content

Commit 6daa3c3

Browse files
committed
Fix tests when running with FORCE_COLOR=1
1 parent 72260f8 commit 6daa3c3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Lib/test/test_exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,6 +2274,7 @@ def test_range_of_offsets(self):
22742274
self.assertIn(expected, err.getvalue())
22752275
the_exception = exc
22762276

2277+
@force_not_colorized
22772278
def test_subclass(self):
22782279
class MySyntaxError(SyntaxError):
22792280
pass

Lib/test/test_unittest/test_result.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import io
22
import sys
33
import textwrap
4-
5-
from test.support import warnings_helper, captured_stdout
6-
74
import traceback
85
import unittest
96
from unittest.util import strclass
10-
from test.support import force_not_colorized
7+
from test.support import warnings_helper
8+
from test.support import (
9+
captured_stdout,
10+
force_not_colorized,
11+
force_not_colorized_test_class,
12+
)
1113
from test.test_unittest.support import BufferedWriter
1214

1315

@@ -772,6 +774,7 @@ def testFoo(self):
772774
runner.run(Test('testFoo'))
773775

774776

777+
@force_not_colorized_test_class
775778
class TestOutputBuffering(unittest.TestCase):
776779

777780
def setUp(self):

0 commit comments

Comments
 (0)