(pyfile, target, run, condition_kind, condition)
| 66 | @pytest.mark.parametrize("condition_kind, condition", list(conditions.keys())) |
| 67 | @pytest.mark.parametrize("target", targets.all_named) |
| 68 | def test_conditional_breakpoint(pyfile, target, run, condition_kind, condition): |
| 69 | hit = conditions[condition_kind, condition] |
| 70 | |
| 71 | @pyfile |
| 72 | def code_to_debug(): |
| 73 | import debuggee |
| 74 | |
| 75 | debuggee.setup() |
| 76 | for i in range(1, 10): |
| 77 | print(i) # @bp |
| 78 | |
| 79 | with debug.Session() as session: |
| 80 | with run(session, target(code_to_debug)): |
| 81 | session.request( |
| 82 | "setBreakpoints", |
| 83 | { |
| 84 | "source": {"path": code_to_debug}, |
| 85 | "breakpoints": [ |
| 86 | {"line": code_to_debug.lines["bp"], condition_kind: condition} |
| 87 | ], |
| 88 | }, |
| 89 | ) |
| 90 | |
| 91 | for i in range(1, 10): |
| 92 | if not hit(i): |
| 93 | continue |
| 94 | session.wait_for_stop( |
| 95 | expected_frames=[some.dap.frame(code_to_debug, line="bp")] |
| 96 | ) |
| 97 | var_i = session.get_variable("i") |
| 98 | assert var_i == some.dict.containing( |
| 99 | {"name": "i", "evaluateName": "i", "type": "int", "value": str(i)} |
| 100 | ) |
| 101 | session.request_continue() |
| 102 | |
| 103 | |
| 104 | def test_crossfile_breakpoint(pyfile, target, run): |
nothing calls this directly
no test coverage detected
searching dependent graphs…