File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -2285,11 +2285,17 @@ def tearDown(self) -> None:
22852285@cpython_only
22862286@force_not_colorized_test_class
22872287class TestFallbackFormatWhenIOUnavailable (unittest .TestCase , TracebackFormatMixin ):
2288+ """See GH-142737."""
2289+
22882290 def setUp (self ) -> None :
22892291 import io
22902292 self .original_io = io
22912293 self .original_hook = traceback ._print_exception_bltin
2294+
2295+ # Triggers fallback path
22922296 traceback ._print_exception_bltin = object ()
2297+
2298+ # StringIO is still needed for test.support.captured_output() to work
22932299 sys .modules ['io' ] = types .SimpleNamespace (StringIO = io .StringIO )
22942300 return super ().setUp ()
22952301
@@ -2300,6 +2306,7 @@ def test_unhashable(self):
23002306 def test_traceback_format_with_cleared_frames (self ):
23012307 raise unittest .SkipTest (
23022308 "io unavailable (test requires source lines to be captured in tracebacks)" )
2309+
23032310 def test_traceback_format (self ):
23042311 raise unittest .SkipTest (
23052312 "io unavailable (test requires source lines to be captured in tracebacks)" )
You can’t perform that action at this time.
0 commit comments