uranusjr commented on a change in pull request #19639:
URL: https://github.com/apache/airflow/pull/19639#discussion_r758930299



##########
File path: tests/sensors/test_sql_sensor.py
##########
@@ -86,8 +86,8 @@ def test_sql_sensor_postgres(self):
         )
         op2.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, 
ignore_ti_state=True)
 
-    @mock.patch('airflow.sensors.sql.BaseHook')
-    def test_sql_sensor_postgres_poke(self, mock_hook):
+    def test_sql_sensor_postgres_poke(self):
+        mock_hook = mock.MagicMock(spec=BaseHook)

Review comment:
       I think you need to do this instead (same for all other tests)
   
   ```suggestion
       @mock.patch('airflow.sensors.sql.BaseHook', new_callable=mock.MagicMock, 
spec=True)
       def test_sql_sensor_postgres_poke(self, mock_hook):
   ```
   
   `spec=True` is the same as `spec=BaseHook` without needing to import the 
class.




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