Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Lib/test/test_pyrepl/test_pyrepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
import pty
except ImportError:
pty = None
try:
import readline as readline_module
except ImportError:
readline_module = None


class ReplTestCase(TestCase):
Expand Down Expand Up @@ -1947,9 +1951,12 @@ def test_no_newline(self):
commands = "print('Something pretty long', end='')\nexit()\n"
expected_output_sequence = "Something pretty long>>> exit()"

basic_output, basic_exit_code = self.run_repl(commands, env=env)
self.assertEqual(basic_exit_code, 0)
self.assertIn(expected_output_sequence, basic_output)
# gh-143394: The basic REPL needs the readline module to turn off
# ECHO terminal attribute.
if readline_module is not None:
basic_output, basic_exit_code = self.run_repl(commands, env=env)
self.assertEqual(basic_exit_code, 0)
self.assertIn(expected_output_sequence, basic_output)

output, exit_code = self.run_repl(commands)
self.assertEqual(exit_code, 0)
Expand Down
Loading