uranusjr commented on code in PR #52233:
URL: https://github.com/apache/airflow/pull/52233#discussion_r2217264120
##########
devel-common/src/tests_common/pytest_plugin.py:
##########
@@ -210,6 +210,17 @@ def _calculate_provider_deps_hash():
os.environ["AIRFLOW__CORE__ALLOWED_DESERIALIZATION_CLASSES"] =
"airflow.*\nunit.*\n"
os.environ["AIRFLOW__CORE__PLUGINS_FOLDER"] =
os.fspath(AIRFLOW_CORE_TESTS_PATH / "unit" / "plugins")
+
+if os.environ.get("_AIRFLOW_SKIP_DB_TESTS", "false") == "true" and
importlib.util.find_spec("airflow"):
+
+ @pytest.fixture(scope="session", autouse=True)
+ def mock_plugins_manager_for_all_non_db_tests():
+ from tests_common.test_utils.mock_plugins import mock_plugin_manager
+
+ with mock_plugin_manager() as _fixture:
+ yield _fixture
Review Comment:
```suggestion
MOCK_PLUGINS_MANAGER = os.environ.get("_AIRFLOW_SKIP_DB_TESTS", "false") ==
"true" and importlib.util.find_spec("airflow")
@pytest.fixture(scope="session", autouse=MOCK_PLUGINS_MANAGER)
def mock_plugins_manager_for_all_non_db_tests():
from tests_common.test_utils.mock_plugins import mock_plugin_manager
with mock_plugin_manager() as _fixture:
yield _fixture
```
Something like this
--
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]