Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/hydra/my_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def my_app(cfg):
print(OmegaConf.to_yaml(cfg))
# Get dataset_name.
dataset_name = cfg.dataset_name
assert isinstance(dataset_name, str), f"dataset_name must be a str, got {type(dataset_name)}"


if __name__ == "__main__":
Expand Down
10 changes: 10 additions & 0 deletions tests/hydra/test_hydra_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,16 @@ def test_config2_invalid(self):
# Run the call as subprocess.
subprocess.check_call(call, shell=True, stdout=sys.stdout, stderr=sys.stdout)

@pytest.mark.unit
def test_passthrough_config(self):
"""Test calling my_app directly with a DictConfig (cfg_passthrough path)."""
from omegaconf import OmegaConf

from tests.hydra.my_app import my_app

cfg = OmegaConf.create({"dataset_name": "passthrough_test"})
my_app(cfg)

@pytest.mark.integration
def test_config2_filepath_schema(self):
""" "Test injection of valid config2 - using namepath with schema is prohibited."""
Expand Down
Loading