MCPcopy Index your code
hub / github.com/python/cpython / test_prompt_after_help

Method test_prompt_after_help

Lib/test/test_pyrepl/test_pyrepl.py:2254–2265  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2252 self.assertEqual(exit_code, 0)
2253
2254 def test_prompt_after_help(self):
2255 output, exit_code = self.run_repl(["help", "q", "exit"])
2256
2257 # Regex pattern to remove ANSI escape sequences
2258 ansi_escape = re.compile(r"(\x1B(=|>|(\[)[0-?]*[ -\/]*[@-~]))")
2259 cleaned_output = ansi_escape.sub("", output)
2260 self.assertEqual(exit_code, 0)
2261
2262 # Ensure that we don't see multiple prompts after exiting `help`
2263 # Extra stuff (newline and `exit` rewrites) are necessary
2264 # because of how run_repl works.
2265 self.assertNotIn(">>> \n>>> >>>", cleaned_output)
2266
2267 @skipUnless(Py_DEBUG, '-X showrefcount requires a Python debug build')
2268 def test_showrefcount(self):

Callers

nothing calls this directly

Calls 5

assertNotInMethod · 0.80
run_replMethod · 0.45
compileMethod · 0.45
subMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected