You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2025/04/15 10:12:50 UTC

(airflow) branch main updated: Make sure provider's manager is not left in a clean state (#49283)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 8dc0e55234d Make sure provider's manager is not left in a clean state (#49283)
8dc0e55234d is described below

commit 8dc0e55234db62369f7563d89e252cf190e0d1a8
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Tue Apr 15 12:12:44 2025 +0200

    Make sure provider's manager is not left in a clean state (#49283)
    
    The #49245 moved provider's initialization to session scope, but
    some of the tests were cleaning it up and did not restore it
    properly.
    
    This PR fixes it.
---
 airflow-core/tests/unit/core/test_configuration.py | 6 ++++++
 devel-common/src/tests_common/pytest_plugin.py     | 1 +
 2 files changed, 7 insertions(+)

diff --git a/airflow-core/tests/unit/core/test_configuration.py b/airflow-core/tests/unit/core/test_configuration.py
index 52408780a16..684f92a31a4 100644
--- a/airflow-core/tests/unit/core/test_configuration.py
+++ b/airflow-core/tests/unit/core/test_configuration.py
@@ -73,6 +73,12 @@ def restore_env():
         yield
 
 
+@pytest.fixture(scope="module", autouse=True)
+def restore_providers_manager_configuration():
+    yield
+    ProvidersManager().initialize_providers_configuration()
+
+
 def parameterized_config(template) -> str:
     """
     Generates configuration from provided template & variables defined in current scope.
diff --git a/devel-common/src/tests_common/pytest_plugin.py b/devel-common/src/tests_common/pytest_plugin.py
index 68a632e7286..6401dedc293 100644
--- a/devel-common/src/tests_common/pytest_plugin.py
+++ b/devel-common/src/tests_common/pytest_plugin.py
@@ -1643,6 +1643,7 @@ def cleanup_providers_manager():
         yield
     finally:
         ProvidersManager()._cleanup()
+        ProvidersManager().initialize_providers_configuration()
 
 
 @pytest.fixture(autouse=True)