log: test_json_format_produces_valid_json is fragile #108

Closed
opened 2026-07-05 14:47:10 +00:00 by the.auditor · 0 comments
Owner

tests/unit/test_log.py:85-97test_json_format_produces_valid_json manually clears root handlers and adds a custom StringIO handler to capture output. This is fragile — if run after other setup_logging tests, state leakage between tests could occur.

Consider using pytest's caplog fixture or isolating via child loggers instead of directly manipulating root logger handlers.

From PR #105 review suggestion.

`tests/unit/test_log.py:85-97` — `test_json_format_produces_valid_json` manually clears root handlers and adds a custom StringIO handler to capture output. This is fragile — if run after other `setup_logging` tests, state leakage between tests could occur. Consider using pytest's `caplog` fixture or isolating via child loggers instead of directly manipulating root logger handlers. _From PR #105 review suggestion._
fuzzy closed this issue 2026-07-05 17:47:19 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/kronai#108
No description provided.