Skip to content

Commit 0bf66bf

Browse files
committed
Fix ci issue
1 parent c494ce0 commit 0bf66bf

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • providers/cncf/kubernetes/tests/unit/cncf/kubernetes/triggers

‎providers/cncf/kubernetes/tests/unit/cncf/kubernetes/triggers/test_pod.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,11 @@ async def test_cleanup_does_not_delete_during_triggerer_restart(self, mock_hook)
840840
on_kill_action="delete_pod",
841841
on_finish_action="delete_pod",
842842
)
843+
mock_hook.close = mock.AsyncMock()
843844
with mock.patch(f"{TRIGGER_PATH}.safe_to_cancel", new_callable=mock.AsyncMock, return_value=False):
844845
await trigger.cleanup()
845846
mock_hook.delete_pod.assert_not_called()
847+
mock_hook.close.assert_awaited_once()
846848

847849
@pytest.mark.skipif(
848850
AIRFLOW_V_3_3_PLUS,
@@ -1020,10 +1022,12 @@ async def test_cleanup_skips_deletion_when_safe_to_cancel_raises(self, mock_hook
10201022
on_kill_action="delete_pod",
10211023
on_finish_action="delete_pod",
10221024
)
1025+
mock_hook.close = mock.AsyncMock()
10231026
with mock.patch(
10241027
f"{TRIGGER_PATH}.safe_to_cancel",
10251028
new_callable=mock.AsyncMock,
10261029
side_effect=Exception("API down"),
10271030
):
10281031
await trigger.cleanup()
10291032
mock_hook.delete_pod.assert_not_called()
1033+
mock_hook.close.assert_awaited_once()

0 commit comments

Comments
 (0)