Jorricks commented on a change in pull request #17207:
URL: https://github.com/apache/airflow/pull/17207#discussion_r707032501



##########
File path: tests/executors/test_celery_executor.py
##########
@@ -288,6 +291,9 @@ def test_command_validation(self, command, 
expected_exception):
         with mock.patch(
             'airflow.executors.celery_executor._execute_in_subprocess'
         ) as mock_subproc, 
mock.patch('airflow.executors.celery_executor._execute_in_fork') as mock_fork:
+            test_app = MagicMock()
+            test_app.current_task.request.id.side_effect = 
"abcdef-124215-abcdef"
+            mock.patch('airflow.executors.celery_executor.app', test_app)

Review comment:
       I don't really like having two mock.patches on the same line. I choose 
not to use three because it becomes more unreadable the more you add. I think 
it's better the way it is already.
   However, I don't really have a strong opinion on it, so if you would like me 
to change it, let me know.




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


Reply via email to