]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-96197: Add `del sys.breakpointhook` behavior test (gh-96198)
authorJeong YunWon <69878+youknowone@users.noreply.github.com>
Tue, 23 Aug 2022 08:58:38 +0000 (17:58 +0900)
committerGitHub <noreply@github.com>
Tue, 23 Aug 2022 08:58:38 +0000 (17:58 +0900)
Lib/test/test_builtin.py

index 6fa5ea67c8b3995c39a8b88085d2a7e80ddd3ef9..8c9c1e506752eac5cdf1ccf5511315ac1ba52659 100644 (file)
@@ -2072,6 +2072,11 @@ class TestBreakpoint(unittest.TestCase):
             breakpoint()
             mock.assert_not_called()
 
+    def test_runtime_error_when_hook_is_lost(self):
+        del sys.breakpointhook
+        with self.assertRaises(RuntimeError):
+            breakpoint()
+
 
 @unittest.skipUnless(pty, "the pty and signal modules must be available")
 class PtyTests(unittest.TestCase):