mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
Revert "gh-128770: raise warnings as errors in test suite - except for test_socket which still logs warnings (#128726)" (#128936)
This commit is contained in:
parent
939df0f9f6
commit
76856ae165
3 changed files with 24 additions and 45 deletions
|
|
@ -1324,21 +1324,22 @@ def test_readline_history_file(self):
|
|||
if readline.backend != "editline":
|
||||
self.skipTest("GNU readline is not affected by this issue")
|
||||
|
||||
with tempfile.NamedTemporaryFile() as hfile:
|
||||
env = os.environ.copy()
|
||||
env["PYTHON_HISTORY"] = hfile.name
|
||||
hfile = tempfile.NamedTemporaryFile()
|
||||
self.addCleanup(unlink, hfile.name)
|
||||
env = os.environ.copy()
|
||||
env["PYTHON_HISTORY"] = hfile.name
|
||||
|
||||
env["PYTHON_BASIC_REPL"] = "1"
|
||||
output, exit_code = self.run_repl("spam \nexit()\n", env=env)
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertIn("spam ", output)
|
||||
self.assertNotEqual(pathlib.Path(hfile.name).stat().st_size, 0)
|
||||
self.assertIn("spam\\040", pathlib.Path(hfile.name).read_text())
|
||||
env["PYTHON_BASIC_REPL"] = "1"
|
||||
output, exit_code = self.run_repl("spam \nexit()\n", env=env)
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertIn("spam ", output)
|
||||
self.assertNotEqual(pathlib.Path(hfile.name).stat().st_size, 0)
|
||||
self.assertIn("spam\\040", pathlib.Path(hfile.name).read_text())
|
||||
|
||||
env.pop("PYTHON_BASIC_REPL", None)
|
||||
output, exit_code = self.run_repl("exit\n", env=env)
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertNotIn("\\040", pathlib.Path(hfile.name).read_text())
|
||||
env.pop("PYTHON_BASIC_REPL", None)
|
||||
output, exit_code = self.run_repl("exit\n", env=env)
|
||||
self.assertEqual(exit_code, 0)
|
||||
self.assertNotIn("\\040", pathlib.Path(hfile.name).read_text())
|
||||
|
||||
def test_keyboard_interrupt_after_isearch(self):
|
||||
output, exit_code = self.run_repl(["\x12", "\x03", "exit"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue