(tmpdir, run)
| 11 | |
| 12 | @contextlib.contextmanager |
| 13 | def check_logs(tmpdir, run): |
| 14 | # For attach_pid, there's ptvsd.server process that performs the injection, |
| 15 | # and then there's the debug server that is injected into the debuggee. |
| 16 | server_count = 2 if type(run).__name__ == "attach_pid" else 1 |
| 17 | |
| 18 | expected_logs = { |
| 19 | "debugpy.adapter-*.log": 1, |
| 20 | "debugpy.launcher-*.log": 1 if run.request == "launch" else 0, |
| 21 | "debugpy.pydevd.*.log": server_count, |
| 22 | "debugpy.server-*.log": server_count, |
| 23 | } |
| 24 | |
| 25 | actual_logs = lambda: { |
| 26 | filename: len(tmpdir.listdir(filename)) for filename in expected_logs |
| 27 | } |
| 28 | |
| 29 | assert actual_logs() == {filename: 0 for filename in expected_logs} |
| 30 | yield |
| 31 | assert actual_logs() == expected_logs |
| 32 | |
| 33 | |
| 34 | @pytest.mark.parametrize("run", runners.all_attach_socket) |
no outgoing calls
no test coverage detected
searching dependent graphs…