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

Function test_step_into_target_basic

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

Source from the content-addressed store, hash-verified

6433
6434
6435def test_step_into_target_basic(case_setup_dap):
6436 with case_setup_dap.test_file("_debugger_case_smart_step_into.py") as writer:
6437 json_facade = JsonFacade(writer)
6438
6439 bp = writer.get_line_index_with_content("break here")
6440 json_facade.write_set_breakpoints([bp])
6441 json_facade.write_make_initial_run()
6442
6443 # At this point we know that 'do_something' was called at least once.
6444 hit = json_facade.wait_for_thread_stopped(line=bp)
6445
6446 # : :type step_in_targets: List[StepInTarget]
6447 step_in_targets = json_facade.get_step_in_targets(hit.frame_id)
6448 label_to_id = dict((target["label"], target["id"]) for target in step_in_targets)
6449 if IS_PY311_OR_GREATER:
6450 assert set(label_to_id.keys()) == {"call_outer(foo(bar()))", "foo(bar())", "bar()"}
6451 target = "foo(bar())"
6452 else:
6453 assert set(label_to_id.keys()) == {"bar", "foo", "call_outer"}
6454 target = "foo"
6455 json_facade.write_step_in(hit.thread_id, target_id=label_to_id[target])
6456
6457 on_foo_mark_line = writer.get_line_index_with_content("on foo mark")
6458 hit = json_facade.wait_for_thread_stopped(reason="step", line=on_foo_mark_line)
6459 json_facade.write_continue()
6460
6461 writer.finished_ok = True
6462
6463
6464def test_step_into_target_multiple(case_setup_dap):

Callers

nothing calls this directly

Calls 10

write_set_breakpointsMethod · 0.95
get_step_in_targetsMethod · 0.95
write_step_inMethod · 0.95
write_continueMethod · 0.95
JsonFacadeClass · 0.85
test_fileMethod · 0.80
keysMethod · 0.80

Tested by

no test coverage detected