Skip to content

Commit

Permalink
reuse simple_app for testing interpolation to hydra config
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasha10 committed Jul 15, 2021
1 parent 27052cf commit 1d7bdd2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
13 changes: 0 additions & 13 deletions tests/test_apps/interpolation_to_hydra_config/my_app.py

This file was deleted.

14 changes: 10 additions & 4 deletions tests/test_hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,12 @@ def test_cfg_with_package(


@mark.parametrize(
"script,resolve,expected",
"script,resolve,flags,expected",
[
param(
"tests/test_apps/simple_interpolation/my_app.py",
False,
[],
dedent(
"""\
a: ${b}
Expand All @@ -475,6 +476,7 @@ def test_cfg_with_package(
param(
"tests/test_apps/simple_interpolation/my_app.py",
True,
[],
dedent(
"""\
a: 10
Expand All @@ -484,8 +486,12 @@ def test_cfg_with_package(
id="resolve",
),
param(
"tests/test_apps/interpolation_to_hydra_config/my_app.py",
"tests/test_apps/simple_app/my_app.py",
True,
[
"--config-name=interp_to_hydra",
"--config-dir=tests/test_apps/simple_app",
],
dedent(
"""\
a: my_app
Expand All @@ -496,9 +502,9 @@ def test_cfg_with_package(
],
)
def test_cfg_resolve_interpolation(
tmpdir: Path, script: str, resolve: bool, expected: str
tmpdir: Path, script: str, resolve: bool, flags: List[str], expected: str
) -> None:
cmd = [script, "hydra.run.dir=" + str(tmpdir), "--cfg=job"]
cmd = [script, "hydra.run.dir=" + str(tmpdir), "--cfg=job"] + flags
if resolve:
cmd.append("--resolve")

Expand Down

0 comments on commit 1d7bdd2

Please sign in to comment.