seanghaeli commented on code in PR #75251:
URL: https://github.com/apache/airflow/pull/75251#discussion_r4356959639


##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/test_kube_client.py:
##########
@@ -118,6 +162,24 @@ async def 
test_team_async_factory_takes_precedence_over_the_global_one(self, mon
 
         assert client == FACTORY_MARKER
 
+    @pytest.mark.skipif(not AIRFLOW_V_3_2_PLUS, reason="team config requires 
Airflow 3.2+")
+    @pytest.mark.asyncio
+    async def test_async_factory_is_told_the_team(self, monkeypatch):
+        monkeypatch.setenv(
+            "AIRFLOW__TEAM_A___KUBERNETES_EXECUTOR__ASYNC_CLIENT_FACTORY", 
f"{__name__}.build_team_client"
+        )
+
+        assert await _get_executor_async_kube_client(team_name="team_a") == 
(FACTORY_MARKER, "team_a")
+
+    @pytest.mark.asyncio
+    async def 
test_executor_async_factory_takes_precedence_over_the_config(self):
+        with conf_vars({("kubernetes_executor", "async_client_factory"): 
f"{__name__}.build_other_client"}):

Review Comment:
   This one's async, and the decorator form resets the config before the test 
body actually runs, so it would pass without testing anything. Async tests set 
it inside the body instead, e.g. 
https://github.com/apache/airflow/blob/01907e047f5ba28ab836b78e2b46af6805d4bdc1/airflow-core/tests/unit/jobs/test_triggerer_job.py#L1539-L1541



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