mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
gh-130999: Avoid exiting the new REPL when there are non-string candidates for suggestions (gh-131001)
This commit is contained in:
parent
5f61cde80a
commit
baccfdb3d4
4 changed files with 48 additions and 2 deletions
|
|
@ -1672,6 +1672,17 @@ def test_null_byte(self):
|
|||
self.assertEqual(exit_code, 0)
|
||||
self.assertNotIn("TypeError", output)
|
||||
|
||||
@force_not_colorized
|
||||
def test_non_string_suggestion_candidates(self):
|
||||
commands = ("import runpy\n"
|
||||
"runpy._run_module_code('blech', {0: '', 'bluch': ''}, '')\n"
|
||||
"exit()\n")
|
||||
|
||||
output, exit_code = self.run_repl(commands)
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertNotIn("all elements in 'candidates' must be strings", output)
|
||||
self.assertIn("bluch", output)
|
||||
|
||||
def test_readline_history_file(self):
|
||||
# skip, if readline module is not available
|
||||
readline = import_module('readline')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue