mirror of
https://github.com/python/cpython.git
synced 2026-04-17 01:10:46 +00:00
[3.14] gh-143394: Skip pyrepl test_no_newline() basic REPL if readline is missing (GH-147973) (#148005)
gh-143394: Skip pyrepl test_no_newline() basic REPL if readline is missing (GH-147973)
(cherry picked from commit 97babb8ef7)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
83ee46c4c9
commit
1c3e3fbcfb
1 changed files with 10 additions and 3 deletions
|
|
@ -44,6 +44,10 @@
|
|||
import pty
|
||||
except ImportError:
|
||||
pty = None
|
||||
try:
|
||||
import readline as readline_module
|
||||
except ImportError:
|
||||
readline_module = None
|
||||
|
||||
|
||||
class ReplTestCase(TestCase):
|
||||
|
|
@ -1937,9 +1941,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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue