From 255257ba6a9eb49450c92c97fc4ee481c9264ed3 Mon Sep 17 00:00:00 2001 From: Christopher Chou Date: Sat, 27 Jul 2024 15:21:20 -0700 Subject: [PATCH] Add a test for env override in yaml --- tests/test_yaml_parser.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_yaml_parser.py b/tests/test_yaml_parser.py index 1453cfe1620..b8dc8222b4c 100644 --- a/tests/test_yaml_parser.py +++ b/tests/test_yaml_parser.py @@ -146,3 +146,13 @@ def test_invalid_empty_envs(tmp_path): with pytest.raises(ValueError) as e: Task.from_yaml(config_path) assert 'Environment variable \'env_key2\' is None.' in e.value.args[0] + +def test_replace_envs_in_path(tmpdir, tmp_path): + config_path = _create_config_file( + textwrap.dedent(f"""\ + envs: + env_key1: {tmpdir} + workdir: $env_key1 + """), tmp_path) + task = Task.from_yaml(config_path) + assert task.workdir == tmpdir