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

Function test_ipython_stepping_basic

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

Source from the content-addressed store, hash-verified

6800
6801@pytest.mark.skipif(not _TOP_LEVEL_AWAIT_AVAILABLE, reason="Top-level await required.")
6802def test_ipython_stepping_basic(case_setup_dap):
6803
6804 def get_environ(self):
6805 env = os.environ.copy()
6806
6807 # Test setup
6808 env["SCOPED_STEPPING_TARGET"] = "_debugger_case_scoped_stepping_target.py"
6809
6810 # Actually setup the debugging
6811 env["PYDEVD_IPYTHON_COMPATIBLE_DEBUGGING"] = "1"
6812 env["PYDEVD_IPYTHON_CONTEXT"] = "_debugger_case_scoped_stepping.py, run_code, run_ast_nodes"
6813 return env
6814
6815 with case_setup_dap.test_file("_debugger_case_scoped_stepping.py", get_environ=get_environ) as writer:
6816 json_facade = JsonFacade(writer)
6817 json_facade.write_launch(justMyCode=False)
6818
6819 target_file = debugger_unittest._get_debugger_test_file("_debugger_case_scoped_stepping_target.py")
6820 break_line = writer.get_line_index_with_content("a = 1", filename=target_file)
6821 assert break_line == 1
6822 json_facade.write_set_breakpoints(break_line, filename=target_file)
6823 json_facade.write_make_initial_run()
6824 json_hit = json_facade.wait_for_thread_stopped(line=break_line, file="_debugger_case_scoped_stepping_target.py")
6825
6826 json_facade.write_step_next(json_hit.thread_id)
6827 json_hit = json_facade.wait_for_thread_stopped("step", line=break_line + 1, file="_debugger_case_scoped_stepping_target.py")
6828
6829 json_facade.write_step_next(json_hit.thread_id)
6830 json_hit = json_facade.wait_for_thread_stopped("step", line=break_line + 2, file="_debugger_case_scoped_stepping_target.py")
6831
6832 json_facade.write_continue()
6833 writer.finished_ok = True
6834
6835
6836@pytest.mark.skipif(not _TOP_LEVEL_AWAIT_AVAILABLE, reason="Top-level await required.")

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected