From 0e83e4f292a44ee86e6974dc30c652fa0bba5172 Mon Sep 17 00:00:00 2001 From: Anthony Shaw Date: Fri, 23 Mar 2018 14:26:16 +1100 Subject: [PATCH] conditional for resetting of sys.breakpointhook for cleanup where breakpoint() not supported --- _pytest/debugging.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/_pytest/debugging.py b/_pytest/debugging.py index f73a9a6b9..68663490d 100644 --- a/_pytest/debugging.py +++ b/_pytest/debugging.py @@ -46,7 +46,8 @@ def pytest_configure(config): pdb.set_trace, pytestPDB._pluginmanager = old pytestPDB._config = None pytestPDB._pdb_cls = pdb.Pdb - sys.breakpointhook = sys.__breakpointhook__ + if SUPPORTS_BREAKPOINT_BUILTIN: + sys.breakpointhook = sys.__breakpointhook__ pdb.set_trace = pytestPDB.set_trace pytestPDB._pluginmanager = config.pluginmanager