From: Jeong YunWon <69878+youknowone@users.noreply.github.com> Date: Tue, 23 Aug 2022 08:58:38 +0000 (+0900) Subject: gh-96197: Add `del sys.breakpointhook` behavior test (gh-96198) X-Git-Tag: v3.12.0a1~586 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ba7d4b9dc18777e1d3ad2bfc9d935e45e47ebe00;p=thirdparty%2FPython%2Fcpython.git gh-96197: Add `del sys.breakpointhook` behavior test (gh-96198) --- diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index 6fa5ea67c8b3..8c9c1e506752 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -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):