mik-laj commented on a change in pull request #4708: [AIRFLOW-3888] HA for 
metastore connection
URL: https://github.com/apache/airflow/pull/4708#discussion_r270550384
 
 

 ##########
 File path: tests/hooks/test_hive_hook.py
 ##########
 @@ -282,6 +283,13 @@ def test_get_max_partition_from_valid_part_specs(self):
     def test_get_metastore_client(self):
         self.assertIsInstance(self.hook.get_metastore_client(), HMSClient)
 
+    @mock.patch("airflow.hooks.hive_hooks.HiveMetastoreHook.get_connection",
+                **{'return_value': [Connection(host="localhost", port=9802)]})
 
 Review comment:
   Preferred syntax does not work properly in all cases supported by mock. I 
often use only one syntax, so that I do not have to think which is right at the 
moment.
   Reference: 
   
https://github.com/apache/airflow/blob/49b98ab2b5dc37c69598d485d62dd39372ab6aa9/tests/contrib/hooks/test_gcp_natural_language_hook.py#L57-L68
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to