From 24768b028a2417ab0abaf242ad4225ee9462b076 Mon Sep 17 00:00:00 2001 From: Andreas Eknes Lie Date: Wed, 20 Sep 2023 14:04:58 +0200 Subject: [PATCH] Fix job_queue test patch --- tests/unit_tests/job_queue/test_job_queue.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tests/unit_tests/job_queue/test_job_queue.py b/tests/unit_tests/job_queue/test_job_queue.py index 59a5879fca1..50c253182a7 100644 --- a/tests/unit_tests/job_queue/test_job_queue.py +++ b/tests/unit_tests/job_queue/test_job_queue.py @@ -325,17 +325,15 @@ def test_stop_long_running(): job_list[i]._start_time = 0 job_list[i]._end_time = 5 - # The driver is of no consequence, so resolving it in the c layer is - # uninteresting and mocked out. - with patch("ert.job_queue.JobQueue._set_driver"): - queue = JobQueue(MagicMock()) - - # We don't need the c layer call here, we only need it added to - # the queue's job_list. - with patch("ert.job_queue.JobQueue._add_job") as _add_job: - for idx, job in enumerate(job_list): - _add_job.return_value = idx - queue.add_job(job, idx) + + queue = JobQueue(MagicMock()) + + # We don't need the c layer call here, we only need it added to + # the queue's job_list. + with patch("ert.job_queue.JobQueue._add_job") as _add_job: + for idx, job in enumerate(job_list): + _add_job.return_value = idx + queue.add_job(job, idx) queue.stop_long_running_jobs(5) queue._differ.transition(queue.job_list)