MCPcopy Create free account
hub / github.com/microsoft/debugpy / check_logs

Function check_logs

tests/debugpy/test_log.py:13–31  ·  view source on GitHub ↗
(tmpdir, run)

Source from the content-addressed store, hash-verified

11
12@contextlib.contextmanager
13def 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)

Callers 2

test_log_dirFunction · 0.85
test_log_dir_envFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…