(script)
| 19 | # helpers |
| 20 | |
| 21 | def _captured_script(script): |
| 22 | r, w = os.pipe() |
| 23 | indented = script.replace('\n', '\n ') |
| 24 | wrapped = dedent(f""" |
| 25 | import contextlib |
| 26 | with open({w}, 'w', encoding="utf-8") as spipe: |
| 27 | with contextlib.redirect_stdout(spipe): |
| 28 | {indented} |
| 29 | """) |
| 30 | return wrapped, open(r, encoding="utf-8") |
| 31 | |
| 32 | |
| 33 | def _run_output(interp, request): |
no test coverage detected
searching dependent graphs…