Skip to content

chore: scope log handlers to modules#2106

Merged
eakmanrq merged 1 commit intomainfrom
eakmanrq/test_scope_log_handler
Feb 8, 2024
Merged

chore: scope log handlers to modules#2106
eakmanrq merged 1 commit intomainfrom
eakmanrq/test_scope_log_handler

Conversation

@eakmanrq
Copy link
Collaborator

@eakmanrq eakmanrq commented Feb 8, 2024

Handlers are shared globally which was causing an issue where Airflow tests would add handlers and those handlers would then affect the results of other tests (like upcoming CLI tests: #2091)

I initially tried fixing Airflow directly by setting _AIRFLOW__AS_LIBRARY within a autouse fixture but that broke some tests and also required that imports for Airflow be within the scope of functions which was annoying. This solution though helps rescope logger to not share state across modules which seems more broadly useful. I decided to scope it to modules instead of functions because I want to make it easy for future tests to configure logging at the module level and not have this override it.

@eakmanrq eakmanrq merged commit d570445 into main Feb 8, 2024
@eakmanrq eakmanrq deleted the eakmanrq/test_scope_log_handler branch February 8, 2024 16:48
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.

2 participants