https://github.com/python/cpython/commit/8207454bc00db8efa0e05c93381ecc8e3efc86a7
commit: 8207454bc00db8efa0e05c93381ecc8e3efc86a7
branch: main
author: Tian Gao <[email protected]>
committer: gaogaotiantian <[email protected]>
date: 2025-02-18T16:55:39-05:00
summary:

gh-124703: Add extra checks for pdb quit test (#130286)

files:
M Lib/test/test_pdb.py

diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index 7e8bd73625bb4a..fa439c1fe8915c 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -4299,6 +4299,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()

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to