(case_setup_dap)
| 6800 | |
| 6801 | @pytest.mark.skipif(not _TOP_LEVEL_AWAIT_AVAILABLE, reason="Top-level await required.") |
| 6802 | def 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.") |
nothing calls this directly
no test coverage detected