CI ensure there are no duplicate log handlers - #991
Merged
Conversation
Collaborator
|
So that's it! I never considered duplicates when trying to debug this. |
Collaborator
|
We could also just not do anything if there's already a handler and this gets called. Though I think this is better? You could change the color, etc. |
Contributor
Author
|
i think we do need to re-add them for the tests to work, because of the formatting tests & also there was something weird with (caplog?) maybe closing handlers and this would still try to log to a closed stream |
henryiii
approved these changes
Jul 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
related: #989 (comment)
nox tests run setup_logging() multiple times in a session and we end up with multiple duplicate handlers, some of which are already closed, fail and try to log the error, creating a cascade of logs
The change is making sure we get rid of our own handler before creating a new one