Skip to content

Commit a45521f

Browse files
Add extra checks for pdb quit test
1 parent 2542256 commit a45521f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/test/test_pdb.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4291,6 +4291,14 @@ def test_quit(self):
42914291
stdout, stderr = self._run_script(script, commands)
42924292
self.assertIn("2", stdout)
42934293
self.assertIn("Quit anyway", stdout)
4294+
# Closing stdin will quit the debugger anyway so we need to confirm
4295+
# it's the quit command that does the job
4296+
# call/return event will print --Call-- and --Return--
4297+
self.assertNotIn("--", stdout)
4298+
# Normal exit should not print anything to stderr
4299+
self.assertEqual(stderr, "")
4300+
# The quit prompt should be printed exactly twice
4301+
self.assertEqual(stdout.count("Quit anyway"), 2)
42944302

42954303

42964304
@support.requires_subprocess()

0 commit comments

Comments
 (0)