vincbeck commented on code in PR #43175:
URL: https://github.com/apache/airflow/pull/43175#discussion_r1806972195


##########
tests/conftest.py:
##########
@@ -58,6 +61,26 @@ def reset_environment():
             os.environ[key] = init_env[key]
 
 
+def remove_non_pytest_log_handlers(logger, *classes):
+    for handler in non_pytest_handlers(logger.handlers):
+        logger.removeHandler(handler)
+
+
+def remove_all_non_pytest_log_handlers():
+    # Remove handlers from the root logger
+    remove_non_pytest_log_handlers(logging.getLogger())
+    # Remove handlers from all other loggers
+    for logger_name in logging.root.manager.loggerDict:
+        remove_non_pytest_log_handlers(logging.getLogger(logger_name))
+
+
[email protected]
+def clear_all_logger_handlers():

Review Comment:
   But other than that, LGTM :) And good job finding this annoying weird error!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to