diff --git a/tests/conftest.py b/tests/conftest.py index 4ba4b219..efc20927 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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)