File: test_summary.py

package info (click to toggle)
python-parsl 2025.01.13%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,072 kB
  • sloc: python: 23,817; makefile: 349; sh: 276; ansic: 45
file content (29 lines) | stat: -rw-r--r-- 552 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import pytest

import parsl
from parsl.tests.configs.local_threads import fresh_config


@parsl.python_app
def succeed():
    pass


@parsl.python_app
def fail():
    raise RuntimeError("Deliberate failure in fail() app")


@pytest.mark.local
def test_summary(caplog):

    parsl.load(fresh_config())

    succeed().result()
    fail().exception()

    parsl.dfk().cleanup()

    assert "Summary of tasks in DFK:" in caplog.text
    assert "Tasks in state States.exec_done: 1" in caplog.text
    assert "Tasks in state States.failed: 1" in caplog.text