Skip to content

Commit a54db08

Browse files
committed
Add code for improved SB() Manager debugging
1 parent f738981 commit a54db08

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14131,6 +14131,13 @@ def __activate_behave_post_mortem_debug_mode(self):
1413114131
pdb.post_mortem(sb_config.behave_step.exc_traceback)
1413214132
# Post Mortem Debug Mode ("behave -D pdb")
1413314133

14134+
def __activate_sb_mgr_post_mortem_debug_mode(self):
14135+
"""Activate Post Mortem Debug Mode for failing tests that use SB Mgr"""
14136+
import pdb
14137+
14138+
pdb.post_mortem()
14139+
# Post Mortem Debug Mode ("python --pdb")
14140+
1413414141
def __activate_debug_mode_in_teardown(self):
1413514142
"""Activate Debug Mode in tearDown() when using "--final-debug"."""
1413614143
import pdb
@@ -14555,6 +14562,11 @@ def tearDown(self):
1455514562
self.__activate_behave_post_mortem_debug_mode()
1455614563
if self._final_debug:
1455714564
self.__activate_debug_mode_in_teardown()
14565+
elif (
14566+
hasattr(sb_config, "_do_sb_post_mortem")
14567+
and sb_config._do_sb_post_mortem
14568+
):
14569+
self.__activate_sb_mgr_post_mortem_debug_mode()
1455814570
# (Nosetests / Behave / Pure Python) Close all open browser windows
1455914571
self.__quit_all_drivers()
1456014572
# Resume tearDown() for all test runners, (Pytest / Nosetests / Behave)

0 commit comments

Comments
 (0)