MCPcopy
hub / github.com/deepspeedai/DeepSpeed / test_bash_string_args

Function test_bash_string_args

tests/unit/launcher/test_user_args.py:73–85  ·  view source on GitHub ↗
(tmpdir, user_script_fp)

Source from the content-addressed store, hash-verified

71
72
73def test_bash_string_args(tmpdir, user_script_fp):
74 bash_script = f"""
75 ARGS="--prompt 'DeepSpeed is the best'"
76 echo ${{ARGS}}|xargs deepspeed --num_nodes 1 --num_gpus 1 {user_script_fp}
77 """
78
79 bash_fp = tmpdir.join("bash_script.sh")
80 with open(bash_fp, "w") as f:
81 f.write(bash_script)
82
83 p = subprocess.Popen(["bash", bash_fp], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
84 out, err = p.communicate()
85 assert "ARG PARSE SUCCESS" in out.decode("utf-8"), f"User args not parsed correctly: {err.decode('utf-8')}"
86
87
88def test_add_export_with_special_characters(dummy_runner):

Callers

nothing calls this directly

Calls 2

decodeMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…