(case_setup_dap)
| 3435 | |
| 3436 | |
| 3437 | def 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 | |
| 3476 | def test_evaluate(case_setup_dap): |
nothing calls this directly
no test coverage detected