Skip to content

Commit

Permalink
Fix job_queue test patch
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-el committed Sep 20, 2023
1 parent 55fc627 commit 24768b0
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions tests/unit_tests/job_queue/test_job_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 24768b0

Please sign in to comment.