Files
kanta/tests/test_logging.py
T
Leo Vasanko 652d60b74b Add separate migration logging, logmigr callback, and log= override
- Split transaction logger (kanta.changes) and migration logger (kanta.migrations).
- Migrations.apply() now returns MigrationResult instead of logging.
- Kanta.open() emits one info summary per DB and debug transaction per migration.
- Add open(log=...) to suppress/redirect default migration logging.
- Add @kanta.logmigr callback for custom migration logging/summaries.
- Add transaction(log=...) to suppress/redirect transaction logging.
- Update tests for the new MigrationResult API and logging behaviour.
2026-06-15 23:14:18 +00:00

17 lines
387 B
Python

import logging
from kanta.logging import changes_logger, configure_logging, log_change
def test_configure_logging():
configure_logging()
assert changes_logger.level == logging.INFO
def test_log_change_no_diff(capsys):
changes_logger.handlers.clear()
configure_logging()
log_change("test", {})
captured = capsys.readouterr()
assert "test" in captured.err