From 7d0f7d2512c338c4d572d4796ac210101e3000e3 Mon Sep 17 00:00:00 2001 From: Kevin Cameron Grismore Date: Thu, 21 Mar 2024 12:27:09 -0500 Subject: [PATCH] test cleanup --- prefect_kubernetes/worker.py | 1 - tests/test_worker.py | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/prefect_kubernetes/worker.py b/prefect_kubernetes/worker.py index 5195cb5..8235d4a 100644 --- a/prefect_kubernetes/worker.py +++ b/prefect_kubernetes/worker.py @@ -968,7 +968,6 @@ def _job_events( """ while True: try: - return watch.stream( func=batch_client.list_namespaced_job, namespace=namespace, diff --git a/tests/test_worker.py b/tests/test_worker.py index f030e89..68539ba 100644 --- a/tests/test_worker.py +++ b/tests/test_worker.py @@ -2637,12 +2637,10 @@ async def test_watch_handles_410( _mock_pods_stream_that_returns_running_pod(), ] - job_list_1 = MagicMock(spec=kubernetes.client.V1JobList) - job_list_1.metadata.resource_version = "1" + job_list = MagicMock(spec=kubernetes.client.V1JobList) + job_list.metadata.resource_version = "1" - mock_batch_client.list_namespaced_job.side_effect = [ - job_list_1, - ] + mock_batch_client.list_namespaced_job.side_effect = [job_list] # The job should not be completed to start mock_batch_client.read_namespaced_job.return_value.status.completion_time = None