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

Function test_case_update_rules

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

Source from the content-addressed store, hash-verified

1636
1637
1638def test_case_update_rules(case_setup_dap):
1639 with case_setup_dap.test_file("my_code/my_code.py") as writer:
1640 json_facade = JsonFacade(writer)
1641 json_facade.write_launch(
1642 rules=[
1643 {"path": "**/other.py", "include": False},
1644 ]
1645 )
1646
1647 break_line = writer.get_line_index_with_content("break here")
1648 json_facade.write_set_breakpoints(break_line)
1649 json_facade.write_make_initial_run()
1650
1651 json_facade.wait_for_json_message(ThreadEvent, lambda event: event.body.reason == "started")
1652
1653 json_hit = json_facade.wait_for_thread_stopped(line=break_line)
1654 json_facade.reset_sent_launch_or_attach()
1655 json_facade.write_launch(
1656 rules=[
1657 {"path": "**/other.py", "include": True},
1658 ]
1659 )
1660 json_facade.write_step_in(json_hit.thread_id)
1661 # Not how we stoppen in the file that wasn't initially included.
1662 json_hit = json_facade.wait_for_thread_stopped("step", name="call_me_back1")
1663
1664 json_facade.reset_sent_launch_or_attach()
1665 json_facade.write_launch(
1666 rules=[
1667 {"path": "**/other.py", "include": False},
1668 ]
1669 )
1670 json_facade.write_step_in(json_hit.thread_id)
1671 # Not how we go back to the callback and not to the `call_me_back1` because
1672 # `call_me_back1` is now excluded again.
1673 json_hit = json_facade.wait_for_thread_stopped("step", name="callback1")
1674
1675 json_facade.write_continue()
1676 writer.finished_ok = True
1677
1678
1679@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 11

write_launchMethod · 0.95
write_set_breakpointsMethod · 0.95
wait_for_json_messageMethod · 0.95
write_step_inMethod · 0.95
write_continueMethod · 0.95
JsonFacadeClass · 0.85
test_fileMethod · 0.80

Tested by

no test coverage detected