MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / test_stepping

Function test_stepping

tests_python/test_debugger_json.py:3437–3473  ·  view source on GitHub ↗
(case_setup_dap)

Source from the content-addressed store, hash-verified

3435
3436
3437def test_stepping(case_setup_dap):
3438 with case_setup_dap.test_file("_debugger_case_stepping.py") as writer:
3439 json_facade = JsonFacade(writer)
3440
3441 json_facade.write_launch(justMyCode=False)
3442 json_facade.write_set_breakpoints(
3443 [writer.get_line_index_with_content("Break here 1"), writer.get_line_index_with_content("Break here 2")]
3444 )
3445 json_facade.write_make_initial_run()
3446
3447 json_hit = json_facade.wait_for_thread_stopped()
3448
3449 # Test Step-Over or 'next'
3450 stack_trace_response = json_hit.stack_trace_response
3451 for stack_frame in stack_trace_response.body.stackFrames:
3452 assert stack_frame["source"]["sourceReference"] == 0
3453
3454 stack_frame = next(iter(stack_trace_response.body.stackFrames))
3455 before_step_over_line = stack_frame["line"]
3456
3457 json_facade.write_step_next(json_hit.thread_id)
3458 json_hit = json_facade.wait_for_thread_stopped("step", line=before_step_over_line + 1)
3459
3460 # Test step into or 'stepIn'
3461 json_facade.write_step_in(json_hit.thread_id)
3462 json_hit = json_facade.wait_for_thread_stopped("step", name="step_into")
3463
3464 # Test step return or 'stepOut'
3465 json_facade.write_continue()
3466 json_hit = json_facade.wait_for_thread_stopped(name="step_out")
3467
3468 json_facade.write_step_out(json_hit.thread_id)
3469 json_hit = json_facade.wait_for_thread_stopped("step", name="Call")
3470
3471 json_facade.write_continue()
3472
3473 writer.finished_ok = True
3474
3475
3476def test_evaluate(case_setup_dap):

Callers

nothing calls this directly

Calls 11

write_launchMethod · 0.95
write_set_breakpointsMethod · 0.95
write_step_nextMethod · 0.95
write_step_inMethod · 0.95
write_continueMethod · 0.95
write_step_outMethod · 0.95
JsonFacadeClass · 0.85
test_fileMethod · 0.80

Tested by

no test coverage detected