ashb commented on code in PR #54083:
URL: https://github.com/apache/airflow/pull/54083#discussion_r2253901162


##########
providers/google/tests/unit/google/cloud/operators/test_dataflow.py:
##########
@@ -767,10 +776,11 @@ def test_invalid_project_id(self):
             
DataflowDeletePipelineOperator(**init_kwargs).execute(mock.MagicMock())
 
     @pytest.mark.db_test
-    def test_invalid_location(self):
+    def test_invalid_location(self, mock_supervisor_comms):
         """
         Test that AirflowException is raised if Delete Operator is not given a 
location.
         """
+        mock_supervisor_comms.send.return_value = 
ErrorResponse(error=ErrorType.CONNECTION_NOT_FOUND)

Review Comment:
   Two things:
   
   1: is this a db test anymore?
   2: this pattern is so common I wonder if it's worth doing this instead
   
   ```python
       @pytest.mark.db_test
       @pytest.mark.use_fixture("connection_not_found")
       def test_invalid_location(self):
           """
           Test that AirflowException is raised if Delete Operator is not given 
a location.
           """
   ```
   
   That way the detail of how/what is mocked isn't repeated 100s(?) of times? 
And we have a fixture once that does this



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