MCPcopy Create free account
hub / github.com/idank/explainshell / _no_manager_log_files

Function _no_manager_log_files

tests/conftest.py:7–20  ·  view source on GitHub ↗

Prevent CLI tests from writing log files into the real logs/ directory or leaking the manager's logger-level configuration into other tests. The run_dir is redirected to a pytest tmp_path so report/manifest writes still work but nothing accumulates in the repo. Console-logging setup

(tmp_path)

Source from the content-addressed store, hash-verified

5
6@pytest.fixture(autouse=True)
7def _no_manager_log_files(tmp_path):
8 """Prevent CLI tests from writing log files into the real logs/ directory
9 or leaking the manager's logger-level configuration into other tests.
10
11 The run_dir is redirected to a pytest tmp_path so report/manifest
12 writes still work but nothing accumulates in the repo. Console-logging
13 setup is suppressed so it doesn't lock the explainshell logger level
14 and break tests that rely on caplog at DEBUG.
15 """
16 with (
17 patch("explainshell.manager._attach_run_log", return_value=str(tmp_path)),
18 patch("explainshell.manager._setup_console_logging"),
19 ):
20 yield

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected