feat(gui): log fichier rotatif V6 à chemin connu (E1)

This commit is contained in:
2026-06-25 17:56:50 +02:00
parent 9e87cb3122
commit 9296c28bed
2 changed files with 83 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import logging
def test_setup_file_logging_writes_to_known_path(tmp_path, monkeypatch):
monkeypatch.setenv("LOCALAPPDATA", str(tmp_path))
from gui_v6.logging_setup import setup_file_logging, _reset_for_tests
try:
log_path = setup_file_logging()
assert log_path.parent.exists()
logging.getLogger("test.e1").warning("ligne-temoin-42")
for h in logging.getLogger().handlers:
h.flush()
assert "ligne-temoin-42" in log_path.read_text(encoding="utf-8")
finally:
_reset_for_tests()