MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / test_submit_pyfunction_fail

Function test_submit_pyfunction_fail

tests/pyapi/test_function.py:47–59  ·  view source on GitHub ↗
(hq_env: HqEnv)

Source from the content-addressed store, hash-verified

45
46
47def test_submit_pyfunction_fail(hq_env: HqEnv):
48 (job, client) = prepare_job_client(hq_env)
49
50 def body():
51 raise Exception("MyException")
52
53 job.function(body, stderr="err")
54 job_id = client.submit(job)
55 client.wait_for_jobs([job_id], raise_on_error=False)
56 errors = client.get_failed_tasks(job_id)
57 assert list(errors.keys()) == [0]
58 assert errors[0].error.endswith(' raise Exception("MyException")\nException: MyException\n')
59 assert errors[0].stderr == os.path.abspath("err")
60
61
62def test_function_resources(hq_env: HqEnv):

Callers

nothing calls this directly

Calls 6

prepare_job_clientFunction · 0.85
functionMethod · 0.80
keysMethod · 0.80
submitMethod · 0.45
wait_for_jobsMethod · 0.45
get_failed_tasksMethod · 0.45

Tested by

no test coverage detected