From e97d6c8ffd464dcfee918448fcbda84a3be341fc Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Tue, 23 Aug 2022 15:35:44 +0900 Subject: [PATCH] gh-96197: Add `del sys.breakpointhook` behavior test --- Lib/test/test_builtin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 6fa5ea67c8b399..8c9c1e506752ea 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -2072,6 +2072,11 @@ def test_envar_ignored_when_hook_is_set(self): 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):