potiuk commented on a change in pull request #21074:
URL: https://github.com/apache/airflow/pull/21074#discussion_r792981151
##########
File path: tests/core/test_providers_manager.py
##########
@@ -179,3 +188,13 @@ def test_auth_backends(self):
provider_manager = ProvidersManager()
auth_backend_module_names =
list(provider_manager.auth_backend_module_names)
assert len(auth_backend_module_names) > 0
+
+ @patch("builtins.__import__", new=raising_import)
+ def test_optional_features(self):
+ with self._caplog.at_level(logging.WARNING):
+ provider_manager = ProvidersManager()
+ list(provider_manager.field_behaviours)
+ # exasol raises regular import error with warning
+ assert "Custom Import Error: pyexasol" in
str(self._caplog.messages)
+ # leveldb raises the AirflowOptionalProviderFeatureException with
no warning
+ assert "Custom Import Error: plyvel" not in
str(self._caplog.messages)
Review comment:
Yeah. Crossed my mind too. Might be to much of a shortcut indeed.
--
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]