You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/01/27 07:55:09 UTC

[GitHub] [airflow] xinbinhuang edited a comment on issue #7249: [AIRFLOW-6626] Add email on failure or retry to default config

xinbinhuang edited a comment on issue #7249: [AIRFLOW-6626] Add email on failure or retry to default config
URL: https://github.com/apache/airflow/pull/7249#issuecomment-578629524
 
 
   > Looks almost perfect but it would ideal to have test moved from pre-commit to "tests" folder.
   > 
   > The main reason is it would be ideal to have a test that checks that when a given config is passed, the values returned is boolean.
   > 
   > An example would be:
   > 
   > ```python
   > from tests.test_utils.config import conf_vars
   > 
   > # Some Base class ....
   >     @conf_vars({('email', 'default_email_on_retry'): 'True',
   >                 ('email', 'default_email_on_failure'): 'True'})
   >     def test_default_email_on_actions(self):
   >         # ... Some code to instantiate BaseOperator
   >         self.assertEqual(test_task.default_email_on_retry, True) # or assert test_task.default_email_on_retry == True
   >         self.assertEqual(test_task.default_email_on_failure, True)
   > ```
   > 
   > Something of that sorts
   
   Awesome! I was not aware that it is possible to do this type of testing. (I did start out thinking about testing it in the `tests` folder but could not find a way and came up with this hacky way; should've asked before head next time :) ). 
   
   I will update the PR tomorrow as now it's quite late for PST. Thanks for the advice!

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services