MCPcopy
hub / github.com/ashleve/lightning-hydra-template / run_sh_command

Function run_sh_command

tests/helpers/run_sh_command.py:11–22  ·  view source on GitHub ↗

Default method for executing shell commands with `pytest` and `sh` package. :param command: A list of shell commands as strings.

(command: List[str])

Source from the content-addressed store, hash-verified

9
10
11def run_sh_command(command: List[str]) -> None:
12 """Default method for executing shell commands with `pytest` and `sh` package.
13
14 :param command: A list of shell commands as strings.
15 """
16 msg = None
17 try:
18 sh.python(command)
19 except sh.ErrorReturnCode as e:
20 msg = e.stderr.decode()
21 if msg:
22 pytest.fail(msg=msg)

Callers 5

test_experimentsFunction · 0.90
test_hydra_sweepFunction · 0.90
test_hydra_sweep_ddp_simFunction · 0.90
test_optuna_sweepFunction · 0.90

Calls

no outgoing calls

Tested by 5

test_experimentsFunction · 0.72
test_hydra_sweepFunction · 0.72
test_hydra_sweep_ddp_simFunction · 0.72
test_optuna_sweepFunction · 0.72