(pyfile, target, run)
| 379 | |
| 380 | |
| 381 | def test_deep_stacks(pyfile, target, run): |
| 382 | @pyfile |
| 383 | def code_to_debug(): |
| 384 | import debuggee |
| 385 | |
| 386 | debuggee.setup() |
| 387 | |
| 388 | def deep_stack(level): |
| 389 | if level <= 0: |
| 390 | print("done") # @bp |
| 391 | return level |
| 392 | deep_stack(level - 1) |
| 393 | |
| 394 | deep_stack(100) |
| 395 | |
| 396 | with debug.Session() as session: |
| 397 | with run(session, target(code_to_debug)): |
| 398 | session.set_breakpoints(code_to_debug, all) |
| 399 | |
| 400 | stop = session.wait_for_stop() |
| 401 | assert len(stop.frames) > 100 |
| 402 | |
| 403 | # Now try to retrieve the same stack in chunks, and check that it matches. |
| 404 | frames = [] |
| 405 | for _ in range(5): |
| 406 | stack_trace = session.request( |
| 407 | "stackTrace", |
| 408 | {"threadId": stop.thread_id, "startFrame": len(frames), "levels": 25}, |
| 409 | ) |
| 410 | |
| 411 | assert stack_trace["totalFrames"] > 0 |
| 412 | frames += stack_trace["stackFrames"] |
| 413 | |
| 414 | assert stop.frames == frames |
| 415 | session.request_continue() |
| 416 | |
| 417 | |
| 418 | @pytest.mark.parametrize("target", targets.all) |
nothing calls this directly
no test coverage detected
searching dependent graphs…