8000 gh-124703: Change back to raising bdb.BdbQuit when exiting pdb in 'inline' mode in a REPL session by ADThomas-astro · Pull Request #130395 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-124703: Change back to raising bdb.BdbQuit when exiting pdb in 'inline' mode in a REPL session #130395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Feb 25, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove variable for 'Quit anyway'
  • Loading branch information
ADThomas-astro committed Feb 25, 2025
commit f516a3058dfb8d04eb0a0ef4b1eb62450982f14f
8 changes: 3 additions & 5 deletions Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4279,8 +4279,6 @@ def test_checkline_is_not_executable(self):
self.assertFalse(db.checkline(os_helper.TESTFN, lineno))


QUIT_PROMPT_QUESTION = "Quit anyway"

@support.requires_subprocess()
class PdbTestInline(unittest.TestCase):
@unittest.skipIf(sys.flags.safe_path,
Expand Down Expand Up @@ -4334,15 +4332,15 @@ def test_quit(self):

stdout, stderr = self._run_script(script, commands)
self.assertIn("2", stdout)
self.assertIn(QUIT_PROMPT_QUESTION, stdout)
self.assertIn("Quit anyway", stdout)
# Closing stdin will quit the debugger anyway so we need to confirm
# it's the quit command that does the job
# call/return event will print --Call-- and --Return--
self.assertNotIn("--", stdout)
# Normal exit should not print anything to stderr
self.assertEqual(stderr, "")
# The quit prompt should be printed exactly twice
self.assertEqual(stdout.count(QUIT_PROMPT_QUESTION), 2)
self.assertEqual(stdout.count("Quit anyway"), 2)


@support.force_not_colorized_test_class
Expand All @@ -4362,7 +4360,7 @@ def test_return_from_inline_mode_to_REPL(self):
p.stdin.write(textwrap.dedent(user_input))
output = kill_python(p)
self.assertIn('SpamDuring', output)
self.assertNotIn(QUIT_PROMPT_QUESTION, output)
self.assertNotIn("Quit anyway", output)
self.assertIn('BdbQuit', output)
self.assertIn('SpamAfter', output)
self.assertEqual(p.returncode, 0)
Expand Down
Loading
0