From 91765e3e70f8a4ba7ef3931a7855aed0ec97eb82 Mon Sep 17 00:00:00 2001 From: Janne Holopainen Date: Mon, 16 Sep 2024 11:10:16 +0200 Subject: [PATCH] Fix template projects example tests (#4159) * Fix: Switch ConfigLoader to OmegaConfigLoader Signed-off-by: Janne Holopainen * Fix: Add env to KedroContext Signed-off-by: Janne Holopainen * Doc: Add changes to RELEASE.md Signed-off-by: Janne Holopainen --------- Signed-off-by: Janne Holopainen --- RELEASE.md | 2 ++ .../project/{{ cookiecutter.repo_name }}/tests/test_run.py | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 548b49a109..6c126e8ab6 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -7,6 +7,7 @@ * Enhanced `OmegaConfigLoader` configuration validation to detect duplicate keys at all parameter levels, ensuring comprehensive nested key checking. ## Bug fixes and other changes * Fixed bug where using dataset factories breaks with `ThreadRunner`. +* Fixed template projects example tests. ## Breaking changes to the API * Removed `ShelveStore` to address a security vulnerability. @@ -18,6 +19,7 @@ ## Community contributions * [Puneet](https://github.com/puneeter) * [ethanknights](https://github.com/ethanknights) +* [Manezki](https://github.com/Manezki) # Release 0.19.8 diff --git a/kedro/templates/project/{{ cookiecutter.repo_name }}/tests/test_run.py b/kedro/templates/project/{{ cookiecutter.repo_name }}/tests/test_run.py index eb57d1908e..c7b3cf08a8 100644 --- a/kedro/templates/project/{{ cookiecutter.repo_name }}/tests/test_run.py +++ b/kedro/templates/project/{{ cookiecutter.repo_name }}/tests/test_run.py @@ -12,7 +12,7 @@ import pytest -from kedro.config import ConfigLoader +from kedro.config import OmegaConfigLoader from kedro.framework.context import KedroContext from kedro.framework.hooks import _create_hook_manager from kedro.framework.project import settings @@ -20,7 +20,7 @@ @pytest.fixture def config_loader(): - return ConfigLoader(conf_source=str(Path.cwd() / settings.CONF_SOURCE)) + return OmegaConfigLoader(conf_source=str(Path.cwd() / settings.CONF_SOURCE)) @pytest.fixture @@ -28,6 +28,7 @@ def project_context(config_loader): return KedroContext( package_name="{{ cookiecutter.python_package }}", project_path=Path.cwd(), + env="local", config_loader=config_loader, hook_manager=_create_hook_manager(), )