gyli commented on code in PR #47592:
URL: https://github.com/apache/airflow/pull/47592#discussion_r2207591094


##########
providers/cncf/kubernetes/tests/unit/cncf/kubernetes/operators/test_job.py:
##########
@@ -639,162 +812,6 @@ def test_execute_deferrable(self, mock_trigger, 
mock_execute_deferrable):
         )
         assert actual_result is None
 
-    
@patch(JOB_OPERATORS_PATH.format("KubernetesJobOperator.get_or_create_pod"))
-    
@patch(JOB_OPERATORS_PATH.format("KubernetesJobOperator.build_job_request_obj"))
-    @patch(JOB_OPERATORS_PATH.format("KubernetesJobOperator.create_job"))
-    @patch(f"{HOOK_CLASS}.wait_until_job_complete")
-    def test_wait_until_job_complete(
-        self,
-        mock_wait_until_job_complete,
-        mock_create_job,
-        mock_build_job_request_obj,
-        mock_get_or_create_pod,
-    ):
-        mock_job_expected = mock_create_job.return_value
-        mock_ti = mock.MagicMock()
-
-        op = KubernetesJobOperator(
-            task_id="test_task_id", wait_until_job_complete=True, 
job_poll_interval=POLL_INTERVAL
-        )
-        op.execute(context=dict(ti=mock_ti))
-
-        assert op.wait_until_job_complete
-        assert op.job_poll_interval == POLL_INTERVAL
-        mock_wait_until_job_complete.assert_called_once_with(
-            job_name=mock_job_expected.metadata.name,
-            namespace=mock_job_expected.metadata.namespace,
-            job_poll_interval=POLL_INTERVAL,
-        )
-
-    @pytest.mark.parametrize("do_xcom_push", [True, False])
-    @pytest.mark.parametrize("get_logs", [True, False])
-    @patch(JOB_OPERATORS_PATH.format("KubernetesJobOperator._write_logs"))
-    def test_execute_complete(self, mocked_write_logs, get_logs, do_xcom_push):
-        mock_ti = mock.MagicMock()
-        context = {"ti": mock_ti}
-        mock_job = mock.MagicMock()
-        event = {
-            "job": mock_job,
-            "status": "success",
-            "pod_name": POD_NAME if get_logs else None,
-            "pod_namespace": POD_NAMESPACE if get_logs else None,
-            "xcom_result": TEST_XCOM_RESULT if do_xcom_push else None,
-        }
-
-        KubernetesJobOperator(
-            task_id="test_task_id", get_logs=get_logs, 
do_xcom_push=do_xcom_push
-        ).execute_complete(context=context, event=event)

Review Comment:
   This is for separating tests that touch db and those don't, and marking the 
db_test mark accurately. `TestKubernetesJobOperatorNonDB` and 
`TestKubernetesJobOperator` have different teardown method, to ensure non_db 
test don't touch db unnecessarily.



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