(self)
| 2197 | self.assertIn("bluch", output) |
| 2198 | |
| 2199 | def test_readline_history_file(self): |
| 2200 | # skip, if readline module is not available |
| 2201 | readline = import_module('readline') |
| 2202 | if readline.backend != "editline": |
| 2203 | self.skipTest("GNU readline is not affected by this issue") |
| 2204 | |
| 2205 | with tempfile.NamedTemporaryFile() as hfile: |
| 2206 | env = os.environ.copy() |
| 2207 | env["PYTHON_HISTORY"] = hfile.name |
| 2208 | |
| 2209 | env["PYTHON_BASIC_REPL"] = "1" |
| 2210 | output, exit_code = self.run_repl("spam \nexit()\n", env=env) |
| 2211 | self.assertEqual(exit_code, 0) |
| 2212 | self.assertIn("spam ", output) |
| 2213 | self.assertNotEqual(pathlib.Path(hfile.name).stat().st_size, 0) |
| 2214 | self.assertIn("spam\\040", pathlib.Path(hfile.name).read_text()) |
| 2215 | |
| 2216 | env.pop("PYTHON_BASIC_REPL", None) |
| 2217 | output, exit_code = self.run_repl("exit\n", env=env) |
| 2218 | self.assertEqual(exit_code, 0) |
| 2219 | self.assertNotIn("\\040", pathlib.Path(hfile.name).read_text()) |
| 2220 | |
| 2221 | def test_history_survive_crash(self): |
| 2222 | env = os.environ.copy() |
nothing calls this directly
no test coverage detected