To test how assets work together, run them in process: result = dg.materialize([raw_orders, paid_orders]). Dagster resolves the dependencies, runs the steps in order with an in-memory instance, and returns a result.
Assert on the result: result.success, result.asset_value("paid_orders") for a stored value, result.get_asset_materialization_events() for metadata, and result.get_asset_check_evaluations() for checks. Pass resources={"shop_api": FakeShop()} to swap resources and partition_key= for partitioned assets.
By default a failing step raises. To test a failure on purpose, pass raise_on_error=False and assert result.success is False. Keep these tests few and meaningful; direct invocation covers the logic, materialize covers the wiring.
Two assets wired together in a test.