summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeong YunWon <69878+youknowone@users.noreply.github.com>2022-08-23 08:58:38 (GMT)
committerGitHub <noreply@github.com>2022-08-23 08:58:38 (GMT)
commitba7d4b9dc18777e1d3ad2bfc9d935e45e47ebe00 (patch)
tree41c2f55fa36abae942c5f6c25a6865b7edd9b5df
parentd6259c58cbb48b8f3fbd70047f004ea19fe91e86 (diff)
downloadcpython-ba7d4b9dc18777e1d3ad2bfc9d935e45e47ebe00.zip
cpython-ba7d4b9dc18777e1d3ad2bfc9d935e45e47ebe00.tar.gz
cpython-ba7d4b9dc18777e1d3ad2bfc9d935e45e47ebe00.tar.bz2
gh-96197: Add `del sys.breakpointhook` behavior test (gh-96198)
-rw-r--r--Lib/test/test_builtin.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py
index 6fa5ea6..8c9c1e5 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):