ashb commented on a change in pull request #5570: [AIRFLOW-4939] Add 
default_task_retries config
URL: https://github.com/apache/airflow/pull/5570#discussion_r303002450
 
 

 ##########
 File path: tests/operators/test_bash_operator.py
 ##########
 @@ -98,3 +105,22 @@ def test_return_value(self):
         return_value = bash_operator.execute(context={})
 
         self.assertEqual(return_value, 'stdout')
+
+    def test_task_retries(self):
+        bash_operator = BashOperator(
+            bash_command='echo "stdout"',
+            task_id='test_task_retries',
+            retries=2,
+            dag=None
+        )
+
+        self.assertEqual(bash_operator.retries, 2)
+
+    def test_default_retries(self):
+        bash_operator = BashOperator(
+            bash_command='echo "stdout"',
+            task_id='test_default_retries',
+            dag=None
+        )
+
+        self.assertEqual(bash_operator.retries, 3)
 
 Review comment:
   Does this test pass? Does default values are evaluated at module parse time, 
so changing the config value at runtime here won't affect the already-loaded 
default argument in the fn.

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


With regards,
Apache Git Services

Reply via email to