]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-124703: Add extra checks for pdb quit test (#130286)
authorTian Gao <gaogaotiantian@hotmail.com>
Tue, 18 Feb 2025 21:55:39 +0000 (16:55 -0500)
committerGitHub <noreply@github.com>
Tue, 18 Feb 2025 21:55:39 +0000 (16:55 -0500)
Lib/test/test_pdb.py

index 7e8bd73625bb4abbe4f0ab4f1258bab4ad9b0491..fa439c1fe8915c8c2e2aa3c6a93b65b87598ddb7 100644 (file)
@@ -4299,6 +4299,14 @@ class PdbTestInline(unittest.TestCase):
         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()