amoghrajesh commented on code in PR #60218:
URL: https://github.com/apache/airflow/pull/60218#discussion_r2680915651


##########
airflow-core/tests/unit/always/test_providers_manager.py:
##########
@@ -83,104 +81,6 @@ def test_providers_are_loaded(self):
             assert len(provider_list) > 65
             assert self._caplog.records == []
 
-    def test_hooks_deprecation_warnings_generated(self):
-        providers_manager = ProvidersManager()
-        providers_manager._provider_dict["test-package"] = ProviderInfo(
-            version="0.0.1",
-            data={"hook-class-names": 
["airflow.providers.sftp.hooks.sftp.SFTPHook"]},
-        )
-        with pytest.warns(expected_warning=DeprecationWarning, 
match="hook-class-names") as warning_records:
-            providers_manager._discover_hooks()
-        assert warning_records
-
-    def test_hooks_deprecation_warnings_not_generated(self):
-        with warnings.catch_warnings(record=True) as warning_records:
-            providers_manager = ProvidersManager()
-            providers_manager._provider_dict["apache-airflow-providers-sftp"] 
= ProviderInfo(
-                version="0.0.1",
-                data={
-                    "hook-class-names": 
["airflow.providers.sftp.hooks.sftp.SFTPHook"],
-                    "connection-types": [
-                        {
-                            "hook-class-name": 
"airflow.providers.sftp.hooks.sftp.SFTPHook",
-                            "connection-type": "sftp",
-                        }
-                    ],
-                },
-            )
-            providers_manager._discover_hooks()
-        assert [w.message for w in warning_records if "hook-class-names" in 
str(w.message)] == []
-
-    def test_warning_logs_generated(self):
-        providers_manager = ProvidersManager()
-        providers_manager._hooks_lazy_dict = LazyDictWithCache()
-        with self._caplog.at_level(logging.WARNING):
-            providers_manager._provider_dict["apache-airflow-providers-sftp"] 
= ProviderInfo(
-                version="0.0.1",
-                data={
-                    "hook-class-names": 
["airflow.providers.sftp.hooks.sftp.SFTPHook"],
-                    "connection-types": [
-                        {
-                            "hook-class-name": 
"airflow.providers.sftp.hooks.sftp.SFTPHook",
-                            "connection-type": "wrong-connection-type",
-                        }
-                    ],
-                },
-            )
-            providers_manager._discover_hooks()
-            _ = providers_manager._hooks_lazy_dict["wrong-connection-type"]
-        assert len(self._caplog.entries) == 1
-        assert "Inconsistency!" in self._caplog[0]["event"]
-        assert "sftp" not in providers_manager.hooks
-
-    def test_warning_logs_not_generated(self):
-        with self._caplog.at_level(logging.WARNING):
-            providers_manager = ProvidersManager()
-            providers_manager._provider_dict["apache-airflow-providers-sftp"] 
= ProviderInfo(
-                version="0.0.1",
-                data={
-                    "hook-class-names": 
["airflow.providers.sftp.hooks.sftp.SFTPHook"],
-                    "connection-types": [
-                        {
-                            "hook-class-name": 
"airflow.providers.sftp.hooks.sftp.SFTPHook",
-                            "connection-type": "sftp",
-                        }
-                    ],
-                },
-            )
-            providers_manager._discover_hooks()
-            _ = providers_manager._hooks_lazy_dict["sftp"]
-        assert not self._caplog.records
-        assert "sftp" in providers_manager.hooks
-
-    def test_already_registered_conn_type_in_provide(self):
-        with self._caplog.at_level(logging.WARNING):
-            providers_manager = ProvidersManager()
-            providers_manager._provider_dict["apache-airflow-providers-dummy"] 
= ProviderInfo(
-                version="0.0.1",
-                data={
-                    "connection-types": [
-                        {
-                            "hook-class-name": 
"airflow.providers.dummy.hooks.dummy.DummyHook",
-                            "connection-type": "dummy",
-                        },
-                        {
-                            "hook-class-name": 
"airflow.providers.dummy.hooks.dummy.DummyHook2",
-                            "connection-type": "dummy",
-                        },
-                    ],
-                },
-            )
-            providers_manager._discover_hooks()
-            _ = providers_manager._hooks_lazy_dict["dummy"]
-        assert len(self._caplog.records) == 1
-        msg = self._caplog.messages[0]
-        assert msg.startswith("The connection type 'dummy' is already 
registered")
-        assert (
-            "different class names: 
'airflow.providers.dummy.hooks.dummy.DummyHook'"
-            " and 'airflow.providers.dummy.hooks.dummy.DummyHook2'."
-        ) in msg
-

Review Comment:
   These tests deal with hooks, so they have been moved into `sdk` because 
`ProvidersManagerRuntime` deals with hooks



-- 
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