8000 gh-128595: Add test class helper to force no terminal colour by hugovk · Pull Request #128687 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128595: Add test class helper to force no terminal colour #128687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests when running with FORCE_COLOR=1
  • Loading branch information
hugovk committed Jan 10, 2025
commit 6daa3c33bb4171693d522e4880c305b87a400b23
1 change: 1 addition & 0 deletions Lib/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2274,6 +2274,7 @@ def test_range_of_offsets(self):
self.assertIn(expected, err.getvalue())
the_exception = exc

@force_not_colorized
def test_subclass(self):
class MySyntaxError(SyntaxError):
pass
Expand Down
11 changes: 7 additions & 4 deletions Lib/test/test_unittest/test_result.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import io
import sys
import textwrap

from test.support import warnings_helper, captured_stdout

import traceback
import unittest
from unittest.util import strclass
from test.support import force_not_colorized
from test.support import warnings_helper
from test.support import (
captured_stdout,
force_not_colorized,
force_not_colorized_test_class,
)
from test.test_unittest.support import BufferedWriter


Expand Down Expand Up @@ -772,6 +774,7 @@ def testFoo(self):
runner.run(Test('testFoo'))


@force_not_colorized_test_class
class TestOutputBuffering(unittest.TestCase):

def setUp(self):
Expand Down
Loading
0