There was an error while loading. Please reload this page.
^J
1 parent cdb2a63 commit 5290aafCopy full SHA for 5290aaf
1 file changed
Lib/test/test_pdb.py
@@ -4996,6 +4996,16 @@ def test_code_display(self):
4996
p.set_trace(commands=['ll', 'c'])
4997
self.assertNotIn("\x1b", output.getvalue())
4998
4999
+ def test_list_does_not_colorize_trailing_newlines(self):
5000
+ # Keep the marker split so it is not present in the listed source.
5001
+ caret_newline = "^" + "J"
5002
+ output = io.StringIO()
5003
+ p = pdb.Pdb(stdout=output, colorize=True)
5004
+ p.set_trace(commands=['list', 'continue'])
5005
+ result = output.getvalue()
5006
+ self.assertIn("\x1b", result)
5007
+ self.assertNotIn(caret_newline, result)
5008
+
5009
def test_stack_entry(self):
5010
output = io.StringIO()
5011
p = pdb.Pdb(stdout=output, colorize=True)
0 commit comments