mik-laj commented on a change in pull request #10282:
URL: https://github.com/apache/airflow/pull/10282#discussion_r468914496
##########
File path: tests/test_local_settings.py
##########
@@ -149,3 +161,14 @@ def test_pod_mutation_hook(self):
settings.pod_mutation_hook(pod)
assert pod.namespace == 'airflow-tests'
+
+ def test_custom_policy(self):
+ with SettingsContext(SETTINGS_FILE_MUST_HAVE_OWNER_POLICY,
"airflow_local_settings"):
+ from airflow import settings
+ settings.import_local_settings()
+
+ task_instance = MagicMock()
+ task_instance.owner = 'airflow'
+ with self.assertRaises(AirflowClusterPolicyViolation):
+ settings.task_must_have_owners(task_instance) # pylint:
disable=no-member
Review comment:
The ``task_must_have_owners`` attribute is not expected to exist on this
object. We should only test `cluster_policy` in our tests.
For now, this test only tests if the function is copied correctly by
``import_local_settings``, but it's already covered by other tests -
`test_pod_mutation_hook`, `test_policy_function`
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]