Skip to content

Commit 64d9f36

Browse files
yihong0618adqm
andauthored
Apply suggestions from code review
Co-authored-by: adam j hartz <[email protected]>
1 parent 2c4944c commit 64d9f36

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_pydoc/test_pydoc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,7 +2180,7 @@ def mock_getline(prompt):
21802180
helper.interact()
21812181

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

21852185
def test_keywords(self):
21862186
self.assertEqual(sorted(pydoc.Helper.keywords),
@@ -2190,7 +2190,7 @@ def test_interact_empty_line_continues(self):
21902190
# gh-138568: test pressing Enter without input should continue in help session
21912191
self.assertEqual(
21922192
self.mock_interactive_session(["", " ", "quit"]),
2193-
["", "help> ", "help> ", "help> quit", ""],
2193+
["help> ", "help> ", "help> quit"],
21942194
)
21952195

21962196
def test_interact_quit_commands_exit(self):
@@ -2199,7 +2199,7 @@ def test_interact_quit_commands_exit(self):
21992199
with self.subTest(quit_command=quit_cmd):
22002200
self.assertEqual(
22012201
self.mock_interactive_session([quit_cmd]),
2202-
["", f"help> {quit_cmd}", ""],
2202+
[f"help> {quit_cmd}"],
22032203
)
22042204

22052205

0 commit comments

Comments
 (0)