diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py index 8e4c28562a6cbe..e6f233ea574a13 100644 --- a/Lib/test/test_traceback.py +++ b/Lib/test/test_traceback.py @@ -3431,6 +3431,23 @@ def test_format_smoke(self): [' File "foo.py", line 1, in fred\n line\n'], s.format()) + def test_print_list_matches_format_list(self): + frame = traceback.FrameSummary('foo.py', 1, 'fred', line='line') + inputs = [ + ('tuple', [('foo.py', 1, 'fred', 'line')]), + ('FrameSummary', [frame]), + ('StackSummary', + traceback.StackSummary.from_list([('foo.py', 1, 'fred', 'line')])), + ] + for input_type, extracted_list in inputs: + with self.subTest(input_type=input_type): + file = StringIO() + traceback.print_list(extracted_list, file=file) + self.assertEqual( + file.getvalue(), + ''.join(traceback.format_list(extracted_list)), + ) + def test_locals(self): linecache.updatecache('/foo.py', globals()) c = test_code('/foo.py', 'method') diff --git a/Misc/ACKS b/Misc/ACKS index 4a3f6482294e08..0517e6e024af59 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -404,6 +404,7 @@ Laura Creighton Nick Crews Tyler Crompton Simon Cross +Basil Crow Felipe Cruz Drew Csillag Alessandro Cucci