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)
| 5 | |
| 6 | @pytest.fixture(autouse=True) |
| 7 | def _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 |
nothing calls this directly
no outgoing calls
no test coverage detected