xinbinhuang commented on a change in pull request #7249: [AIRFLOW-6626] Add 
email on failure or retry to default config
URL: https://github.com/apache/airflow/pull/7249#discussion_r373317405
 
 

 ##########
 File path: tests/models/test_baseoperator.py
 ##########
 @@ -248,6 +249,13 @@ def test_custom_resources(self):
         self.assertEqual(task.resources.cpus.qty, 1)
         self.assertEqual(task.resources.ram.qty, 1024)
 
+    @conf_vars({('email', 'default_email_on_retry'): 'True',
+                ('email', 'default_email_on_failure'): 'False'})
+    def test_default_email_on_actions(self):
+        test_task = DummyOperator(task_id='test_default_email_on_actions')
+        assert test_task.email_on_retry is True
+        assert test_task.email_on_failure is False
 
 Review comment:
   Hi @kaxil, needs some help. When I set `('email', 
'default_email_on_failure'): 'False'`, it seems that 
`test_task.email_on_failure` is still showing as True. 
   
   While when I tried to directly get the config `conf.getboolean('email', 
'default_email_on_failure')`, it is actually set as `False`. I cannot tell 
what's going on.... Do you have any clues?

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


With regards,
Apache Git Services

Reply via email to