Skip to content

Commit 1a971f4

Browse files
committed
Add some docs & comments to tests
1 parent 092356b commit 1a971f4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_traceback.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,11 +2285,17 @@ def tearDown(self) -> None:
22852285
@cpython_only
22862286
@force_not_colorized_test_class
22872287
class 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)")

0 commit comments

Comments
 (0)