Skip to content

Commit

Permalink
chore: Flush logger hanlders at exit
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Nov 26, 2024
1 parent 3fc2911 commit 54844f3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
"""Test Configuration."""


def pytest_sessionfinish(session, exitstatus):
"""Session Finish."""
import logging

loggers: list[logging.Logger] = [
logging.getLogger(),
*list(logging.Logger.manager.loggerDict.values()),
]

for logger in loggers:
handlers = getattr(logger, "handlers", [])
for handler in handlers:
logger.removeHandler(handler)

0 comments on commit 54844f3

Please sign in to comment.