In custom_kedro_context class, I've setup_env_vari...
# questions
d
In custom_kedro_context class, I've setup_env_variables, spark_session, configure_imports, import_pipelines. Only
import_pipelines
is returning a dictionary. When I try to import
import_pipelines
into the test, it is not producing any results. I tried to print the results within class and it is printing but when I try to print in the test it is not. Can someone help here?
m
What is your implementation of
import_pipelines
? If you’re relying on Kedro auto discovery mechanism here, you most likely need to bootstrap the project in tests, before trying to obtain the pipelines. Alternatively, you can also mock the pipelines dict directly:
Copy code
dummy_pipeline = pipeline([node(lambda a: a, inputs="a", outputs="b", name="node1"])
with patch.dict(
        "kedro.framework.project.pipelines", {"__default__": dummy_pipeline}
    ):
        # test code