Skip to content
Prev Previous commit
Apply suggestions from code review
Co-authored-by: adam j hartz <hz@mit.edu>
  • Loading branch information
yihong0618 and adqm authored Sep 10, 2025
commit 64d9f3661153775146671180801d140f6b50f815
6 changes: 3 additions & 3 deletions Lib/test/test_pydoc/test_pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2180,7 +2180,7 @@ def mock_getline(prompt):
helper.interact()

# handle different line endings across platforms consistently
return output.getvalue().splitlines(keepends=False) + ['']
return output.getvalue().strip().splitlines(keepends=False)

def test_keywords(self):
self.assertEqual(sorted(pydoc.Helper.keywords),
Expand All @@ -2190,7 +2190,7 @@ def test_interact_empty_line_continues(self):
# gh-138568: test pressing Enter without input should continue in help session
self.assertEqual(
self.mock_interactive_session(["", " ", "quit"]),
["", "help> ", "help> ", "help> quit", ""],
["help> ", "help> ", "help> quit"],
)

def test_interact_quit_commands_exit(self):
Expand All @@ -2199,7 +2199,7 @@ def test_interact_quit_commands_exit(self):
with self.subTest(quit_command=quit_cmd):
self.assertEqual(
self.mock_interactive_session([quit_cmd]),
["", f"help> {quit_cmd}", ""],
[f"help> {quit_cmd}"],
)


Expand Down
Loading