(case_setup_dap)
| 6835 | |
| 6836 | @pytest.mark.skipif(not _TOP_LEVEL_AWAIT_AVAILABLE, reason="Top-level await required.") |
| 6837 | def test_ipython_stepping_step_in(case_setup_dap): |
| 6838 | |
| 6839 | def get_environ(self): |
| 6840 | env = os.environ.copy() |
| 6841 | |
| 6842 | # Test setup |
| 6843 | env["SCOPED_STEPPING_TARGET"] = "_debugger_case_scoped_stepping_target2.py" |
| 6844 | |
| 6845 | # Actually setup the debugging |
| 6846 | env["PYDEVD_IPYTHON_COMPATIBLE_DEBUGGING"] = "1" |
| 6847 | env["PYDEVD_IPYTHON_CONTEXT"] = "_debugger_case_scoped_stepping.py, run_code, run_ast_nodes" |
| 6848 | return env |
| 6849 | |
| 6850 | with case_setup_dap.test_file("_debugger_case_scoped_stepping.py", get_environ=get_environ) as writer: |
| 6851 | json_facade = JsonFacade(writer) |
| 6852 | json_facade.write_launch(justMyCode=False) |
| 6853 | |
| 6854 | target_file = debugger_unittest._get_debugger_test_file("_debugger_case_scoped_stepping_target2.py") |
| 6855 | break_line = writer.get_line_index_with_content("break here", filename=target_file) |
| 6856 | json_facade.write_set_breakpoints(break_line, filename=target_file) |
| 6857 | json_facade.write_make_initial_run() |
| 6858 | json_hit = json_facade.wait_for_thread_stopped(line=break_line, file="_debugger_case_scoped_stepping_target2.py") |
| 6859 | |
| 6860 | json_facade.write_step_in(json_hit.thread_id) |
| 6861 | stop_at = writer.get_line_index_with_content("b = 2", filename=target_file) |
| 6862 | json_hit = json_facade.wait_for_thread_stopped("step", line=stop_at, file="_debugger_case_scoped_stepping_target2.py") |
| 6863 | |
| 6864 | json_facade.write_step_in(json_hit.thread_id) |
| 6865 | stop_at = writer.get_line_index_with_content("method() # break here", filename=target_file) |
| 6866 | json_hit = json_facade.wait_for_thread_stopped("step", line=stop_at, file="_debugger_case_scoped_stepping_target2.py") |
| 6867 | |
| 6868 | json_facade.write_step_in(json_hit.thread_id) |
| 6869 | stop_at = writer.get_line_index_with_content("c = 3", filename=target_file) |
| 6870 | json_hit = json_facade.wait_for_thread_stopped("step", line=stop_at, file="_debugger_case_scoped_stepping_target2.py") |
| 6871 | |
| 6872 | json_facade.write_continue() |
| 6873 | writer.finished_ok = True |
| 6874 | |
| 6875 | |
| 6876 | @pytest.mark.skipif(not _TOP_LEVEL_AWAIT_AVAILABLE, reason="Top-level await required.") |
nothing calls this directly
no test coverage detected