From 29184aff9b0f455e727d207e0964855a109db596 Mon Sep 17 00:00:00 2001 From: Linlang <30293408+SunsetWolf@users.noreply.github.com> Date: Thu, 11 Jul 2024 12:13:42 +0800 Subject: [PATCH] fix pytest localenv error (#62) --- rdagent/utils/env.py | 3 ++- test/utils/test_env.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rdagent/utils/env.py b/rdagent/utils/env.py index d3835943..8d079d6a 100644 --- a/rdagent/utils/env.py +++ b/rdagent/utils/env.py @@ -94,7 +94,8 @@ class LocalEnv(Env[LocalConf]): cwd = None if local_path: cwd = Path(local_path).resolve() - print(command) + print(f"CWD: {cwd}") + result = subprocess.run( command, cwd=cwd, diff --git a/test/utils/test_env.py b/test/utils/test_env.py index f5b7850b..2f41764f 100644 --- a/test/utils/test_env.py +++ b/test/utils/test_env.py @@ -30,8 +30,9 @@ class EnvUtils(unittest.TestCase): # ) # qle = LocalEnv(conf=local_conf) # qle.prepare() + # exe_path = str(DIRNAME / "env_tpl") # conf_path = str(DIRNAME / "env_tpl" / "conf.yaml") - # qle.run(entry="qrun " + conf_path) + # qle.run(entry="qrun " + conf_path, local_path=exe_path) # mlrun_p = DIRNAME / "env_tpl" / "mlruns" # self.assertTrue(mlrun_p.exists(), f"Expected output file {mlrun_p} not found")