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

Function test_function_resource_variants

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

Source from the content-addressed store, hash-verified

131
132
133def test_function_resource_variants(hq_env: HqEnv):
134 (job, client) = prepare_job_client(hq_env)
135
136 def foo():
137 pass
138
139 job.function(
140 foo,
141 resources=[
142 ResourceRequest(cpus=2),
143 ResourceRequest(cpus=1, resources={"gpus": 2}),
144 ],
145 )
146 submitted_job = client.submit(job)
147
148 table = hq_env.command(["task", "info", str(submitted_job.id), "0"], as_table=True)
149 table.check_row_value(
150 "Resources",
151 "# Variant 1\ncpus: 2 compact\n# Variant 2\ncpus: 1 compact\ngpus: 2 compact",
152 )

Callers

nothing calls this directly

Calls 6

ResourceRequestClass · 0.90
prepare_job_clientFunction · 0.85
functionMethod · 0.80
commandMethod · 0.80
check_row_valueMethod · 0.80
submitMethod · 0.45

Tested by

no test coverage detected