Hello folks!, I’m facing an issue while testing on...
# ask-community
d
Hello folks!, I’m facing an issue while testing one of the prefect flow using pytest. I’m fetching a dynaconf configuration from the
settings.toml
file within a prefect flow and passing it to a python method that just prints the configured value. In the test case, I’m mimicing the the test configurations and on running the test cases the python method prints the configuration value as it is. But the moment i decorate the python method with.
@prefect.task
it prints the actual configuration value from the
settings.toml
file instead of test configurations Accessing `conf_value = settings.get(“conf_key”,“default_value”) within the task returns the test configuration though. The issue is only when the configuration is passed into the prefect task. Does anybody knows why?
Copy code
@prefect.task
def print_param(param:str):
     print(param)

with Flow("test_flow") as flow:
     conf_value = settings.get("conf_key","default_value")
     print_param(conf_value) // prints the test configuration when not decorated with @prefect.task, prints the