phanikumv commented on code in PR #29801:
URL: https://github.com/apache/airflow/pull/29801#discussion_r1125620257


##########
tests/providers/microsoft/azure/hooks/test_azure_data_factory.py:
##########
@@ -708,3 +723,214 @@ def 
test_backcompat_prefix_both_prefers_short(mock_connect):
         hook = AzureDataFactoryHook("my_conn")
         hook.delete_factory(factory_name="n/a")
         
mock_connect.return_value.factories.delete.assert_called_with("non-prefixed", 
"n/a")
+
+
+class TestAzureDataFactoryAsyncHook:
+    @pytest.mark.asyncio
+    @pytest.mark.parametrize(

Review Comment:
   yeah, initially I thought of putting all the status in one test by 
parameterization..but asyncio tests on Python 3.7 wont run like that, and will 
give the below error
   
   ```FAILED 
test_azure_data_factory.py::TestAzureDataFactoryAsyncHook::test_get_adf_pipeline_run_status_queued[InProgress]
 - AttributeError: '_patch' object has no attribute '_exit_stack'```
   
   when used in combination with pytest.mark.parametrize it leads to mock 
__enter()__ being called only once per test case (regardless of number of 
"subcases" created with parametrisation), but the patch __exit()__ is called 
after each of the parametrisation "subtests", so only the first "subtest" 
passes and all other fail. Here is a link about the issue for reference
   
   https://github.com/Martiusweb/asynctest/issues/152#issue-666326338
   
   



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