https://dagster.io/ logo
Title
d

dixel

02/15/2022, 4:36 PM
Hi team! I couldn't use the approach to mock resources suggested in the documentation: https://docs.dagster.io/concepts/testing#testing-graphs
download.execute_in_process(resources={"api": ResourceDefinition.mock_resource()})
as
execute_in_process
method doesn't have
resources
or
resource_defs
parameter (https://docs.dagster.io/_apidocs/jobs#dagster.JobDefinition.execute_in_process). I found some workarounds (converting all the jobs to graphs, and passing resource_defs in there), but wondering if
resources
is still expected to be part of
execute_in_process
.
c

claire

02/15/2022, 6:29 PM
Hi Vasilii, the
execute_in_process
method for graphs contains a resource parameter: https://docs.dagster.io/_apidocs/execution#executing-graphs Alternatively, you could convert your graphs to jobs and pass
resource_defs
from there.
d

dixel

02/16/2022, 8:57 AM
Thanks Claire 🙂 ! I will convert all our jobs to graphs initially and would either call
to_job
for normal execution, or
execute_in_process
for testing.