diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py index 4d371a6e754b96..98dacc3acc812c 100644 --- a/Lib/test/test_pdb.py +++ b/Lib/test/test_pdb.py @@ -4291,6 +4291,14 @@ def test_quit(self): stdout, stderr = self._run_script(script, commands) self.assertIn("2", 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 anyway"), 2) @support.requires_subprocess()