Skip to content

Commit 4dc8ca7

Browse files
committed
Add "--ftrace" to "SB()" command-line options
1 parent 3c1efe3 commit 4dc8ca7

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15304,11 +15304,11 @@ def __activate_sb_mgr_post_mortem_debug_mode(self):
1530415304
# Post Mortem Debug Mode ("python --pdb")
1530515305

1530615306
def __activate_debug_mode_in_teardown(self):
15307-
"""Activate Debug Mode in tearDown() when using "--final-debug"."""
15307+
"""Activate Final Trace / Debug Mode"""
1530815308
import pdb
1530915309

1531015310
pdb.set_trace()
15311-
# Final Debug Mode ("--final-debug")
15311+
# Final Trace ("--ftrace")
1531215312

1531315313
def has_exception(self):
1531415314
"""(This method should ONLY be used in custom tearDown() methods.)
@@ -15803,6 +15803,11 @@ def tearDown(self):
1580315803
and sb_config._do_sb_post_mortem
1580415804
):
1580515805
self.__activate_sb_mgr_post_mortem_debug_mode()
15806+
elif (
15807+
hasattr(sb_config, "_do_sb_final_trace")
15808+
and sb_config._do_sb_final_trace
15809+
):
15810+
self.__activate_debug_mode_in_teardown()
1580615811
# (Pynose / Behave / Pure Python) Close all open browser windows
1580715812
self.__quit_all_drivers()
1580815813
# Resume tearDown() for all test runners, (Pytest / Pynose / Behave)

seleniumbase/plugins/sb_manager.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,13 @@ def SB(
873873
finally:
874874
if sb._has_failure and "--pdb" in sys_argv:
875875
sb_config._do_sb_post_mortem = True
876+
elif (
877+
"--final-debug" in sys_argv
878+
or "--final-trace" in sys_argv
879+
or "--fdebug" in sys_argv
880+
or "--ftrace" in sys_argv
881+
):
882+
sb_config._do_sb_final_trace = True
876883
try:
877884
sb.tearDown()
878885
except Exception as t_e:

0 commit comments

Comments
 (0)