File: test_execute_task.py

package info (click to toggle)
python-parsl 2026.01.26%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,144 kB
  • sloc: python: 24,400; makefile: 352; sh: 252; ansic: 45
file content (20 lines) | stat: -rw-r--r-- 457 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import os

import pytest

from parsl.executors.execute_task import execute_task
from parsl.serialize.facade import pack_apply_message


def addemup(*args: int, name: str = "apples"):
    total = sum(args)
    return f"{total} {name}"


@pytest.mark.local
def test_execute_task():
    args = (1, 2, 3)
    kwargs = {"name": "boots"}
    buff = pack_apply_message(addemup, args, kwargs)
    res = execute_task(buff)
    assert res == addemup(*args, **kwargs)