Is there a good way to test materialization of ass...
# ask-community
r
Is there a good way to test materialization of assets with a configurable resource intialized with variables from a .env-file? I.e within my test-folder i can write an "asset materialization test" like so:
Copy code
def test_materialization():
    assets = [some_asset]
    result = materialize(some_asset, resources=some_resource_depending_on_environment)
    assert result.success
🤖 1
j
you could initialize all of your resource config using EnvVar and then those config values will be read from environment variables
Copy code
from dagster import EnvVar

materialize([some_asset], resources={"my_resource": MyResource(param1=EnvVar("FOO"), param2=EnvVar("BAR")})
r
thanks!!