Skip to content

Fix caplog not capturing INFO logs in train model cleanup tests - #1143

Open
mborodii-prog wants to merge 2 commits into
mainfrom
fix/train-test-model-cleanup-caplog-level
Open

Fix caplog not capturing INFO logs in train model cleanup tests#1143
mborodii-prog wants to merge 2 commits into
mainfrom
fix/train-test-model-cleanup-caplog-level

Conversation

@mborodii-prog

Copy link
Copy Markdown
Contributor

test_classify_write_logs_new_model_id_integration, test_lookup_write_logs_new_model_id, and test_standardize_write_logs_new_model_id create real models via name: and rely on caplog to find the "New model created" log line to delete them in a finally block. pytest's caplog fixture only captures WARNING+ by default, so the INFO record was never created and the cleanup silently no-op'd, leaking a new model on every run.

test_classify_write_logs_new_model_id_integration, test_lookup_write_logs_new_model_id,
and test_standardize_write_logs_new_model_id create real models via name: and rely on
caplog to find the "New <type> model created" log line to delete them in a finally
block. pytest's caplog fixture only captures WARNING+ by default, so the INFO record
was never created and the cleanup silently no-op'd, leaking a new model on every run.
@mborodii-prog
mborodii-prog requested a review from ebhills August 25, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant