Skip to content

Commit

Permalink
fix test producing unwanted traceback
Browse files Browse the repository at this point in the history
  • Loading branch information
wxtim committed May 28, 2024
1 parent 10590b1 commit 09c0988
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/integration/test_platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@
"""Integration testing for platforms functionality.
"""

from contextlib import suppress

from cylc.flow.exceptions import NoPlatformsError
from cylc.flow.task_job_logs import get_task_job_activity_log


async def test_prep_submit_task_tries_multiple_platforms(
flow, scheduler, run, mock_glbl_cfg, monkeypatch
flow, scheduler, run, mock_glbl_cfg, monkeypatch, tmp_path
):
"""Preparation tries multiple platforms within a group if the
task platform setting matches a group, and that after all platforms
Expand All @@ -43,9 +48,8 @@ async def test_prep_submit_task_tries_multiple_platforms(
schd = scheduler(wid, paused_start=False, run_mode='live')
async with run(schd):
itask = schd.pool.get_tasks()[0]
# Avoid breaking on trying to create log file path:
schd.task_job_mgr._create_job_log_path = lambda *_: None
itask.submit_num = 1
schd.task_job_mgr.bad_hosts = {'broken', 'broken2'}
res = schd.task_job_mgr._prep_submit_task_job(schd.workflow, itask)
assert res is True
assert isinstance(res, NoPlatformsError)
assert not schd.task_job_mgr.bad_hosts

0 comments on commit 09c0988

Please sign in to comment.