From 6353598c92a850334de46c048c8ac8a79e5bbf39 Mon Sep 17 00:00:00 2001 From: Fabio Zadrozny Date: Sat, 16 Dec 2023 17:13:30 -0300 Subject: [PATCH] wip3 --- tests_python/test_frame_eval_and_tracing.py | 41 +++++++++++++++++---- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/tests_python/test_frame_eval_and_tracing.py b/tests_python/test_frame_eval_and_tracing.py index ee911440..06ec1bc8 100644 --- a/tests_python/test_frame_eval_and_tracing.py +++ b/tests_python/test_frame_eval_and_tracing.py @@ -6,6 +6,7 @@ from contextlib import contextmanager from tests_python.debugger_unittest import IS_PY36_OR_GREATER, IS_CPYTHON from tests_python.debug_constants import TEST_CYTHON, TODO_PY311 +from _pydevd_bundle.pydevd_constants import IS_PY312_OR_GREATER pytest_plugins = [ str('tests_python.debugger_fixtures'), @@ -58,7 +59,10 @@ def test_step_and_resume(case_setup_force_frame_eval): assert hit.line == 2 # we enable frame evaluation debugger after "Resume" command - assert hit.suspend_type == "frame_eval" + if IS_PY312_OR_GREATER: + assert hit.suspend_type == "sys_monitor" + else: + assert hit.suspend_type == "frame_eval" writer.write_run_thread(hit.thread_id) @@ -72,7 +76,10 @@ def test_step_return(case_setup_force_frame_eval): hit = writer.wait_for_breakpoint_hit() - assert hit.suspend_type == "frame_eval" + if IS_PY312_OR_GREATER: + assert hit.suspend_type == "sys_monitor" + else: + assert hit.suspend_type == "frame_eval" writer.write_get_frame(hit.thread_id, hit.frame_id) writer.write_step_return(hit.thread_id) @@ -154,7 +161,10 @@ def test_add_exc_break_while_running(case_setup_force_frame_eval): assert hit.line == 10 # we use tracing debugger if there are exception breakpoints - assert hit.suspend_type == "frame_eval" + if IS_PY312_OR_GREATER: + assert hit.suspend_type == "sys_monitor" + else: + assert hit.suspend_type == "frame_eval" writer.write_add_exception_breakpoint_with_policy('IndexError', "1", "0", "0") @@ -164,7 +174,10 @@ def test_add_exc_break_while_running(case_setup_force_frame_eval): assert hit.line == 2 # we use tracing debugger if exception break was added - assert hit.suspend_type == "trace" + if IS_PY312_OR_GREATER: + assert hit.suspend_type == "sys_monitor" + else: + assert hit.suspend_type == "trace" writer.write_run_thread(hit.thread_id) @@ -180,7 +193,10 @@ def test_add_termination_exc_break(case_setup_force_frame_eval): hit = writer.wait_for_breakpoint_hit(line=10) # we can use frame evaluation with exception breakpoint with "On termination" suspend policy - assert hit.suspend_type == "frame_eval" + if IS_PY312_OR_GREATER: + assert hit.suspend_type == "sys_monitor" + else: + assert hit.suspend_type == "frame_eval" writer.write_run_thread(hit.thread_id) @@ -197,7 +213,10 @@ def test_frame_eval_whitebox_test(case_setup_force_frame_eval): writer.write_make_initial_run() hit = writer.wait_for_breakpoint_hit(line=line_on_global) - assert hit.suspend_type == "frame_eval" + if IS_PY312_OR_GREATER: + assert hit.suspend_type == "sys_monitor" + else: + assert hit.suspend_type == "frame_eval" writer.write_step_over(hit.thread_id) hit = writer.wait_for_breakpoint_hit(reason=CMD_STEP_OVER) @@ -225,7 +244,10 @@ def test_frame_eval_change_breakpoints(case_setup_force_frame_eval): writer.write_make_initial_run() hit = writer.wait_for_breakpoint_hit(line=break2_line) - assert hit.suspend_type == "frame_eval" + if IS_PY312_OR_GREATER: + assert hit.suspend_type == "sys_monitor" + else: + assert hit.suspend_type == "frame_eval" writer.write_remove_breakpoint(break2_id) writer.write_add_breakpoint(break1_line, 'None') @@ -271,7 +293,10 @@ def test_break_line_1(case_setup_force_frame_eval): writer.write_make_initial_run() hit = writer.wait_for_breakpoint_hit(line=break1_line) - assert hit.suspend_type == "frame_eval" + if IS_PY312_OR_GREATER: + assert hit.suspend_type == "sys_monitor" + else: + assert hit.suspend_type == "frame_eval" writer.write_run_thread(hit.thread_id)