(pyfile, target, run)
| 17 | |
| 18 | @pytest.mark.parametrize("run", runners.all) |
| 19 | def test_with_no_output(pyfile, target, run): |
| 20 | @pyfile |
| 21 | def code_to_debug(): |
| 22 | import debuggee |
| 23 | |
| 24 | debuggee.setup() |
| 25 | x = 4 # @wait_for_output |
| 26 | |
| 27 | with debug.Session() as session: |
| 28 | session.config["redirectOutput"] = True |
| 29 | |
| 30 | with run(session, target(code_to_debug)): |
| 31 | session.set_breakpoints(code_to_debug, all) |
| 32 | |
| 33 | session.wait_for_stop("breakpoint") |
| 34 | session.request_continue() |
| 35 | |
| 36 | output = session.output("stdout") |
| 37 | lines = [] |
| 38 | for line in output.splitlines(keepends=True): |
| 39 | if not line.startswith("Attaching to PID:"): |
| 40 | lines.append(line) |
| 41 | |
| 42 | output = "".join(lines) |
| 43 | |
| 44 | assert not output |
| 45 | assert not session.output("stderr") |
| 46 | if session.debuggee is not None: |
| 47 | assert not session.captured_stdout() |
| 48 | assert not session.captured_stderr() |
| 49 | |
| 50 | |
| 51 | def test_with_tab_in_output(pyfile, target, run): |
nothing calls this directly
no test coverage detected
searching dependent graphs…